+2017-01-27 Bin Cheng <bin.cheng@arm.com>
+
+ PR rtl-optimization/78559
+ * combine.c (try_combine): Discard REG_EQUAL and REG_EQUIV for
+ other_insn in combine.
+
2017-01-27 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* builtin-types.def: Use unsigned_char_type_node for BT_UINT8. Use
PATTERN (undobuf.other_insn)))
||(REG_NOTE_KIND (note) == REG_UNUSED
&& !reg_set_p (XEXP (note, 0),
- PATTERN (undobuf.other_insn))))
+ PATTERN (undobuf.other_insn)))
+ /* Simply drop equal note since it may be no longer valid
+ for other_insn. It may be possible to record that CC
+ register is changed and only discard those notes, but
+ in practice it's unnecessary complication and doesn't
+ give any meaningful improvement.
+
+ See PR78559. */
+ || REG_NOTE_KIND (note) == REG_EQUAL
+ || REG_NOTE_KIND (note) == REG_EQUIV)
remove_note (undobuf.other_insn, note);
}
+2017-01-27 Bin Cheng <bin.cheng@arm.com>
+
+ PR rtl-optimization/78559
+ * gcc.c-torture/execute/pr78559.c: New test.
+
2017-01-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/79245
--- /dev/null
+/* PR rtl-optimization/78559 */
+
+int g = 20;
+int d = 0;
+
+short
+fn2 (int p1, int p2)
+{
+ return p2 >= 2 || 5 >> p2 ? p1 : p1 << p2;
+}
+
+int
+main ()
+{
+ int result = 0;
+lbl_2582:
+ if (g)
+ {
+ for (int c = -3; c; c++)
+ result = fn2 (1, g);
+ }
+ else
+ {
+ for (int i = 0; i < 2; i += 2)
+ if (d)
+ goto lbl_2582;
+ }
+ if (result != 1)
+ __builtin_abort ();
+ return 0;
+}
+
+
+