This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC5 optimization level causes runtime error in WINE



On Sat, 7 Mar 2015, Michael Cronenworth wrote:

> Hello,
> 
> I am attempting to debug why WINE[1], when compiled with GCC 5[2] on Fedora
> Rawhide, cannot run when an optimization level is specified.
> 
> -O0 : works
> -O1 : segfault
> -O2 : segfault
> 
> I have enabled -O1 flags manually and WINE works. What other settings is GCC 5
> enabling between optimization levels? I have run -Q --help=optimizers and
> that's what I based my flag settings on, but there is something obviously
> missing that -O1 enables.

GCC manual explains the behavior:

    Most optimizations are only enabled if an -O level is set on the command
    line. Otherwise they are disabled, even if individual optimization flags
    are specified. 

As a result, you can use -O1 and disable individual optimizations with
-fno-... instead.

Out of curiousity, where did you find the -Q --help=optimizers incantation?
I've always thought it's a rarer bit of knowledge than the -O flag behavior.

Alexander


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]