aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-09-26 12:58:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-09-26 12:58:35 +0000
commitf8a7df459498f6e5c3308e9e3de3252dccecff9a (patch)
tree851dba3ea227d9d83fa999a66f6e3c047a8e9978 /gcc/gimple-fold.c
parentb5bcaa4a74c02648eb45c015ff03c15cdac82fe1 (diff)
downloadgcc-f8a7df459498f6e5c3308e9e3de3252dccecff9a.zip
gcc-f8a7df459498f6e5c3308e9e3de3252dccecff9a.tar.gz
gcc-f8a7df459498f6e5c3308e9e3de3252dccecff9a.tar.bz2
re PR tree-optimization/50472 (Volatile qualification in data is not enough to avoid optimization over pointer to data)
2011-09-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/50472 * gimple-fold.c (fold_const_aggregate_ref_1): Do not fold volatile references. * gcc.dg/torture/pr50472.c: New testcase. From-SVN: r179196
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index b481c4a..d754ea9 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -2919,6 +2919,9 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree))
HOST_WIDE_INT offset, size, max_size;
tree tem;
+ if (TREE_THIS_VOLATILE (t))
+ return NULL_TREE;
+
if (TREE_CODE_CLASS (TREE_CODE (t)) == tcc_declaration)
return get_symbol_constant_value (t);