This is the mail archive of the
mailing list for the GCC project.
Re: GCC5 optimization level causes runtime error in WINE
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Michael Cronenworth <mike at cchtml dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Sun, 8 Mar 2015 12:30:45 +0000
- Subject: Re: GCC5 optimization level causes runtime error in WINE
- Authentication-results: sourceware.org; auth=none
- References: <54FB86B8 dot 4040403 at cchtml dot com>
On 7 March 2015 at 23:16, Michael Cronenworth wrote:
> I am attempting to debug why WINE, when compiled with GCC 5 on Fedora
> Rawhide, cannot run when an optimization level is specified.
> -O0 : works
> -O1 : segfault
> -O2 : segfault
Do you have any more details available somewhere I can see them? Maybe
in Fedora's bugzilla or on the devel@ list?
> 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.
As already pointed out, turning on individual optimizations without -O
has no effect.
https://gcc.gnu.org/bugs/ advises "Before reporting that GCC compiles
your code incorrectly, compile it with gcc -Wall -Wextra and see
whether this shows anything wrong with your code. Similarly, if
compiling with -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations makes a difference, your code
probably is not correct."
Although -fno-strict-aliasing is unlikely to make any difference
because strict aliasing is only enabled at -O2 and above.
You can also try -fsanitize=undefined to detect undefined behaviour at runtime.