re PR c++/7279 (NRV related miscompilation)
authorJason Merrill <jason@redhat.com>
Thu, 11 Jul 2002 21:12:47 +0000 (17:12 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 11 Jul 2002 21:12:47 +0000 (17:12 -0400)
        PR c++/7279
        * tree.c (cp_copy_res_decl_for_inlining): Also copy
        TREE_ADDRESSABLE.

From-SVN: r55405

gcc/cp/ChangeLog
gcc/cp/tree.c

index 8482ab04b4273728b2b5578eb1ee4888180bc1c2..24b9267a1960752f5da68899d53dcbb9cbfe18a5 100644 (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>
 
        * pt.c (template_parm_this_level_p, push_template_decl_real):
index b7b2123cd1c7696685f4255d1d5a89e6f92022de..b6e70ceface8e1aed2cd5957caf07c41e77294a4 100644 (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_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);