aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr35729.c
diff options
context:
space:
mode:
authorZdenek Dvorak <ook@ucw.cz>2008-03-31 16:19:52 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2008-03-31 14:19:52 +0000
commit66f91b93db67ccea9e4d0ec803492e2dbd03974c (patch)
treeffad40ad79ed9653b2a213a4f8b639c6da089e67 /gcc/testsuite/gcc.dg/pr35729.c
parent6b20c50ffe1de0c65fc196825236387da0b5ba34 (diff)
downloadgcc-66f91b93db67ccea9e4d0ec803492e2dbd03974c.zip
gcc-66f91b93db67ccea9e4d0ec803492e2dbd03974c.tar.gz
gcc-66f91b93db67ccea9e4d0ec803492e2dbd03974c.tar.bz2
re PR rtl-optimization/35729 (const volatile variable access incorrectly hoisted out of loop)
PR rtl-optimization/35729 * loop-invariant.c (check_maybe_invariant): Disallow volatile memory references. * gcc.dg/pr35729.c: New test. From-SVN: r133755
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr35729.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr35729.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr35729.c b/gcc/testsuite/gcc.dg/pr35729.c
new file mode 100644
index 0000000..3ed40f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35729.c
@@ -0,0 +1,15 @@
+/* { 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" } } */