From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7714 invoked by alias); 5 Apr 2005 23:14:01 -0000 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 Received: (qmail 7173 invoked by uid 48); 5 Apr 2005 23:13:42 -0000 Date: Tue, 05 Apr 2005 23:14:00 -0000 Message-ID: <20050405231342.7172.qmail@sourceware.org> From: "roger at eyesopen dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041230105911.19199.lars@trolltech.com> References: <20041230105911.19199.lars@trolltech.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/19199] [3.3/3.4 Regression] Wrong warning about returning a reference to a temporary X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg00549.txt.bz2 List-Id: ------- Additional Comments From roger at eyesopen dot com 2005-04-05 23:13 ------- Now that a fix has been applied to both mainline and the 4.0 branch, I've been investigating backporting the fix to 3.4. Unfortunately, a significant feature of the fixes proposed by Alex and me are that they disable the problematic transformations during parsing, but allow them to be caught by later tree-ssa passes. Unfortunately, in gcc 3.4.x if we disable constant folding of COND_EXPRs for C++, there are no tree-level optimizers that can take up the slack, and instead we'd rely on if-conversion to do what it can at the RTL level. I'm not convinced that 3.4 if-conversion is particularly effective in this respect (certainly across all targets), and I've not yet checked whether all of the affected transformations are implementated in ifcvt.c (even on mainline). Might I propose that we close this bug as won't fix for both the 3.3 and 3.4 branches. GCC has always generated wrong code for this case, and the current state of 3.4.4 is that we issue an incorrect warning (which seems better than silently generating wrong code as we did with 3.1). It's a trade-off; but I'm keen to avoid degrading g++ 3.4.5 (in the common case), for a diagnostic regression. Or we could leave the PR open (and perhaps unassign it) in the hope that a 3.4 solution will be discovered, as the mainline/4.x fixes aren't suitable. Mark? Alexandre? -- What |Removed |Added ---------------------------------------------------------------------------- Known to fail|3.4.0 4.0.0 3.3.2 |3.4.0 3.3.2 Known to work| |4.0.0 4.1.0 Summary|[3.3/3.4/4.0 Regression] |[3.3/3.4 Regression] Wrong |Wrong warning about |warning about returning a |returning a reference to a |reference to a temporary |temporary | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19199