Bug 1573429 - gcc crash when compiling with -mfma
Summary: gcc crash when compiling with -mfma
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 7.0 RHEL 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Marek Polacek
QA Contact: Michael Petlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-01 09:04 UTC by Duncan Muirhead
Modified: 2018-11-13 08:39 UTC (History)
7 users (show)

Fixed In Version: devtoolset-8-gcc-8.1.1-5.el7
Doc Type: Bug Fix
Doc Text:
Previously, GCC could crash when vectorizing code using FMA (Fused multiply–add) when processing a ternary operand. This bug has been fixed and the code compiles correctly.
Clone Of:
Environment:
Last Closed: 2018-11-13 08:38:30 UTC
Target Upstream Version:


Attachments (Terms of Use)
preprocessed source (104.57 KB, text/x-csrc)
2018-05-01 09:04 UTC, Duncan Muirhead
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 85597 0 None None None 2018-05-01 20:58:13 UTC
Red Hat Product Errata RHBA-2018:3562 0 None None None 2018-11-13 08:39:11 UTC

Description Duncan Muirhead 2018-05-01 09:04:37 UTC
Created attachment 1429136 [details]
preprocessed source

/opt/rh/devtoolset-7/root/usr/bin/gcc -std=gnu11 -Wall -g  -D_GNU_SOURCE -m64 -fopenmp  -mavx2 -O3  -ffast-math -fno-unsafe-math-optimizations -mfma fmabug.c -lm -o fmabugf
fmabug.c: In function ‘main’:
fmabug.c:63:5: internal compiler error: in compute_live_loop_exits, at tree-ssa-loop-manip.c:229
 int main( int argc, char** argv)

I wrote a small test program to try to understand why I was getting wrong answers when using the fma() function, with -mfma enabled. I built the program twice, once without -mfma, in which case it compiled and ran fine, and once with  when I got the compiler crash above.


Version-Release number of selected component (if applicable):
/user/dmuir/utils/la/test% /opt/rh/devtoolset-7/root/usr/bin/gcc --version
gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



How reproducible:
Compile the program

Additional info:

Comment 2 Marek Polacek 2018-05-01 13:05:41 UTC
Thanks for the bug report.  This fails even with current trunk; I'll reduce and open an upstream PR.

Comment 4 Marek Polacek 2018-05-24 15:16:15 UTC
Too late for DTS 7.

Comment 6 Marek Polacek 2018-07-13 18:14:13 UTC
Fixed.

Comment 8 Michael Petlan 2018-10-04 23:01:43 UTC
Reproduced with devtoolset-7-gcc.
Works with devtoolset-8-gcc-8.2.1-3.el8.x86_64.
VERIFIED.

Comment 10 errata-xmlrpc 2018-11-13 08:38:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3562


Note You need to log in before you can comment on or make changes to this bug.