PR rtl-optimization/35729
* loop-invariant.c (check_maybe_invariant): Disallow volatile memory
references.
* gcc.dg/pr35729.c: New test.
From-SVN: r133755
+2008-03-31 Zdenek Dvorak <ook@ucw.cz>
+
+ PR rtl-optimization/35729
+ * loop-invariant.c (check_maybe_invariant): Disallow volatile memory
+ references.
+
2008-03-31 H.J. Lu <hongjiu.lu@intel.com>
PR target/32000
/* Just handle the most trivial case where we load from an unchanging
location (most importantly, pic tables). */
- if (MEM_READONLY_P (x))
+ if (MEM_READONLY_P (x) && !MEM_VOLATILE_P (x))
break;
return false;
+2008-03-31 Zdenek Dvorak <ook@ucw.cz>
+
+ PR rtl-optimization/35729
+ * gcc.dg/pr35729.c: New test.
+
2008-03-31 H.J. Lu <hongjiu.lu@intel.com>
PR target/32000
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-rtl-loop2_invariant" } */
+
+const volatile int g_361 = 3L;
+volatile int g_2 = 0L;
+void func_1 (void)
+{
+ for (g_2 = 0; g_2 > 10; g_2++)
+ {
+ int l_357 = g_361;
+ }
+}
+
+/* { dg-final { scan-rtl-dump-times "Decided to move invariant" 0 "loop2_invariant" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_invariant" } } */