diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-25 18:30:29 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-25 18:31:43 +0200 |
commit | fd97aeb494cdcffe0d21e7f15ab4593662e065bd (patch) | |
tree | a555926234a66ff47d54614162a30f4658fa4892 /gcc | |
parent | ad52d89808a947264397e920d7483090d4108f7b (diff) | |
download | gcc-fd97aeb494cdcffe0d21e7f15ab4593662e065bd.zip gcc-fd97aeb494cdcffe0d21e7f15ab4593662e065bd.tar.gz gcc-fd97aeb494cdcffe0d21e7f15ab4593662e065bd.tar.bz2 |
Remove stalled TREE_READONLY flag on automatic variable
gcc/
* gimplify.c (gimplify_decl_expr): Clear TREE_READONLY on the DECL
when really creating an initialization statement for it.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimplify.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index b62ea0e..ed825a9 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1828,6 +1828,9 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p) init = build2 (INIT_EXPR, void_type_node, decl, init); gimplify_and_add (init, seq_p); ggc_free (init); + /* Clear TREE_READONLY if we really have an initialization. */ + if (!DECL_INITIAL (decl)) + TREE_READONLY (decl) = 0; } else /* We must still examine initializers for static variables |