This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to replace -O1 with corresponding -f's?
Sergei Organov wrote:
> Andrew Haley <aph@redhat.com> writes:
>
>
>>Sergei Organov writes:
>> > Hi,
>> >
>> > Using gcc compiled from gcc-4_0-branch, in an attempt to see which
>> > particular optimization option makes my test case to be mis-optimized, I
>> > try to replace -O1 (which toggles on the problem) with corresponding set
>> > of -fxxx optimization options.
>>
>>In general you can't do this. You can turn some optimization passes
>>off, though.
>
>
> Sigh :(
To be clear - there are a number of optimizations which have no corresponding
-f switch, being enabled or disabled solely by "if (optimize)" constructs; the
global 'optimize' flag is set by -On (n>0). Similarly, there are places where
"if (optimize >= 2)" is the sole trigger.
This could be construed a bug, and I do not think there would be objection to
patches that add -f options for every such optimization.
zw