aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-29 20:32:20 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-29 20:32:20 +0100
commit77527d8ac499e55ff609ce112e0c68ebd8836704 (patch)
tree8e23034ccb567298fa80d06f1ade4bea3437fb49 /gcc/gimplify.c
parent7ad99f7d21983de63725701832e03d095842b3ae (diff)
downloadgcc-77527d8ac499e55ff609ce112e0c68ebd8836704.zip
gcc-77527d8ac499e55ff609ce112e0c68ebd8836704.tar.gz
gcc-77527d8ac499e55ff609ce112e0c68ebd8836704.tar.bz2
re PR c/89872 (GCC does not generate read access to volatile compound literal)
PR c/89872 * gimplify.c (gimplify_compound_literal_expr): Don't optimize a non-addressable complit into its initializer if it is volatile. * gcc.dg/tree-ssa/pr89872.c: New test. From-SVN: r270023
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index e264700..6ac1b71 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4665,6 +4665,7 @@ gimplify_compound_literal_expr (tree *expr_p, gimple_seq *pre_p,
otherwise we'd generate a new temporary, and we can as well just
use the decl we already have. */
else if (!TREE_ADDRESSABLE (decl)
+ && !TREE_THIS_VOLATILE (decl)
&& init
&& (fallback & fb_lvalue) == 0
&& gimple_test_f (init))