From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9158 invoked by alias); 16 Jun 2009 13:02:45 -0000 Received: (qmail 8683 invoked by uid 22791); 16 Jun 2009 13:02:42 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-qy0-f194.google.com (HELO mail-qy0-f194.google.com) (209.85.221.194) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Jun 2009 13:02:32 +0000 Received: by qyk32 with SMTP id 32so5735752qyk.0 for ; Tue, 16 Jun 2009 06:02:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.92.14 with SMTP id p14mr5479798vcm.92.1245157349514; Tue, 16 Jun 2009 06:02:29 -0700 (PDT) In-Reply-To: <7FB04A5C213E9943A72EE127DB74F0AD93C5706318@SJEXCHCCR02.corp.ad.broadcom.com> References: <7FB04A5C213E9943A72EE127DB74F0AD93C5706309@SJEXCHCCR02.corp.ad.broadcom.com> <84fc9c000906160556h68b3ccf3k9b89ac8d0fd68211@mail.gmail.com> <7FB04A5C213E9943A72EE127DB74F0AD93C5706318@SJEXCHCCR02.corp.ad.broadcom.com> Date: Tue, 16 Jun 2009 13:02:00 -0000 Message-ID: <84fc9c000906160602x243e7abo9ff7c7a1a4d3d5e7@mail.gmail.com> Subject: Re: Questionable function renaming From: Richard Guenther To: Bingfeng Mei Cc: "gcc@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00359.txt.bz2 On Tue, Jun 16, 2009 at 3:01 PM, Bingfeng Mei wrote: > Is it possible to restore the original name if the copy propagation is no= t profitable and doesn't go ahead? The calling convention is changed, so I don't see how this is easily possible. Richard. >> -----Original Message----- >> From: Richard Guenther [mailto:richard.guenther@gmail.com] >> Sent: 16 June 2009 13:56 >> To: Bingfeng Mei >> Cc: gcc@gcc.gnu.org >> Subject: Re: Questionable function renaming >> >> On Tue, Jun 16, 2009 at 2:23 PM, Bingfeng >> Mei wrote: >> > Hello, >> > >> > I came across a function renaming issue in GCC 4.4. >> > >> > ~/work/install-x86/bin/gcc -Wall -Winline -O3 -g >> -D_FILE_OFFSET_BITS=3D64 =A0-save-temps -c bzip2.c -fdump-tree-all >> > >> > >> > Function saveInputFileMetaInfo is renamed to T.251 after >> ipa passes, which are not dumped into intermediate files. So >> compare bzip2.c.038t.release_ssa and bzip2.c.049t.copyrename2 file, >> > >> > ;; Function saveInputFileMetaInfo (saveInputFileMetaInfo) >> > >> > Released 3 names, 50.00% >> > saveInputFileMetaInfo (Char * srcName) >> > { >> > =A0IntNative retVal; >> > >> > : >> > =A0retVal_4 =3D __xstat (1, srcName_1(D), &fileMetaInfo); >> > =A0if (retVal_4 !=3D 0) >> > =A0 =A0goto ; >> > =A0else >> > =A0 =A0goto ; >> > >> > : >> > =A0ioError (); >> > >> > : >> > =A0return; >> > >> > } >> > >> > becomes >> > >> > ;; Function T.251 (T.251) >> > >> > T.251 () >> > { >> > =A0IntNative retVal; >> > >> > : >> > =A0retVal_1 =3D __xstat (1, &inName, &fileMetaInfo); >> > =A0if (retVal_1 !=3D 0) >> > =A0 =A0goto ; >> > =A0else >> > =A0 =A0goto ; >> > >> > : >> > =A0ioError (); >> > >> > : >> > =A0return; >> > >> > } >> > >> > The renamed function stays afterwards. My understanding is >> that ipa-cp pass did copy-propagation of the original >> function but still somehow create a clone as suggested >> bzip2.c.203t.statistics. >> > >> > bzip2.c.203t.statistics:35 copyprop "Copies propagated" >> "saveInputFileMetaInfo" 1 >> > bzip2.c.203t.statistics:35 copyprop "Statements deleted" >> "saveInputFileMetaInfo" 3 >> > >> > This seems unnecessary and causes trouble in our >> profiling/debugging tools. I could diable this by using >> -fno-ipa-cp. But is there any better way? Thanks in advance >> >> It constant propagated &inName here (probably not very profitable >> as no further optimization is performed on the body) and removed >> the then unused parameter. >> >> Any better way to do what? >> >> Richard. >> >> > Cheers, >> > Bingfeng Mei >> > >> > Boradcom UK >> >> >