aboutsummaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-21 13:57:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-21 13:57:52 +0100
commit3a2df83199a98c7ff455fedb3c3ea27b95fca7ce (patch)
treefb3ae648632a5de0ac53fcf258d6bd168323da84 /gcc/varpool.c
parentd8debb1d8a53c120ed56ef3753afa3e9acaccded (diff)
downloadgcc-3a2df83199a98c7ff455fedb3c3ea27b95fca7ce.zip
gcc-3a2df83199a98c7ff455fedb3c3ea27b95fca7ce.tar.gz
gcc-3a2df83199a98c7ff455fedb3c3ea27b95fca7ce.tar.bz2
re PR tree-optimization/47391 (read from const volatile incorrectly eliminated)
PR tree-optimization/47391 * varpool.c (const_value_known_p): Return false if decl is volatile. * gcc.dg/pr47391.c: New test. From-SVN: r169084
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r--gcc/varpool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c
index d266ce9..2e37255 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -1,5 +1,5 @@
/* Callgraph handling code.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jan Hubicka
@@ -370,7 +370,7 @@ const_value_known_p (tree decl)
gcc_assert (TREE_CODE (decl) == VAR_DECL);
- if (!TREE_READONLY (decl))
+ if (!TREE_READONLY (decl) || TREE_THIS_VOLATILE (decl))
return false;
/* Gimplifier takes away constructors of local vars */