David Daney wrote:
slnc wrote:Hi John, Thank you but -O0 makes no difference.That's what he just said. If you use -O0 (the implied default) none of the optimizations are done. Use -O1 (or -O2 or -O3) if you want optimizations done.
Oh, I misunderstood him, sorry. It also doesn't work if I omit -O<anything>. So to sum it up, there is no way to compile a program in gcc enabling only one specific optimization flag. The only option is to use the "pre-packaged" sets of flags (-O1, -O2 or -O3) right?
I have tried disabling all -O1 flags just to check if I could select only one by disabling all the others but:
gcc -c -O1 -fno-defer-pop -fno-delayed-branch -fno-guess-branch-probability -fno-cprop-registers -fno-if-conversion -fno-if-conversion2 -fno-tree-ccp -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-ter -fno-tree-lrs -fno-tree-sra -fno-tree-copyrename -fno-tree-fre -fno-tree-ch -fno-unit-at-a-time -fno-merge-constants main.c
objdump -d dce.ogenerates an optimized version. So why are the flags there if they cannot be selected individually? (I feel like I am missing something completely obvious..)
Thank you, -- slnc