public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/98783] New: Wrong ouput of  "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
@ 2021-01-21 14:46 hasse.christoph at cern dot ch
  2021-01-21 19:00 ` [Bug driver/98783] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hasse.christoph at cern dot ch @ 2021-01-21 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

            Bug ID: 98783
           Summary: Wrong ouput of  "-O3 -Q --help=optimizers" on gcc
                    built with --enable-frame-pointer
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hasse.christoph at cern dot ch
  Target Milestone: ---

Dear all, 

I've got a GCC build that was configured with "--enable-frame-pointer" 

./bin/gcc -v:

Using built-in specs.
COLLECT_GCC=./bin/gcc
COLLECT_LTO_WRAPPER=***/gccinstall/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-10.2.0/configure --enable-frame-pointer
--disable-multilib --prefix=***/gccinstall -with-system-zlib
--enable-languages=all
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 

Yet doing:
./bin/gcc -O3 -Q --help=optimizers | grep omit

prints:
-fomit-frame-pointer                    [enabled]


I originally tried "--enable-frame-pointer" on gcc 9.3.0, there I noticed that
the above command yields "enabled" for -m64 and "disabled" for -m32.  
The fact that the frame-pointer was disabled on 64bit was a bug that was
reported & fixed. (Bug #89221). 
I'm mentioning this because in gcc 9.3.0 the command "-O3 -Q --help=optimizers"
at least reported what was enabled and disabled. So I would assume it should do
the same in gcc 10.2.0.

Yet on 10.2.0 this returns "enabled" for both 32 and 64 bit. 

However, I think this is only a bug in the printing, because 

echo "int main(){}" | ./bin/gcc -O3 -Q -v -x c - 2>&1 | grep omit

correctly prints nothing thus tells us that the "-fomit-frame-pointer" flag is
in fact not in the set of used optimization options which are printed in this
output.

I've done a bit of digging and saw that there was quite a bit of change between
9.3.0 and 10.2.0 in this area.  

>From what I can tell right now the "fomit-frame-pointer" flag is set to
disabled in the function ix86_recompute_optlev_based_flags defined in
gcc/config/i386/i386-options.c:1638 

I checked and can see that this function is not called when doing "gcc -O3 -Q
--help=optimizers" but it is when doing the test via "echo "int main(){}" |
./bin/gcc -O3 -Q -v -x c - 2>&1"

{more detail:
seems that the target specific override function is called inside
process_options() in gcc/toplev.c:1389 
process_options() is called via do_compile() from within toplev::main. 
While both of the above commands enter toplev::main, --help triggers an early
exit, thus not calling do_compile and the eventual override.
}

So that's kind of where I lost track as I'm lacking the bigger picture view of
the codebase to figure out if or with what modification one can best make "gcc
-O3 -Q --help=optimizers" work.

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
@ 2021-01-21 19:00 ` marxin at gcc dot gnu.org
  2021-01-22 13:15 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-21 19:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2021-01-21

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Let me take a look.

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
  2021-01-21 19:00 ` [Bug driver/98783] " marxin at gcc dot gnu.org
@ 2021-01-22 13:15 ` marxin at gcc dot gnu.org
  2021-01-22 13:25 ` hasse.christoph at cern dot ch
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-22 13:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
I think it's duplicate of PR98361.
Can you please mention what --help output is wrong and for which releases?

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
  2021-01-21 19:00 ` [Bug driver/98783] " marxin at gcc dot gnu.org
  2021-01-22 13:15 ` marxin at gcc dot gnu.org
@ 2021-01-22 13:25 ` hasse.christoph at cern dot ch
  2021-01-22 13:37 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hasse.christoph at cern dot ch @ 2021-01-22 13:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

--- Comment #3 from hasse.christoph at cern dot ch ---
--help=optimizers on GCC 10.2.0 build with --enable-frame-pointer prints:

-fomit-frame-pointer                    [enabled]

This flag should however be disabled by default.

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
                   ` (2 preceding siblings ...)
  2021-01-22 13:25 ` hasse.christoph at cern dot ch
@ 2021-01-22 13:37 ` marxin at gcc dot gnu.org
  2021-01-22 13:43 ` hasse.christoph at cern dot ch
  2021-01-22 13:44 ` marxin at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-22 13:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|WAITING                     |RESOLVED

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to hasse.christoph from comment #3)
> --help=optimizers on GCC 10.2.0 build with --enable-frame-pointer prints:
> 
> -fomit-frame-pointer        		[enabled]
> 
> This flag should however be disabled by default.

Yes, but tip of gcc-10 branch is fine:
likely since:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=f7e39d1f137202a5d554849f6930ade58c312acd

$ ./xgcc -B. -O3 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [disabled]

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
                   ` (3 preceding siblings ...)
  2021-01-22 13:37 ` marxin at gcc dot gnu.org
@ 2021-01-22 13:43 ` hasse.christoph at cern dot ch
  2021-01-22 13:44 ` marxin at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: hasse.christoph at cern dot ch @ 2021-01-22 13:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

--- Comment #5 from hasse.christoph at cern dot ch ---
I wasn't aware of this fix yet, sorry for the duplicate.
I really appreciate you taking the time to solve this so quickly! :)

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

* [Bug driver/98783] Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer
  2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
                   ` (4 preceding siblings ...)
  2021-01-22 13:43 ` hasse.christoph at cern dot ch
@ 2021-01-22 13:44 ` marxin at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-22 13:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98783

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to hasse.christoph from comment #5)
> I wasn't aware of this fix yet, sorry for the duplicate.

That's fine, you could not know about it :)

> I really appreciate you taking the time to solve this so quickly! :)

We're trying to do our best.

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

end of thread, other threads:[~2021-01-22 13:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 14:46 [Bug driver/98783] New: Wrong ouput of "-O3 -Q --help=optimizers" on gcc built with --enable-frame-pointer hasse.christoph at cern dot ch
2021-01-21 19:00 ` [Bug driver/98783] " marxin at gcc dot gnu.org
2021-01-22 13:15 ` marxin at gcc dot gnu.org
2021-01-22 13:25 ` hasse.christoph at cern dot ch
2021-01-22 13:37 ` marxin at gcc dot gnu.org
2021-01-22 13:43 ` hasse.christoph at cern dot ch
2021-01-22 13:44 ` marxin at gcc dot gnu.org

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