Bug#800318: gcc-5: [mips,mipsel] regression: miscompilation caused by -fexpensive-optimizations
On 2015-09-27 23:43, Andreas Cadhalpun wrote:
> Hi Aurelien,
>
> On 27.09.2015 23:10, Aurelien Jarno wrote:
> > On 2015-09-27 20:37, Andreas Cadhalpun wrote:
> > Thanks for the detailed testcase. I have been able to reproduce the
> > issue on mipsel, but not on mips.
>
> Indeed, this test case only works on mipsel.
> However, the same tests of ffmpeg's testsuite fail on mips, just with different
> checksums. So it likely has the same cause.
>
> >> This works correctly with gcc-5 5.2.1-16, so it is a regression in 5.2.1-17.
> >> The changelog reveals:
> >> [ Aurelien Jarno ]
> >> * Use --with-mips-plt on mips*.
> >> * Build for R2 ISA on mips, mips64 and mips64el.
> >> * Optimize for R2 ISA on mipsel.
> >> * Only apply mips-fix-loongson2f-nop on mipsel.
> >>
> >> I assume one of these changes is responsible for this regression.
> >
> > Indeed. At least on mipsel the issue is due to the use of
> > -mtune=mips32r2 by default. I guess the best is to change it back to
> > -mtune=mips32 until we better understand the issue.
>
> OK.
>
> > Does someone have time to look at the issue more in details? The
> > generated code is quite different between -mtune=mips32 and
> > -mtune=mips32r2 (not in terms of instructions, but in terms of
> > sequencing).
> >
> > As for mips, given I am not able to reproduce the issue, my guess is
> > that it's due to the switch to -march=mips32r2, but I currently have
> > no way to make sure.
>
> 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.
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
Reply to: