+2010-11-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46637
+ * combine.c (try_combine): When substing i2dest for i2src, pass
+ 1 as last argument even if
+ i0_feeds_i1_n && i1_feeds_i2_n && i0dest_in_i0src.
+
2010-11-25 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/46647
/* If I1 feeds into I2 and I1DEST is in I1SRC, we need to make a unique
copy of I2SRC each time we substitute it, in order to avoid creating
self-referential RTL when we will be substituting I1SRC for I1DEST
- later. Likewise if I0 feeds into I2 and I0DEST is in I0SRC. */
+ later. Likewise if I0 feeds into I2, either directly or indirectly
+ through I1, and I0DEST is in I0SRC. */
newpat = subst (PATTERN (i3), i2dest, i2src, 0,
(i1_feeds_i2_n && i1dest_in_i1src)
- || (i0_feeds_i2_n && i0dest_in_i0src));
+ || ((i0_feeds_i2_n || (i0_feeds_i1_n && i1_feeds_i2_n))
+ && i0dest_in_i0src));
substed_i2 = 1;
/* Record whether I2's body now appears within I3's body. */
+2010-11-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46637
+ * gcc.c-torture/compile/pr46637.c: New test.
+
2010-11-25 H.J. Lu <hongjiu.lu@intel.com>
* gfortran.dg/pr46519-1.f: Add -mtune=generic.
--- /dev/null
+/* PR middle-end/46637 */
+
+struct S { int s[5]; } *p;
+
+void
+foo (long x)
+{
+ long a = x == 1 ? 4L : 1L;
+ asm ("" : "+m" (p->s[a]));
+ p->s[0]++;
+}