[CONFIRMED] gcc-4.8.1 tree-optimization regression

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

[CONFIRMED] gcc-4.8.1 tree-optimization regression

Post 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 ")
(...)
You do not have the required permissions to view the files attached to this post.
Last edited by ermo on Sun Jul 28, 2013 3:53 pm, edited 1 time in total.
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

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

Post 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.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

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

Post by ermo »

Bug submitted (for all the good it'll do):

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

8)
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

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

Post 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. :)
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

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

Post by klauss »

:D

Cool. That means they'll fix it soonish.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
gonzo
Bounty Hunter
Bounty Hunter
Posts: 207
Joined: Wed Oct 20, 2010 3:50 pm
Location: Kungälv, Sweden
Contact:

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

Post by gonzo »

Status: RESOLVED FIXED
8)
There are 10 types of people in this world, those who understand binary and those who don't.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

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

Post by klauss »

Nicely done :)

PS: Yeap, I've been offline for a while
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
blackrose
Atmospheric Pilot
Atmospheric Pilot
Posts: 1
Joined: Fri Oct 11, 2013 7:37 am

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

Post by blackrose »

*SNIP*
Last edited by pheonixstorm on Fri Oct 11, 2013 4:38 pm, edited 1 time in total.
Reason: Repost of something klauss wrote, possible spambot.
Post Reply