when building fontforge with -O3 -ftracer with gcc-4.1.1, the build bombs: i686-pc-linux-gnu-gcc -O3 -march=pentium-m -pipe -fomit-frame-pointer -ftracer -I/usr/include/freetype2/ -I/usr/include/libxml2/ -I../inc -I/usr/pkg/include -I/usr/pkg/include/giflib -Wmissing-prototypes -Wunused -Wimplicit -Wreturn-type -Wparentheses -Wformat -Wchar-subscripts -DNOTHREADS -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ICONV_H=1 -D_HAS_LONGLONG=1 -DHAVE_LIBINTL_H=1 -DFONTFORGE_CONFIG_TYPE3=1 -DFONTFORGE_CONFIG_DEVICETABLES=1 -DLIBDIR=\"/lib\" -c gpsdraw.c -fPIC -DPIC -o gpsdraw.lo gpsdraw.c: In function 'PSDrawElipse': gpsdraw.c:442: fatal error: internal consistency failure compilation terminated. verified on Gentoo and Debian that 4.0.3 works, 4.1.1 fails, mainline works
Created attachment 11812 [details] PR28243-ice.i $ gcc-4.1.1 -c -ftracer -O3 -m32 -fPIC PR28243-ice.i PR28243-ice.i: In function 'PSDrawFillCircle': PR28243-ice.i:31: fatal error: internal consistency failure compilation terminated. for the full preprocessed output: http://bugs.gentoo.org/attachment.cgi?id=84775
Confirmed. -O2 -ftracer -fPIC.
Here's another test case, taken from maxdb: 50015:tbm@deprecation: ~/tmp/src/gcc/delta/bin] gcc-4.1 -c -fPIC -O2 28243.c 28243.c: In function ‘pa01CompareKeywordW’: 28243.c:25: fatal error: internal consistency failure compilation terminated. Preprocessed source stored into /tmp/cc4ogkHJ.out file, please attach this to your bugreport. zsh: exit 1 gcc-4.1 -c -fPIC -O2 28243.c 50016:tbm@deprecation: ~/tmp/src/gcc/delta/bin] cat 28243.c typedef struct tsp1_packet_header { } tsp81_UCS2Char; typedef struct { short entry; unsigned char keyword[(18)]; int order_type_key; unsigned short keywordW[(18)]; } api_keyword_tab; static api_keyword_tab keyword_tab[] = { }; pa01CompareKeywordW (const unsigned short * strp, int * order_type) { unsigned int i, len1, len2; for (i = 0; keyword_tab[i].entry != (99); i++) { sp81UCS2strlen ((tsp81_UCS2Char *) (keyword_tab[i].keywordW)); len1 = len1 < len2 ? len1 : len2; if (memcmp (keyword_tab[i].keywordW, strp, len1) == 0) { *order_type = keyword_tab[i].order_type_key; break; } } }
Probably latent on mainline.
Here's a slightly shorter testcase: ========================================= struct A { char c[13]; int k[1]; }; struct A a[1]; void foo(int* p) { int i, j; for (i=0; i<2; ++i) if (memcmp (a[i].k, p, j)) { *p = a[i].k[0]; bar ((struct A*) (a[i].k)); break; } } ========================================= Btw, the error should be an internal_error and not a fatal_error IMHO: flow.c:493: fatal_error ("internal consistency failure"); flow.c:518: fatal_error ("internal consistency failure"); flow.c:540: fatal_error ("internal consistency failure"); We already have issue an ICE with the same message here: emit-rtl.c:2239: internal_error ("internal consistency failure");
> Here's another test case, taken from maxdb: Please do not attach "other" testcases to a PR, the underlying problems are very likely unrelated. Only testcases reduced from the original one are of any help.
Investigating.
Subject: Bug 28243 Author: ebotcazou Date: Tue Sep 12 21:48:40 2006 New Revision: 116906 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116906 Log: PR rtl-optimization/28243 * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past the insn to which the note was originally attached. Added: trunk/gcc/testsuite/gcc.dg/pr28243.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 28243 Author: ebotcazou Date: Tue Sep 12 21:49:45 2006 New Revision: 116907 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116907 Log: PR rtl-optimization/28243 * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past the insn to which the note was originally attached. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr28243.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/combine.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in upcoming 4.1.2 release.