public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1044] Remove stalled TREE_READONLY flag on automatic variable
@ 2021-05-25 16:32 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-05-25 16:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fd97aeb494cdcffe0d21e7f15ab4593662e065bd

commit r12-1044-gfd97aeb494cdcffe0d21e7f15ab4593662e065bd
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue May 25 18:30:29 2021 +0200

    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.

Diff:
---
 gcc/gimplify.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index b62ea0efc1c..ed825a93aa1 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-25 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 16:32 [gcc r12-1044] Remove stalled TREE_READONLY flag on automatic variable Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).