Bug 875472

Summary: gcc crashes (segmentation fault)
Product: Red Hat Enterprise Linux 6 Reporter: German Pulido <g-pulido>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Miroslav Franc <mfranc>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: mcermak, mfranc, mpolacek, ohudlick
Target Milestone: rc   
Target Release: 6.6   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-4.4.7-5.el6 Doc Type: Bug Fix
Doc Text:
Previously, GCC could crash when performing a loop vectorization optimization. This has been fixed by properly ignoring the debug statements when the vectorizer is looking for a loop-exit PHI node and now GCC compiles the code correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 05:01:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Preprocessed source stored into /tmp/ccF1ddlI.out file,
none
Patch needed to compile gngeo 0.8 none

Description German Pulido 2012-11-11 13:42:38 UTC
Created attachment 642828 [details]
Preprocessed source stored into /tmp/ccF1ddlI.out file,

Description of problem:
gcc crashes with segmentation fault while compiling some software on x86_64 (the same software compiles fine under i686)

Version-Release number of selected component (if applicable):
[gpulido@shockwave SPECS]$ rpm -qa | grep gcc
gcc-c++-4.4.6-4.el6.x86_64
gcc-4.4.6-4.el6.x86_64
gcc-java-4.4.6-4.el6.x86_64
libgcc-4.4.6-4.el6.x86_64
[gpulido@shockwave SPECS]$ 


How reproducible:
Always

Steps to Reproduce:
1. Get gngeo-0.8.tar.gz tarball
2. unpack it
3. patch it so it compiles (patch attached)
4. try to compile it
5. gcc crashes
  
Actual results:
...
gcc -DHAVE_CONFIG_H -I. -I..  -DDATA_DIRECTORY=\"/usr/share/gngeo\"   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -O3 -fstrength-reduce -frerun-loop-opt -Wall -Wno-unused -funroll-loops                     -ffast-math  -fexpensive-optimizations                      -malign-double -fomit-frame-pointer -g 		    -fno-strict-aliasing -pipe -DCPU=x86_64 -MT neocrypt.o -MD -MP -MF .deps/neocrypt.Tpo -c -o neocrypt.o neocrypt.c
neocrypt.c: In function 'neogeo_cmc50_m1_decrypt':
neocrypt.c:954: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccF1ddlI.out file, please attach this to your bugreport.
make[3]: *** [neocrypt.o] Error 1
make[3]: Leaving directory `/home/gpulido/packages/rpm/BUILD/gngeo-0.8/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/gpulido/packages/rpm/BUILD/gngeo-0.8/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gpulido/packages/rpm/BUILD/gngeo-0.8'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.OUZE7D (%build)


Expected results:
the program gets compiled fine, or compilation fails with some error related to the program being compiled

Additional info:

Comment 2 German Pulido 2012-11-11 13:45:30 UTC
Created attachment 642829 [details]
Patch needed to compile gngeo 0.8

To get the program's source code: http://gngeo.googlecode.com/files/gngeo-0.8.tar.gz

Comment 3 RHEL Program Management 2012-12-14 08:32:14 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 Marek Polacek 2014-02-11 17:10:16 UTC
Reproduced using RH 4.4 branch, FSF 4.4 is fine.

(gdb) r
Starting program: /home/marek/rh/x/rh-gcc-44/gcc/cc1 -quiet -O3 -g x.i

Program received signal SIGSEGV, Segmentation fault.
vect_create_epilog_for_reduction (vect_def=<optimized out>, stmt=<optimized out>, ncopies=8, 
    reduc_code=17781664, reduction_phi=<optimized out>)
    at /home/marek/rh/src-svn/gcc/branches/redhat/gcc-4_4-branch/gcc/tree-vect-transform.c:2772
2772	      FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, orig_name)
(gdb) p orig_name
$1 = (tree) 0x0

Comment 5 Marek Polacek 2014-02-11 18:43:31 UTC
Can't reproduce this with any FSF version/revision, so nothing to backport.

Comment 6 Marek Polacek 2014-02-11 18:48:38 UTC
The workaround is -fno-tree-vectorize.

Comment 12 errata-xmlrpc 2014-10-14 05:01:23 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.

http://rhn.redhat.com/errata/RHBA-2014-1377.html