Re: Bug#800318: gcc-5: [mips,mipsel] regression: miscompilation caused by -fexpensive-optimizations
On 2015-09-28 18:17, Andreas Cadhalpun wrote:
> Hi Aurelien,
> On 28.09.2015 14:48, Aurelien Jarno wrote:
> > On 2015-09-27 23:43, Andreas Cadhalpun wrote:
> >> A slightly larger test case for mips is compiling ffmpeg...
> > It what I did to test if the failure is due to the above changes.
> > ffmpeg builds fine with gcc version 5.2.1-17 and -march=mips2
> > -mtune=mips32 (instead of the new default -march=mips32r2), and passes
> > the testsuite. I'll see if I can isolate a smaller testcase so that we
> > can understand the problem.
> Attached is a testcase for mips, but it works fine for mipsel.
> One more peculiarity I noticed is that adding 'c->A = 1;' to
> an unused code path inverts the behavior: It works with
> -fexpensive-optimizations, but fails with -fno-expensive-optimizations.
Big thanks for working on that. I have done some tests with it and
-mtune=mips32r2 is the culprit not -march=mips32r2. This is kind of
unexpected, but at least it is consistent with the mipsel issue. This
means the optimization happens when scheduling the instructions. This
also means we have an easy workaround without lowering the ISA. I'll
commit that so that's in the next gcc upload.
I'll also try to better understand the issue so that I can report the
Aurelien Jarno GPG: 4096R/1DDD8C9B