This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7145: [PATCH] g++ -O with structure initializer &return value optimization generates bad code
- From: Jason Merrill <jason at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: tlb at tlb dot org, gcc-gnats at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Fri, 05 Jul 2002 15:59:53 +0100
- Subject: Re: optimization/7145: [PATCH] g++ -O with structure initializer &return value optimization generates bad code
- References: <20020629213057.A21442@lucon.org><200207011802.g61I2g573462@tlb.blackwells.net><20020701110602.A27486@lucon.org>
Here's the patch I'm applying.
2002-07-05 Jason Merrill <jason@redhat.com>
* tree.c (cp_copy_res_decl_for_inlining): Also copy DECL_INITIAL.
*** tree.c.~1~ Tue Jul 2 14:56:10 2002
--- tree.c Thu Jul 4 16:08:15 2002
*************** cp_copy_res_decl_for_inlining (result, f
*** 2292,2297 ****
--- 2292,2298 ----
DECL_SOURCE_FILE (var) = DECL_SOURCE_FILE (nrv);
DECL_SOURCE_LINE (var) = DECL_SOURCE_LINE (nrv);
DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv);
+ DECL_INITIAL (var) = DECL_INITIAL (nrv);
splay_tree_insert (decl_map,
(splay_tree_key) nrv,
(splay_tree_value) var);