mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-26 07:30:29 +08:00
re PR middle-end/12705 (: complex powers)
PR middle-end/12705 * optabs.c (expand_binop): When expanding complex operations inline, always calculate result into a new temporary register. Minor code clean-ups. From-SVN: r72871
This commit is contained in:
parent
7989e4dc24
commit
c7d91a943b
@ -1,3 +1,10 @@
|
|||||||
|
2003-10-23 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
|
PR middle-end/12705
|
||||||
|
* optabs.c (expand_binop): When expanding complex operations
|
||||||
|
inline, always calculate result into a new temporary register.
|
||||||
|
Minor code clean-ups.
|
||||||
|
|
||||||
2003-10-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
|
2003-10-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
|
||||||
|
|
||||||
* objc/lang-specs.h: Handle -print-objc-runtime-info.
|
* objc/lang-specs.h: Handle -print-objc-runtime-info.
|
||||||
|
29
gcc/optabs.c
29
gcc/optabs.c
@ -1521,24 +1521,17 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
rtx real0 = 0, imag0 = 0;
|
rtx real0 = 0, imag0 = 0;
|
||||||
rtx real1 = 0, imag1 = 0;
|
rtx real1 = 0, imag1 = 0;
|
||||||
rtx realr, imagr, res;
|
rtx realr, imagr, res;
|
||||||
rtx seq;
|
rtx seq, result;
|
||||||
rtx equiv_value;
|
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
/* Find the correct mode for the real and imaginary parts. */
|
/* Find the correct mode for the real and imaginary parts. */
|
||||||
enum machine_mode submode = GET_MODE_INNER(mode);
|
enum machine_mode submode = GET_MODE_INNER (mode);
|
||||||
|
|
||||||
if (submode == BLKmode)
|
if (submode == BLKmode)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
if (! target)
|
|
||||||
target = gen_reg_rtx (mode);
|
|
||||||
|
|
||||||
start_sequence ();
|
start_sequence ();
|
||||||
|
|
||||||
realr = gen_realpart (submode, target);
|
|
||||||
imagr = gen_imagpart (submode, target);
|
|
||||||
|
|
||||||
if (GET_MODE (op0) == mode)
|
if (GET_MODE (op0) == mode)
|
||||||
{
|
{
|
||||||
real0 = gen_realpart (submode, op0);
|
real0 = gen_realpart (submode, op0);
|
||||||
@ -1558,6 +1551,10 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0))
|
if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0))
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
result = gen_reg_rtx (mode);
|
||||||
|
realr = gen_realpart (submode, result);
|
||||||
|
imagr = gen_imagpart (submode, result);
|
||||||
|
|
||||||
switch (binoptab->code)
|
switch (binoptab->code)
|
||||||
{
|
{
|
||||||
case PLUS:
|
case PLUS:
|
||||||
@ -1749,16 +1746,10 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (binoptab->code != UNKNOWN)
|
rtx equiv = gen_rtx_fmt_ee (binoptab->code, mode,
|
||||||
equiv_value
|
copy_rtx (op0), copy_rtx (op1));
|
||||||
= gen_rtx_fmt_ee (binoptab->code, mode,
|
emit_no_conflict_block (seq, result, op0, op1, equiv);
|
||||||
copy_rtx (op0), copy_rtx (op1));
|
return result;
|
||||||
else
|
|
||||||
equiv_value = 0;
|
|
||||||
|
|
||||||
emit_no_conflict_block (seq, target, op0, op1, equiv_value);
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user