2015-11-11 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (gen_compare_reg): Swap operands also when we
do not expand to rtl.
From-SVN: r230217
+2015-11-12 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/arc/arc.c (gen_compare_reg): Swap operands also when we
+ do not expand to rtl.
+
2015-11-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/58497
{
rtx op0 = gen_rtx_REG (cmode, 0);
rtx op1 = gen_rtx_REG (cmode, GET_MODE_SIZE (cmode) / UNITS_PER_WORD);
+ bool swap = false;
switch (code)
{
break;
case LT: case UNGE: case LE: case UNGT:
code = swap_condition (code);
- tmp = x;
- x = y;
- y = tmp;
+ swap = true;
break;
default:
gcc_unreachable ();
}
if (currently_expanding_to_rtl)
{
+ if (swap)
+ {
+ tmp = x;
+ x = y;
+ y = tmp;
+ }
emit_move_insn (op0, x);
emit_move_insn (op1, y);
}
{
gcc_assert (rtx_equal_p (op0, x));
gcc_assert (rtx_equal_p (op1, y));
+ if (swap)
+ {
+ op0 = y;
+ op1 = x;
+ }
}
emit_insn (gen_cmp_float (cc_reg, gen_rtx_COMPARE (mode, op0, op1)));
}