Page 1 of 1

[CONFIRMED] gcc-4.8.1 tree-optimization regression

Posted: Sat Jul 27, 2013 6:49 pm
by ermo
On fedora19 on my Core 2 Duo E7500, g++ throws an ICE if I set set -march=native -mtune=native and supply both -ffast-math and -ftree-parallelize-loops=2 (from setting CPU_SMP = 2).

As a temporary workaround, I have removed -ffast-math, which allows me to build trunk.

Code: Select all

[ermo@sheila vegastrike]$ gcc --version
gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
Klauss advised me to fill in a bug-report with gcc, but I doubt it's worth the hassle tbh.

As an aside, I noticed a few small issues in the root trunk/vegastrike/CMakeLists.txt file:

1./ -ffast-math implies -fassociative-math and -funsafe-math-optimizations, making the latter two redundant (from 'man gcc'):

Code: Select all

-ffast-math
           Sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only,
           -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range.
(...)
-funsafe-math-optimizations
           Enables -fno-signed-zeros, -fno-trapping-math, -fassociative-math and -freciprocal-math.
2./ I can set CPUAMD_k10, but there's no actual optimization settings for that option? Note that the settings below have -ffast-math removed per the above.

Code: Select all

OPTION(CPUAMD_k10  "Enable AMD K10 optimizations (Athlon2)"
    OFF )
(...)
IF(CPUAMD_k8)
    SET(CPU_OPTS "-mtune=athlon64 -mfpmath=sse -msse2 -mmmx -m3dnow -ftree-vectorize -fprefetch-loop-arrays ")
ELSEIF(CPUAMD_K9)
    SET(CPU_OPTS "-mtune=k8-sse3 -mfpmath=sse -msse3 -mmmx -m3dnow -ftree-vectorize -funroll-loops ")
ELSEIF(CPUINTEL_p4)
    SET(CPU_OPTS "-mtune=pentium4 -mfpmath=sse -msse2 -mmmx -ftree-vectorize -funroll-loops ")
(...)

Re: gcc-4.8.1 ICEs w/ -ffast-math -ftree-parallelize-loops=2

Posted: Sat Jul 27, 2013 9:09 pm
by klauss
ermo wrote: Klauss advised me to fill in a bug-report with gcc, but I doubt it's worth the hassle tbh.
Well, depends on how much hassle it would be for you. But you already did a lot of the hard work, it's just about filling a bug report.

I can do it myself if you're still not up for it, but you're actually the ideal candidate since you can reproduce it easily.

Re: gcc-4.8.1 ICEs w/ -ffast-math -ftree-parallelize-loops=2

Posted: Sat Jul 27, 2013 9:54 pm
by ermo
Bug submitted (for all the good it'll do):

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58006

8)

Re: gcc-4.8.1 ICEs w/ -ffast-math -ftree-parallelize-loops=2

Posted: Sun Jul 28, 2013 3:52 pm
by ermo
Well, what do you know; Marc Glisse has taken the time to reproduce the issue and have created a minimal repro case, making this an official GCC 4.8/4.9 tree-optimization regression.

I'm quite surprised that they'd take it seriously, really. :)

Re: [CONFIRMED] gcc-4.8.1 tree-optimization regression

Posted: Sun Jul 28, 2013 6:12 pm
by klauss
:D

Cool. That means they'll fix it soonish.

Re: [CONFIRMED] gcc-4.8.1 tree-optimization regression

Posted: Wed Aug 28, 2013 2:48 am
by gonzo
Status: RESOLVED FIXED
8)

Re: [CONFIRMED] gcc-4.8.1 tree-optimization regression

Posted: Mon Sep 02, 2013 5:11 pm
by klauss
Nicely done :)

PS: Yeap, I've been offline for a while

Re: [CONFIRMED] gcc-4.8.1 tree-optimization regression

Posted: Fri Oct 11, 2013 8:56 am
by blackrose
*SNIP*