From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9325 invoked by alias); 16 Jun 2009 12:56:32 -0000 Received: (qmail 9314 invoked by uid 22791); 16 Jun 2009 12:56:32 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,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 12:56:23 +0000 Received: by qyk32 with SMTP id 32so5730963qyk.0 for ; Tue, 16 Jun 2009 05:56:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.46.10 with SMTP id h10mr5564826vcf.8.1245156981405; Tue, 16 Jun 2009 05:56:21 -0700 (PDT) In-Reply-To: <7FB04A5C213E9943A72EE127DB74F0AD93C5706309@SJEXCHCCR02.corp.ad.broadcom.com> References: <7FB04A5C213E9943A72EE127DB74F0AD93C5706309@SJEXCHCCR02.corp.ad.broadcom.com> Date: Tue, 16 Jun 2009 12:56:00 -0000 Message-ID: <84fc9c000906160556h68b3ccf3k9b89ac8d0fd68211@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/msg00357.txt.bz2 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, whic= h are not dumped into intermediate files. So compare bzip2.c.038t.release_s= sa 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 pa= ss 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" "saveInputFileMet= aInfo" 1 > bzip2.c.203t.statistics:35 copyprop "Statements deleted" "saveInputFileMe= taInfo" 3 > > This seems unnecessary and causes trouble in our profiling/debugging tool= s. I could diable this by using -fno-ipa-cp. But is there any better way? T= hanks 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