From 1d7d1e1876bcc41355e330659040d3c7ddc31c5a Mon Sep 17 00:00:00 2001 From: mmitchel Date: Wed, 23 May 2001 02:14:51 +0000 Subject: [PATCH] * optimize.c (initialize_inlined_parameters): Don't set TREE_READONLY for a VAR_DECL taking the place of an inlined PARM_DECL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42480 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/optimize.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 956d01708c3..4f3391eca8a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2001-05-22 Mark Mitchell + + * optimize.c (initialize_inlined_parameters): Don't set + TREE_READONLY for a VAR_DECL taking the place of an inlined + PARM_DECL. + 2001-05-22 Jason Merrill * class.c, cp-tree.h, rtti.c: Remove com_interface attribute support. diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index b6b03b9423d..f81d7e38ae3 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -498,6 +498,18 @@ initialize_inlined_parameters (id, args, fn) DECL_INITIAL (var) = value; else { + /* Even if P was TREE_READONLY, the new VAR should not be. + In the original code, we would have constructed a + temporary, and then the function body would have never + changed the value of P. However, now, we will be + constructing VAR directly. The constructor body may + change its value multiple times as it is being + constructed. Therefore, it must not be TREE_READONLY; + the back-end assumes that TREE_READONLY variable is + assigned to only once. */ + TREE_READONLY (var) = 0; + + /* Build a run-time initialization. */ init_stmt = build_stmt (EXPR_STMT, build (INIT_EXPR, TREE_TYPE (p), var, value)); -- 2.11.0