This is the mail archive of the
mailing list for the GCC project.
RE: Undocumented optimization flag, switched by O1
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: <preineke at mail dot uni-paderborn dot de>, <gcc-help at gcc dot gnu dot org>
- Date: Tue, 20 Nov 2007 09:41:38 -0800
- Subject: RE: Undocumented optimization flag, switched by O1
- References: <email@example.com>
Please keep in mind that -O1 enables a lot of optimizations.
Some of those optimizations can be disabled using a -f switch.
To view the -f flags enabled by -O1 use this handy tip:
gcc -fverbose-asm -H -x c <(echo '') -O1 -S -o O1.s
You can then try disabling the -f optimizations until you find your culprit. Divide & conquer would be the fastest way to zero in on the problem optimization.
CAVEAT, not all optimizations enabled by -O1 have a command-line toggle flag to disable them.
Also important to know, that with -O0 no optimizations are performed, regardless of the -f flags enabled. The -O0 squelches all optimzations. If no optimization level is explicitly specified, -O0 is the default. So I don't think your "enabling optimizations flag-by-flag" had the results you were looking for.