summaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-21 12:57:52 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-21 12:57:52 +0000
commit2fbbab300950166a673ba7940debf16e667b32bc (patch)
treefb3ae648632a5de0ac53fcf258d6bd168323da84 /gcc/varpool.c
parent2d8c17866537259badc289fb3a12ba1377a46e47 (diff)
downloadgcc-2fbbab300950166a673ba7940debf16e667b32bc.tar.gz
PR tree-optimization/47391
* varpool.c (const_value_known_p): Return false if decl is volatile. * gcc.dg/pr47391.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169084 138bc75d-0d04-0410-961f-82ee72b054a4
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 d266ce9a8cf..2e37255636c 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 */