public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How to replace -O1 with corresponding -f's?
@ 2005-06-20 13:40 Sergei Organov
  2005-06-20 14:04 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Sergei Organov @ 2005-06-20 13:40 UTC (permalink / raw)
  To: gcc

Hi,

Using gcc compiled from gcc-4_0-branch, in an attempt to see which
particular optimization option makes my test case to be mis-optimized, I
try to replace -O1 (which toggles on the problem) with corresponding set
of -fxxx optimization options. I first compile my code like this:

gcc -v -save-temps -fverbose-asm -O1 -o const.o -c const.c

then merge the cc1 command that gcc invokes to compile the preprocessed
source (as gcc doesn't seem to pass some of -f forward to cc1) with the
entire list of options taken from resulting const.s file (found at the
line " # options enabled: ..." and further), and compile using this.

In the resulting const.s file there are 2 problems:

1. "options enabled" output almost matches those from the initial (-O1)
   invocation, but -floop-optimize is missing though it does exist in
   the "options passed" output.

2. The resulting assembly is different from what I get with -O1 and
   doesn't contain the mis-optimization I'm trying to debug though it
   doesn't seem to have anything to do with loops. For reference, the
   code I'm trying to compile is:

        extern double const osv;
        double const osv = 314314314;
        double osvf() { return osv; }

Am I doing something stupid or what? How one finds out what optimization
pass misbehaves?

-- 
Sergei.

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

end of thread, other threads:[~2005-06-24 16:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-20 13:40 How to replace -O1 with corresponding -f's? Sergei Organov
2005-06-20 14:04 ` Andrew Haley
2005-06-20 14:26   ` Andrew Pinski
2005-06-20 14:55     ` Sergei Organov
2005-06-20 15:01       ` Andrew Pinski
2005-06-20 15:29         ` Sergei Organov
2005-06-20 15:36           ` Andrew Pinski
2005-06-20 15:58             ` Sergei Organov
2005-06-21  9:55               ` Michael Meissner
2005-06-21 12:49                 ` Sergei Organov
2005-06-20 17:18             ` Sergei Organov
2005-06-24 16:09             ` Sergei Organov
2005-06-20 14:28   ` Sergei Organov
2005-06-22 19:29     ` Zack Weinberg
2005-06-20 14:25 ` Scott Robert Ladd
2005-06-20 14:35 ` Andrew Pinski
2005-06-20 15:04   ` Sergei Organov

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).