Bug 849577 - -Q --help=optimize information for -fomit-frame-pointer incorrect?
Summary: -Q --help=optimize information for -fomit-frame-pointer incorrect?
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-20 08:49 UTC by Mamoru TASAKA
Modified: 2012-08-20 13:53 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-08-20 09:24:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
The result of test case (2.43 KB, application/x-gzip)
2012-08-20 08:49 UTC, Mamoru TASAKA
no flags Details

Description Mamoru TASAKA 2012-08-20 08:49:07 UTC
Created attachment 605605 [details]
The result of test case

Description of problem:
gcc -Q --help=optimize shows:
$ LANG=C gcc -O1 -Q --help=optimize | grep fomit-frame-pointer
  -fomit-frame-pointer        		[disabled]

However with compiling the attached code, with "gcc -O1" frame pointer actually seems omitted when compared with the result from "gcc -O1 -f{no-,}omit-frame-pointer". So it seems that the information from "gcc -Q --help=optimize" seems incorrect.

Version-Release number of selected component (if applicable):
$ uname -a
Linux localhost.localdomain 3.5.2-1.fc17.i686 #1 SMP Wed Aug 15 16:52:27 UTC 2012 i686 i686 i386 GNU/Linux

$ LANG=C gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.7.0/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) 


How reproducible:
See attached tarball:
gcc-O1-default-opt.txt: result of "gcc -O1 -Q --help=optimize"
gcc-O1-omit-opt.txt: result of "gcc -O1 -fomit-frame-pointer -Q --help=optimize"
gcc-O1-noomit-opt.txt: result of "gcc -O1 -fno-omit-frame-pointer -Q --help=optimize"
test-O1-default.S: gcc -O1 -S test.c
test-O1-noomit.S: gcc -O1 -fno-omit-frame-pointer -S test.c
test-O1-omit.S: gcc -S -O1 -fomit-frame-pointer test.c

Steps to Reproduce:
1. See above
2.
3.
  
Actual results:
gcc -O1 -Q --help=optimize says -fomit-frame-pointer is disabled, however the result of gcc -S shows that actually frame pointer is omitted

Expected results:
gcc -O1 -Q --help=optimize should show that -fomit-frame-pointer is enabled

Comment 1 Jakub Jelinek 2012-08-20 09:24:23 UTC
It is not incorrect.  --help=optimize reports the state of options after option parsing, i.e. what has been requested by users.  Some options are tweaked afterwards by the backends etc., but it is long time after --help= is invoked.  You didn't specify -fomit-frame-pointer on the command line, therefore it isn't printed as enabled.

Comment 2 Mamoru TASAKA 2012-08-20 10:45:45 UTC
Then are there any means we can know what options are tweaked afterwards?

Comment 3 Jakub Jelinek 2012-08-20 10:57:41 UTC
If you use -fverbose-asm and look at the # comments at the beginning of the generated assembly.

Comment 4 Mamoru TASAKA 2012-08-20 13:53:13 UTC
Ah, thank you for information.


Note You need to log in before you can comment on or make changes to this bug.