diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-05-23 02:14:51 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-05-23 02:14:51 +0000 |
commit | 39e0656d10bbd3bc0db396c8c177a1d32ef85d36 (patch) | |
tree | d69a1448fabdf6e189a8432812c574b358c3f7e5 /gcc/cp/optimize.c | |
parent | 8d12b800399386a2425ff880383a01d7f330e4c8 (diff) | |
download | gcc-39e0656d10bbd3bc0db396c8c177a1d32ef85d36.zip gcc-39e0656d10bbd3bc0db396c8c177a1d32ef85d36.tar.gz gcc-39e0656d10bbd3bc0db396c8c177a1d32ef85d36.tar.bz2 |
optimize.c (initialize_inlined_parameters): Don't set TREE_READONLY for a VAR_DECL taking the place of an inlined PARM_DECL.
* optimize.c (initialize_inlined_parameters): Don't set
TREE_READONLY for a VAR_DECL taking the place of an inlined
PARM_DECL.
From-SVN: r42480
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r-- | gcc/cp/optimize.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index b6b03b9..f81d7e3 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)); |