From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 947AA393C846; Tue, 25 May 2021 16:32:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 947AA393C846 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1044] Remove stalled TREE_READONLY flag on automatic variable X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: ad52d89808a947264397e920d7483090d4108f7b X-Git-Newrev: fd97aeb494cdcffe0d21e7f15ab4593662e065bd Message-Id: <20210525163212.947AA393C846@sourceware.org> Date: Tue, 25 May 2021 16:32:12 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 16:32:12 -0000 https://gcc.gnu.org/g:fd97aeb494cdcffe0d21e7f15ab4593662e065bd commit r12-1044-gfd97aeb494cdcffe0d21e7f15ab4593662e065bd Author: Eric Botcazou 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