On Tue, Jun 16, 2009 at 2:23 PM, Bingfeng Mei<b...@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