aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2011-03-30 15:36:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-03-30 15:36:45 +0000
commit4f431835313bc7d2c13508e8ed7b465e4c5ad8c8 (patch)
tree139f47c1833e817b3c52c99c3c3298474b0f5bce
parentf72f4169133572cf62f1e872c5657cdbc4d5de2c (diff)
downloadgcc-4f431835313bc7d2c13508e8ed7b465e4c5ad8c8.zip
gcc-4f431835313bc7d2c13508e8ed7b465e4c5ad8c8.tar.gz
gcc-4f431835313bc7d2c13508e8ed7b465e4c5ad8c8.tar.bz2
re PR bootstrap/48332 (optabs changes (PR48263 fix) broke m68k-linux bootstrap)
gcc/ PR rtl-optimization/48332 * optabs.c (expand_binop_directly): Set xmodeN to the target-mandated mode of input operand N and modeN to its actual mode. From-SVN: r171733
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/optabs.c40
2 files changed, 26 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4c69f86..6f575e3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-30 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR rtl-optimization/48332
+ * optabs.c (expand_binop_directly): Set xmodeN to the target-mandated
+ mode of input operand N and modeN to its actual mode.
+
2011-03-30 Jeff Law <law@redhat.com>
* reload.h (reg_equiv_constant): Move into new structure reg_equivs,
diff --git a/gcc/optabs.c b/gcc/optabs.c
index a133596b3..e60abf8 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1243,9 +1243,9 @@ expand_binop_directly (enum machine_mode mode, optab binoptab,
rtx last)
{
enum insn_code icode = optab_handler (binoptab, mode);
- enum machine_mode mode0 = insn_data[(int) icode].operand[1].mode;
- enum machine_mode mode1 = insn_data[(int) icode].operand[2].mode;
- enum machine_mode tmp_mode;
+ enum machine_mode xmode0 = insn_data[(int) icode].operand[1].mode;
+ enum machine_mode xmode1 = insn_data[(int) icode].operand[2].mode;
+ enum machine_mode mode0, mode1, tmp_mode;
struct expand_operand ops[3];
bool commutative_p;
rtx pat;
@@ -1256,8 +1256,8 @@ expand_binop_directly (enum machine_mode mode, optab binoptab,
if we would swap the operands, we can save the conversions. */
commutative_p = commutative_optab_p (binoptab);
if (commutative_p
- && GET_MODE (xop0) != mode0 && GET_MODE (xop1) != mode1
- && GET_MODE (xop0) == mode1 && GET_MODE (xop1) == mode1)
+ && GET_MODE (xop0) != xmode0 && GET_MODE (xop1) != xmode1
+ && GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode1)
{
swap = xop0;
xop0 = xop1;
@@ -1265,9 +1265,9 @@ expand_binop_directly (enum machine_mode mode, optab binoptab,
}
/* If we are optimizing, force expensive constants into a register. */
- xop0 = avoid_expensive_constant (mode0, binoptab, xop0, unsignedp);
+ xop0 = avoid_expensive_constant (xmode0, binoptab, xop0, unsignedp);
if (!shift_optab_p (binoptab))
- xop1 = avoid_expensive_constant (mode1, binoptab, xop1, unsignedp);
+ xop1 = avoid_expensive_constant (xmode1, binoptab, xop1, unsignedp);
/* In case the insn wants input operands in modes different from
those of the actual operands, convert the operands. It would
@@ -1275,19 +1275,19 @@ expand_binop_directly (enum machine_mode mode, optab binoptab,
that they're properly zero-extended, sign-extended or truncated
for their mode. */
- if (GET_MODE (xop0) != mode0 && mode0 != VOIDmode)
- xop0 = convert_modes (mode0,
- GET_MODE (xop0) != VOIDmode
- ? GET_MODE (xop0)
- : mode,
- xop0, unsignedp);
-
- if (GET_MODE (xop1) != mode1 && mode1 != VOIDmode)
- xop1 = convert_modes (mode1,
- GET_MODE (xop1) != VOIDmode
- ? GET_MODE (xop1)
- : mode,
- xop1, unsignedp);
+ mode0 = GET_MODE (xop0) != VOIDmode ? GET_MODE (xop0) : mode;
+ if (xmode0 != VOIDmode && xmode0 != mode0)
+ {
+ xop0 = convert_modes (xmode0, mode0, xop0, unsignedp);
+ mode0 = xmode0;
+ }
+
+ mode1 = GET_MODE (xop1) != VOIDmode ? GET_MODE (xop1) : mode;
+ if (xmode1 != VOIDmode && xmode1 != mode1)
+ {
+ xop1 = convert_modes (xmode1, mode1, xop1, unsignedp);
+ mode1 = xmode1;
+ }
/* If operation is commutative,
try to make the first operand a register.