This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Questionable function renaming


Is it possible to restore the original name if the copy propagation is not profitable and doesn't go ahead? 

> -----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<bmei@broadcom.com> 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=64 ?-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)
> > {
> > ?IntNative retVal;
> >
> > <bb 2>:
> > ?retVal_4 = __xstat (1, srcName_1(D), &fileMetaInfo);
> > ?if (retVal_4 != 0)
> > ? ?goto <bb 3>;
> > ?else
> > ? ?goto <bb 4>;
> >
> > <bb 3>:
> > ?ioError ();
> >
> > <bb 4>:
> > ?return;
> >
> > }
> >
> > becomes
> >
> > ;; Function T.251 (T.251)
> >
> > T.251 ()
> > {
> > ?IntNative retVal;
> >
> > <bb 2>:
> > ?retVal_1 = __xstat (1, &inName, &fileMetaInfo);
> > ?if (retVal_1 != 0)
> > ? ?goto <bb 3>;
> > ?else
> > ? ?goto <bb 4>;
> >
> > <bb 3>:
> > ?ioError ();
> >
> > <bb 4>:
> > ?return;
> >
> > }
> >
> > 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
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]