From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16397 invoked by alias); 21 Jun 2006 12:20:57 -0000 Received: (qmail 16152 invoked by uid 48); 21 Jun 2006 12:20:43 -0000 Date: Wed, 21 Jun 2006 12:46:00 -0000 Message-ID: <20060621122043.16151.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/28116] [4.1 Regression] ICE when building konverter with gcc-4.1 with -O3 [RSO] In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg01952.txt.bz2 List-Id: ------- Comment #4 from jakub at gcc dot gnu dot org 2006-06-21 12:20 ------- This sounds like a tree-nrv bug to me. We have at *.optimized: QTime QTime::msToTime() (this) { struct QTimeD.1732 D.1772; struct QTimeD.1732 tD.1765; (voidD.34) 0; D.1772 = addMSecs (&); = D.1772; return ; } (note D.1772 never has address taken, while does). Now tree_nrv () finds is only set to D.1772 and: /* At this point we know that all the return statements return the same local which has suitable attributes for NRV. Copy debugging information from FOUND to RESULT. */ DECL_NAME (result) = DECL_NAME (found); DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (found); DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (found); TREE_ADDRESSABLE (result) = TREE_ADDRESSABLE (found); which clears the addressable flag, although the RESULT_DECL clearly has its address taken. Perhaps the last line should be: TREE_ADDRESSABLE (result) |= TREE_ADDRESSABLE (found); but am not 100% sure if tree_nrv is a safe transformation if TREE_ADDRESSABLE (result) was set already. Also, in this case DECL_NAME (result) contained the real var name (t) while DECL_NAME (found) is NULL, so perhaps the first 3 lines should be conditionalized on if (DECL_NAME (found)) to avoid making debug info worse. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dnovillo at redhat dot com, | |law at gcc dot gnu dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2006-06-21 12:20:43 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28116