public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* binary compiled with -O1 and w/ individual optimization flags are not the same
@ 2008-02-29 17:28 CSights
  2008-02-29 17:28 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: CSights @ 2008-02-29 17:28 UTC (permalink / raw)
  To: gcc-help

Hi,
	I'm trying to debug some mismatching results from a program compiled with 
O1,2,3) and without (-O0 or nothing) optimization flags.
	My thought was to individually turn on optimization flags and see which one 
changes the program's output.
	Unfortunately for this plan, the binaries produced using -O1 and those flags 
said to be turned on by g++ in the manual (-fdefer-pop -fdelayed-branch
-fguess-branch-probability -fcprop-registers -fif-conversion -fif-conversion2 
-ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs 
-ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants) 
do not match.  I also tried without -fdelayed-branch b/c it is not supported 
on my architectures (i386: athlon xp, core duo) and with -fomit-frame-pointer 
in case that was the difference.
	I've tried this with g++ versions
g++ (GCC) 4.2.3 (Debian 4.2.3-1) 
and
i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)
	Is there a way to have g++ tell me which flags it is actually using when 
compiling a program.  E.g. expand -O1 to the individual optimization flags at 
run time?
	Anyone have any other suggestions?

Thanks much,
	C.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-05 18:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29 17:28 binary compiled with -O1 and w/ individual optimization flags are not the same CSights
2008-02-29 17:28 ` Andrew Haley
2008-02-29 17:40 ` Eljay Love-Jensen
2008-02-29 20:15 ` Brian Dessent
2008-02-29 22:38   ` CSights
     [not found]     ` <47C88B66.A501ABD6@dessent.net>
2008-03-01 15:59       ` CSights
2008-03-01 17:26         ` Tim Prince
2008-03-01 18:22         ` Brian Dessent
2008-03-05 18:13           ` CSights

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).