* ifcvt.c (dead_or_predicable): Check jump to be free of side
effects.
testsuite/
* gcc.dg/torture/pr61772.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212563
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-07-15 Michael Matz <matz@suse.de>
+
+ PR rtl-optimization/61772
+ * ifcvt.c (dead_or_predicable): Check jump to be free of side
+ effects.
+
2014-07-15 Richard Biener <rguenther@suse.de>
* opts.c (default_options_table): Disable bit-ccp at -Og.
if (JUMP_P (end))
{
+ if (!onlyjump_p (end))
+ return FALSE;
if (head == end)
{
head = end = NULL_RTX;
+2014-07-15 Michael Matz <matz@suse.de>
+
+ PR rtl-optimization/61772
+ * gcc.dg/torture/pr61772.c: New test.
+
2014-07-15 Marek Polacek <polacek@redhat.com>
* gcc.dg/ubsan/bounds-1.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-times "XXX" 2 } } */
+
+static inline __attribute__((always_inline)) int dec_and_test (int *i)
+{
+ asm volatile goto ("XXX %0, %l[cc_label]"
+ : : "m" (*i) : "memory" : cc_label);
+ return 0;
+cc_label:
+ return 1;
+}
+extern int getit (int *);
+int f (int *i, int cond)
+{
+ if (cond) {
+ getit (0);
+ if (dec_and_test (i))
+ getit (i);
+ return 42;
+ }
+ if (dec_and_test (i))
+ (void)1;
+ return getit (i);
+}