From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5006 invoked by alias); 3 Mar 2005 18:47:09 -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 4993 invoked by alias); 3 Mar 2005 18:47:07 -0000 Date: Thu, 03 Mar 2005 18:47:00 -0000 Message-ID: <20050303184707.4990.qmail@sourceware.org> From: "mark at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041013124723.17972.mostrows@watson.ibm.com> References: <20041013124723.17972.mostrows@watson.ibm.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/17972] [3.4 Regression] const/pure functions result in bad asm X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg00379.txt.bz2 List-Id: ------- Additional Comments From mark at codesourcery dot com 2005-03-03 18:47 ------- Subject: Re: [3.4 Regression] const/pure functions result in bad asm ebotcazou at gcc dot gnu dot org wrote: > 2. The tree-inliner inlines the call. Since the same tree is referenced twice > in the expression, the inlined body is also referenced twice is the expression > and, therefore, expanded twice to RTL. However labels are not expanded multiple > times but reused, so the second block of RTL ends up referencing the first and > all hell breaks loose. It really seems like the C++ front end is doing the right thing, abstractly -- these functions don't have side-effects! So, either the inliner or stabilize reference seems like it needs fixing. Maybe the latter should recognize CALL_EPRs? If it's not possible to fix this, then what we should do is modify build3 to mark CALL_EXPRs as having side-effects. Right now, it makrs them based on the flags for the function, so this problem isn't really C++-specific; it probably effects all languages except those whose front ends set TREE_SIDE_EFFECTS additionally themselves. (Unless C++ is changing out the operands to the CALL_EXPR after its created.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17972