aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-invariant.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/loop-invariant.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/loop-invariant.c')
-rw-r--r--gcc/loop-invariant.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index ba1f288..64c16a9 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -206,7 +206,7 @@ check_maybe_invariant (rtx x)
/* 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;