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
This commit is contained in:
Jason Merrill 2002-07-11 17:12:47 -04:00 committed by Jason Merrill
parent 25c2594701
commit 34902e16e2
2 changed files with 10 additions and 0 deletions

View File

@ -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> 2002-07-10 Graham Stott <graham.stott@btinternet.com>
* pt.c (template_parm_this_level_p, push_template_decl_real): * pt.c (template_parm_this_level_p, push_template_decl_real):

View File

@ -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_FILE (var) = DECL_SOURCE_FILE (nrv);
DECL_SOURCE_LINE (var) = DECL_SOURCE_LINE (nrv); DECL_SOURCE_LINE (var) = DECL_SOURCE_LINE (nrv);
DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv); DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv);
/* Don't lose initialization info. */
DECL_INITIAL (var) = DECL_INITIAL (nrv); 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_insert (decl_map,
(splay_tree_key) nrv, (splay_tree_key) nrv,
(splay_tree_value) var); (splay_tree_value) var);