Bug 46651 - [4.5 Regression] ICE with graphite enabled in cairo-1.8.10
[4.5 Regression] ICE with graphite enabled in cairo-1.8.10
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: tree-optimization
4.5.1
: P3 normal
: 4.5.2
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-25 02:25 UTC by saellaven
Modified: 2010-11-30 06:06 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-11-26 16:08:02


Attachments
preprocessed source (362.02 KB, application/octet-stream)
2010-11-25 02:25 UTC, saellaven
Details
preprocessed source without -march or -mtune (362.02 KB, application/octet-stream)
2010-11-26 17:20 UTC, saellaven
Details
A patch backported from trunk (1.51 KB, patch)
2010-11-29 19:10 UTC, H.J. Lu
Details | Diff
cairo-cff-subset.i (428.09 KB, text/plain)
2010-11-29 19:12 UTC, Ryan Hill
Details

Note You need to log in before you can comment on or make changes to this bug.
Description saellaven 2010-11-25 02:25:58 UTC
Created attachment 22523 [details]
preprocessed source

See also http://bugs.gentoo.org/show_bug.cgi?id=346445

uname -a
Linux death 2.6.36-gentoo-r3 #1 SMP Mon Nov 22 23:25:19 EST 2010 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ AuthenticAMD GNU/Linux

gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.1-r1/work/gcc-4.5.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.1-r1 p1.3, pie-0.4.5'
Thread model: posix
gcc version 4.5.1 (Gentoo 4.5.1-r1 p1.3, pie-0.4.5) 



../doltcompile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I/usr/include/pixman-1      -I/usr/include/freetype2       -I/usr/include/libpng14                         -O2 -march=native -mtune=native -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -finline-limit=1200 -MT cairo-cff-subset.lo -MD -MP -MF .deps/cairo-cff-subset.Tpo -c -o cairo-cff-subset.lo cairo-cff-subset.c
cairo-cff-subset.c: In function 'cff_index_write':
cairo-cff-subset.c:313:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
make[3]: *** [cairo-cff-subset.lo] Error 1
Comment 1 saellaven 2010-11-25 02:28:37 UTC
compiles fine without any of -floop-interchange -floop-strip-mine -floop-block
-fgraphite-identity
Comment 2 Brad Jackson 2010-11-26 03:03:04 UTC
This crash was not in the 20101104 weekly snapshot, but has been in all snapshots since, including 20101125.
Comment 3 H.J. Lu 2010-11-26 16:08:02 UTC
Please don't use "-march=native -mtune=native" when
reporting bugs since we have no idea what they are.
Comment 4 saellaven 2010-11-26 17:20:44 UTC
Created attachment 22540 [details]
preprocessed source without -march or -mtune

compiled with

./doltcompile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I/usr/include/pixman-1      -I/usr/include/freetype2       -I/usr/include/libpng14                         -O2  -save-temps -ggdb -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -finline-limit=1200 -MT cairo-cff-subset.lo -MD -MP -MF .deps/cairo-cff-subset.Tpo -c -o cairo-cff-subset.lo cairo-cff-subset.c
Comment 5 saellaven 2010-11-26 21:10:50 UTC
(In reply to comment #4)
> Created attachment 22540 [details]
> preprocessed source without -march or -mtune
> 
> compiled with
> 
> ./doltcompile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I.
> -I/usr/include/pixman-1      -I/usr/include/freetype2      
> -I/usr/include/libpng14                         -O2  -save-temps -ggdb
> -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity
> -finline-limit=1200 -MT cairo-cff-subset.lo -MD -MP -MF
> .deps/cairo-cff-subset.Tpo -c -o cairo-cff-subset.lo cairo-cff-subset.c

to clarify, I got the same error when compiling without native optimizations

cairo-cff-subset.c: In function 'cff_index_write':
cairo-cff-subset.c:313:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
Comment 6 Brad Jackson 2010-11-26 21:19:17 UTC
It happens for me compiling Firefox from trunk source on 32-bit Intel/Linux using -march=core2, but this doesn't appear to be specific to an architecture. I'm available for applying test patches to snapshot builds if GCC developers aren't able to reproduce.
Comment 7 saellaven 2010-11-29 08:13:31 UTC
(In reply to comment #2)
> This crash was not in the 20101104 weekly snapshot, but has been in all
> snapshots since, including 20101125.

Based on this, I just did some manual bisecting. There appears to
be 3 patches added just before gcc-4.5.1-r1 was unmasked in portage:

20_all_gcc-4.5-fno-strict-overflow.patch
49_all_gcc-4.5-pr46491-kernel-miscompile.patch
90_all_gcc-4.5-graphite-ICE.patch

removal of all 3 resulted in a gcc that would compile cairo without ICE. 

I then dropped just the graphite-ICE patch. Result: successful compile
I then dropped just the pr46491-kernel-miscompile. Result: ICE
I then dropped just the fno-strict-overflow patch. Result: ICE

90_all_gcc-4.5-graphite-ICE.patch points to:
https://bugs.gentoo.org/345861
http://gcc.gnu.org/PR45314
Comment 8 H.J. Lu 2010-11-29 14:37:24 UTC
Please try the unmodified GCC 4.5.1.
Comment 9 saellaven 2010-11-29 16:53:31 UTC
fails with the unmodified 20101125 snapshot. I'm going to revert the patch I found above and will report back in a little while on whether or not it solves it in vanillla gcc.

/usr/src/build/./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/usr/src/build/./gcc/xgcc
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-4.5-20101125/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.5.2 20101125 (prerelease) (GCC)



/usr/src/build/./gcc/xgcc -B/usr/src/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -DHAVE_CONFIG_H -I. -I..  -I. -I/usr/include/pixman-1      -I/usr/include/freetype2 -I/usr/include/libpng14                         -O2   -ggdb -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -finline-limit=1200 -MT cairo-cff-subset.lo -MD -MP -MF .deps/cairo-cff-subset.Tpo -c -o cairo-cff-subset.lo cairo-cff-subset.c
cairo-cff-subset.c: In function 'cff_index_write':
cairo-cff-subset.c:313:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 10 saellaven 2010-11-29 17:50:32 UTC
success after reverting the patch from http://gcc.gnu.org/PR45314

/usr/src/build-revert/./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/usr/src/build-revert/./gcc/xgcc
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-4.5-20101125/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.5.2 20101125 (prerelease) (GCC)
Comment 11 H.J. Lu 2010-11-29 18:55:42 UTC
This bug was fixed on trunk by revision 163156:

http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00367.html
Comment 12 Brad Jackson 2010-11-29 19:08:53 UTC
Can the fix be applied to the branch before the 4.5.2 release? Seems like it's low risk since probably not too many people are using Graphite options.
Comment 13 H.J. Lu 2010-11-29 19:10:15 UTC
Created attachment 22567 [details]
A patch backported from trunk

Please try this.
Comment 14 Ryan Hill 2010-11-29 19:12:18 UTC
Created attachment 22568 [details]
cairo-cff-subset.i

This is with 4.5 branch svn HEAD (rev 167257).  No patches are applied, other than branding.

cairo-1.10.0/src # x86_64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I/usr/include/pixman-1 -Wno-unused-parameter -Wno-attributes -O2 -floop-block -c cairo-cff-subset.c 
cairo-cff-subset.c: In function 'cff_index_write':
cairo-cff-subset.c:316:1: internal compiler error: tree check: expected ssa_name, have integer_cst in insert_out_of_ssa_copy, at graphite-sese-to-poly.c:2129
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
halo ~/portage/x11-libs/cairo-1.10.0-r3/work/cairo-1.10.0/src # x86_64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I/usr/include/pixman-1 -Wno-unused-parameter -Wno-attributes -O2 -floop-block -c cairo-cff-subset.c -v -save-temps
Using built-in specs.
COLLECT_GCC=/usr/x86_64-unknown-linux-gnu/gcc-bin/4.5.2-pre9999/x86_64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.2_pre9999/work/gcc-4.5.2-9999/configure --prefix=/usr --bindir=/usr/x86_64-unknown-linux-gnu/gcc-bin/4.5.2-pre9999 --includedir=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/include --datadir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.2-pre9999 --mandir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.2-pre9999/man --infodir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.2-pre9999/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/include/g++-v4 --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --enable-lto --disable-nls --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --disable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-unknown-linux-gnu/4.5.2-pre9999/python --enable-checking=yes --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo SVN'
Thread model: posix
gcc version 4.5.2-pre9999 20101129 (prerelease) rev. 167257 (Gentoo SVN) 
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I..' '-I/usr/include/pixman-1' '-Wno-unused-parameter' '-Wno-attributes' '-O2' '-floop-block' '-c' '-v' '-save-temps' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/cc1 -E -quiet -v -I.. -I/usr/include/pixman-1 -DHAVE_CONFIG_H cairo-cff-subset.c -mtune=generic -march=x86-64 -Wno-unused-parameter -Wno-attributes -floop-block -O2 -fpch-preprocess -o cairo-cff-subset.i
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 ..
 /usr/include/pixman-1
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/include
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I..' '-I/usr/include/pixman-1' '-Wno-unused-parameter' '-Wno-attributes' '-O2' '-floop-block' '-c' '-v' '-save-temps' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2-pre9999/cc1 -fpreprocessed cairo-cff-subset.i -quiet -dumpbase cairo-cff-subset.c -mtune=generic -march=x86-64 -auxbase cairo-cff-subset -O2 -Wno-unused-parameter -Wno-attributes -version -floop-block -o cairo-cff-subset.s
GNU C (Gentoo SVN) version 4.5.2-pre9999 20101129 (prerelease) rev. 167257 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.2-pre9999 20101129 (prerelease) rev. 167257, GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (Gentoo SVN) version 4.5.2-pre9999 20101129 (prerelease) rev. 167257 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.2-pre9999 20101129 (prerelease) rev. 167257, GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: af73c8cd9faabd3e4d17cfeaf8807132
cairo-cff-subset.c: In function 'cff_index_write':
cairo-cff-subset.c:316:1: internal compiler error: tree check: expected ssa_name, have integer_cst in insert_out_of_ssa_copy, at graphite-sese-to-poly.c:2129
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
Comment 15 Ryan Hill 2010-11-29 19:13:19 UTC
Nevermind.
Comment 16 saellaven 2010-11-29 20:14:52 UTC
success with snapshot + HJ Lu's patch.

$ /usr/src/build-hjpatch/./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/usr/src/build-hjpatch/./gcc/xgcc
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-4.5-20101125/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.5.2 20101125 (prerelease) (GCC)
Comment 17 hjl@gcc.gnu.org 2010-11-29 21:54:28 UTC
Author: hjl
Date: Mon Nov 29 21:54:24 2010
New Revision: 167274

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167274
Log:
Use SSA_NAME_DEF_STMT only on SSA_NAMEs.

gcc/

2010-11-29  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline
	PR middle-end/46651
	2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
	SSA_NAME_DEF_STMT only on SSA_NAMEs.
    
gcc/testsuite/

2010-11-29  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline
	2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/46651
	* gcc.dg/graphite/id-24.c: New.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/graphite/id-24.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/graphite-sese-to-poly.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Comment 18 Brad Jackson 2010-11-30 00:59:09 UTC
Firefox trunk successfully compiles with the patch applied to the 4.5.2 20101125 snapshot.
Comment 19 H.J. Lu 2010-11-30 06:06:43 UTC
Fixed.