From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11972 invoked by alias); 11 Jul 2002 21:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11956 invoked by uid 71); 11 Jul 2002 21:16:02 -0000 Date: Thu, 11 Jul 2002 14:16:00 -0000 Message-ID: <20020711211602.11954.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: c++/7280: [PATCH] NRV related miscompilation Reply-To: Jason Merrill X-SW-Source: 2002-07/txt/msg00357.txt.bz2 List-Id: The following reply was made to PR c++/7280; it has been noted by GNATS. From: Jason Merrill To: gcc-bugs@gcc.gnu.org Cc: jakub@redhat.com, gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: c++/7280: [PATCH] NRV related miscompilation Date: Thu, 11 Jul 2002 22:11:19 +0100 --=-=-= The bug was that we were failing to put the new variable in the stack because we didn't copy TREE_ADDRESSABLE. Tested i686-pc-linux-gnu, applied trunk and 3.1. 2002-07-11 Jason Merrill PR c++/7279 * tree.c (cp_copy_res_decl_for_inlining): Also copy TREE_ADDRESSABLE. --=-=-= Content-Type: text/x-patch Content-Disposition: inline *** tree.c.~1~ Thu Jul 4 16:08:15 2002 --- tree.c Thu Jul 11 20:16:15 2002 *************** cp_copy_res_decl_for_inlining (result, f *** 2292,2298 **** --- 2292,2302 ---- 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); --=-=-=--