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
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.
Then are there any means we can know what options are tweaked afterwards?
If you use -fverbose-asm and look at the # comments at the beginning of the generated assembly.
Ah, thank you for information.