diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-01-21 13:57:52 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-01-21 13:57:52 +0100 |
commit | 3a2df83199a98c7ff455fedb3c3ea27b95fca7ce (patch) | |
tree | fb3ae648632a5de0ac53fcf258d6bd168323da84 /gcc/varpool.c | |
parent | d8debb1d8a53c120ed56ef3753afa3e9acaccded (diff) | |
download | gcc-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.c | 4 |
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 */ |