2017-11-25 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/81553
+ * combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z)
+ to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP
+ is a shift where C1 has different mode than the whole shift, use C1's
+ mode for MULT rather than the shift's mode.
+
PR target/82848
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Don't fold
builtins not enabled in the currently selected ISA.
if (z)
{
- temp = subst (simplify_gen_relational (true_code, m, VOIDmode,
+ machine_mode cm = m;
+ if ((op == ASHIFT || op == LSHIFTRT || op == ASHIFTRT)
+ && GET_MODE (c1) != VOIDmode)
+ cm = GET_MODE (c1);
+ temp = subst (simplify_gen_relational (true_code, cm, VOIDmode,
cond_op0, cond_op1),
pc_rtx, pc_rtx, 0, 0, 0);
- temp = simplify_gen_binary (MULT, m, temp,
- simplify_gen_binary (MULT, m, c1,
+ temp = simplify_gen_binary (MULT, cm, temp,
+ simplify_gen_binary (MULT, cm, c1,
const_true_rtx));
temp = subst (temp, pc_rtx, pc_rtx, 0, 0, 0);
temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp);
+2017-11-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/81553
+ * gcc.c-torture/compile/pr81553.c: New test.
+
2017-11-25 Andreas Schwab <schwab@linux-m68k.org>
* g++.dg/abi/structret1.C (FrameworkObject::action): Return a