diff options
author | Jason Merrill <jason@redhat.com> | 2002-07-11 17:12:47 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-07-11 17:12:47 -0400 |
commit | 34902e16e2c936b883135f7b472402de4240caec (patch) | |
tree | 8fc1ea9763fbaeea31f2f5e83c7048975353b6ed | |
parent | 25c25947019a3e4628e8b382d7e1b00d9482d717 (diff) | |
download | gcc-34902e16e2c936b883135f7b472402de4240caec.zip gcc-34902e16e2c936b883135f7b472402de4240caec.tar.gz gcc-34902e16e2c936b883135f7b472402de4240caec.tar.bz2 |
re PR c++/7279 (NRV related miscompilation)
PR c++/7279
* tree.c (cp_copy_res_decl_for_inlining): Also copy
TREE_ADDRESSABLE.
From-SVN: r55405
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8482ab0..24b9267 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2002-07-11 Jason Merrill <jason@redhat.com> + + PR c++/7279 + * tree.c (cp_copy_res_decl_for_inlining): Also copy + TREE_ADDRESSABLE. + 2002-07-10 Graham Stott <graham.stott@btinternet.com> * pt.c (template_parm_this_level_p, push_template_decl_real): diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index b7b2123c..b6e70ce 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2292,7 +2292,11 @@ cp_copy_res_decl_for_inlining (result, fn, caller, decl_map_, DECL_SOURCE_FILE (var) = DECL_SOURCE_FILE (nrv); DECL_SOURCE_LINE (var) = DECL_SOURCE_LINE (nrv); DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv); + /* Don't lose initialization info. */ DECL_INITIAL (var) = DECL_INITIAL (nrv); + /* Don't forget that it needs to go in the stack. */ + TREE_ADDRESSABLE (var) = TREE_ADDRESSABLE (nrv); + splay_tree_insert (decl_map, (splay_tree_key) nrv, (splay_tree_value) var); |