This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What optimizations does -O1 enable?
- From: Will Newton <will at debian dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 12 Mar 2003 16:50:53 +0000
- Subject: What optimizations does -O1 enable?
- Organization: Debian
I have some code[1] that breaks when compiled with gcc 3.2 -O1. I have tried
enabling all these optimizations:
CFLAGS = -g -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type
-fomit-frame-pointer -Wno-sign-compare -DUNICODE -DDYNAMIC_FFI -DNO_SIGSEGV
-falign-functions=4 -fstrength-reduce -fno-keep-static-consts -fthread-jumps
-fcse-follow-jumps -fdelete-null-pointer-checks -fdefer-pop -fschedule-insns
-fmerge-constants -fbranch-count-reg -frerun-cse-after-loop -frerun-loop-opt
-fgcse -foptimize-register-move -fschedule-insns2 -fsched-spec-load
-fcaller-saves -fguess-branch-probability -fstrict-aliasing
-frename-registers -freduce-all-givs -fmove-all-movables
-fexpensive-optimizations -fasynchronous-unwind-tables
But the code does not break. Replacing all the -f flags with -O1 or higher
causes the binary to segfault at run time. This code worked with -O2 on
gcc-2.95. The backtrace is not particularly constructive, but if I can
determine which option is causing the porblem I can try and create a
testcase.
[1] The CLISP LISP interpreter (http://clisp.cons.org)