Bug 22104 - using "-fprofile-use" on code that has HUGE amounts of inline asm borks it
Summary: using "-fprofile-use" on code that has HUGE amounts of inline asm borks it
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.4
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-06-17 14:30 UTC by Tom St Denis
Modified: 2006-11-20 05:49 UTC (History)
1 user (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
It's the preprocessed code that died. (27.92 KB, application/x-gzip)
2005-06-17 14:31 UTC, Tom St Denis
Details
Profile data for the file that dies (2.71 KB, application/x-gzip)
2005-06-17 15:41 UTC, Tom St Denis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom St Denis 2005-06-17 14:30:21 UTC
I was minding my own business compiling some math code, the profile-generate
build worked and ran fine then I tried a profile-use build and it borked
bitching and all...
Comment 1 Tom St Denis 2005-06-17 14:31:49 UTC
Created attachment 9104 [details]
It's the preprocessed code that died.
Comment 2 Andrew Pinski 2005-06-17 14:36:04 UTC
Can you show how you compiled both with -fprofile-generate and -fprofile-use?
Comment 3 Tom St Denis 2005-06-17 14:51:37 UTC
(In reply to comment #2)
> Can you show how you compiled both with -fprofile-generate and -fprofile-use?

cc -march=prescott -fprofile-generate -Wall -W -Wshadow -I./ -O3 -funroll-loops
-fomit-frame-pointer   -c -o fp_set.o fp_set.c

Typical compile statement [just the .c and .o file names change].  I ran my
demo, then did 

rm -f *.[ao]

Then did the build again  switching "-generate" to "-use".

Tom
Comment 4 Andrew Pinski 2005-06-17 14:52:48 UTC
(In reply to comment #3)
One more question, what is the ICE?
Comment 5 Tom St Denis 2005-06-17 14:54:40 UTC
(In reply to comment #4)
> (In reply to comment #3)
> One more question, what is the ICE?

What is ICE and how do I figure that out?

Tom
Comment 6 Andrew Pinski 2005-06-17 14:55:38 UTC
What is the error comming from GCC with -fprofile-use?
Comment 7 Tom St Denis 2005-06-17 15:32:38 UTC
(In reply to comment #6)
> What is the error comming from GCC with -fprofile-use?

cc -march=prescott -fprofile-use -Wall -W -Wshadow -I./ -O3 -funroll-loops
-fomit-frame-pointer   -c -o fp_sqr_comba.o fp_sqr_comba.c
fp_sqr_comba.c: In function `fp_sqr_comba_small':
fp_sqr_comba.c:364: warning: 'sc0' might be used uninitialized in this function
fp_sqr_comba.c:364: warning: 'sc1' might be used uninitialized in this function
fp_sqr_comba.c:364: warning: 'sc2' might be used uninitialized in this function
fp_sqr_comba.c:1872: internal compiler error: in verify_local_live_at_start, at
flow.c:546
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Preprocessed source stored into /tmp/cc626adC.out file, please attach this to
your bugreport.
make: *** [fp_sqr_comba.o] Error 1
Comment 8 Andrew Pinski 2005-06-17 15:36:38 UTC
(In reply to comment #7)
> See <URL:http://bugs.gentoo.org/> for instructions.

Is there a reason why you reported this to here and not to gentoo or did gentoo tell you to file it here?
Also since this is only reproducible with -fprofile-use, can you attach the full program since we cannot 
reproduce without running it?
Comment 9 Tom St Denis 2005-06-17 15:41:23 UTC
Created attachment 9105 [details]
Profile data for the file that dies
Comment 10 Tom St Denis 2005-06-17 15:44:09 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > See <URL:http://bugs.gentoo.org/> for instructions.
> 
> Is there a reason why you reported this to here and not to gentoo or did
gentoo tell you to file it here?
> Also since this is only reproducible with -fprofile-use, can you attach the
full program since we cannot 
> reproduce without running it?

I've sent the profile data and I've uploaded the code to

http://libtomcrypt.org/tfm.tar.bz2

Build with:
CFLAGS="-march=prescott -fprofile-generate" make && gcc -march=prescott
-fprofile-generate -O3 -fomit-frame-pointer -funroll-loops ecc.c libtfm.a -o ecc

Then run "./ecc"

Then run "rf -f [.][ao]"

Rebuild with:

CFLAGS="-march=prescott -fprofile-use" make && gcc -march=prescott -fprofile-use
-O3 -fomit-frame-pointer -funroll-loops ecc.c libtfm.a -o ecc

Comment 11 Steven Bosscher 2006-04-24 22:51:48 UTC
I'm inclined to say "don't do this" but i can see why this is a problem for the reporter.  I can't reproduce the issue myself, though.  Tom, do you still see a problem here?  Sorry for the long delay btw.
Comment 12 Andrew Pinski 2006-08-21 05:56:34 UTC
Can you attach the source which is needed to run this program?
All I get trying to reproduce this bug in a new GCC is:
[pinskia@celery ~/Desktop]$ ~/gcc-local/bin/gcc t.c -O2 -fomit-frame-pointer
/usr/lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
Comment 13 Andrew Pinski 2006-11-20 05:49:53 UTC
No feedback in 3 months for the full source so it is hard to figure out what is going wrong here so closing.