Bug 11883 - [3.3 Regression] gcc 3.3.1 ICE with any -O on mercury-generated *.c file
Summary: [3.3 Regression] gcc 3.3.1 ICE with any -O on mercury-generated *.c file
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.1
: P1 critical
Target Milestone: 3.3.2
Assignee: Zdenek Dvorak
URL:
Keywords: ice-on-valid-code
: 12861 16906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-11 15:35 UTC by Jakub Bogusz
Modified: 2004-08-06 22:15 UTC (History)
4 users (show)

See Also:
Host:
Target: i686-pld-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-09-16 20:55:40


Attachments
Preprocessed source that triggers ICE (55.64 KB, application/octet-stream)
2003-08-11 16:57 UTC, Jakub Bogusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Bogusz 2003-08-11 15:35:36 UTC
Some files *.c generated by mercury compiler (http://www.cs.mu.oz.au/mercury/)
cause ICE on gcc 3.3 and 3.3.1 if any optimization is used (-O, -O2, -O3), at
least on x86.
(mercury preprocesses his *.m files, creating *.c files, which are compiled
 using gcc; that's why this file looks so ugly).

Compiler output:
tree234.c: In function `tree234_module66':
tree234.c:23795: internal compiler error: in flow_loops_find, at cfgloop.c:830
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Environment:
System: Linux builder 2.4.20 #1 Sat May 24 09:07:12 UTC 2003 i686 unknown unknown PLD Linux
Architecture: i686
	(Athlon CPU, Linux 2.4.20, glibc 2.3.2)
host: i686-pld-linux-gnu
build: i686-pld-linux-gnu
target: i686-pld-linux-gnu
configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,f77,ksi --enable-c99 --enable-long-long --enable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x i686-pld-linux

How-To-Repeat:
Try to compile attached file (which is preprocessed file that comes from
mercury source distribution - mercury-compiler-0.11.0/library/tree234.c)
with any optimizations enabled (-O, -O2, -O3), e.g.:

$ gcc -c tree234.i -O
tree234.c: In function `tree234_module66':
tree234.c:23795: internal compiler error: in flow_loops_find, at cfgloop.c:830
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$
Comment 1 Andrew Pinski 2003-08-11 15:39:37 UTC
Most likely related to bug 11496.
We need the preprocessed source file.
Comment 2 Jakub Bogusz 2003-08-11 16:57:42 UTC
Created attachment 4592 [details]
Preprocessed source that triggers ICE

Uh, it seems that gccbug-to-bugzilla interface has cut this file...
Comment 3 Jakub Bogusz 2003-08-11 17:00:03 UTC
"fix" section has been cut too, so here it is:
Workaround is not to use optimizations (use -O0 or no -O options):

$ gcc tree234.i -c -O0
$
Comment 4 Andrew Pinski 2003-08-11 17:23:31 UTC
Marking as invalid and marking this as ...
Comment 5 Andrew Pinski 2003-08-11 17:24:53 UTC
unconfirmed since I have not reduced this yet.

This only effects 3.3.x, not 3.4.

I am sure that the patch which broke PR 11496 broke this one too.
Comment 6 Dara Hazeghi 2003-08-25 00:48:13 UTC
See this still on gcc 3.3 branch (20030824). Would it be at all possible to make a smaller testcase? 
This one is, erhm, large and ugly.
Comment 7 Zdenek Dvorak 2003-09-16 20:55:40 UTC
Still occurs; since it seems to be loop related, I will take care of it.
Comment 8 Zdenek Dvorak 2003-09-16 21:29:55 UTC
In mainline fixed by

http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01106.html

The patch should also be safe for inclusion in 3.3 branch.
Comment 9 Zdenek Dvorak 2003-10-03 21:26:58 UTC
Patch commited to 3.3 branch.
Comment 10 Eric Botcazou 2003-11-01 05:54:11 UTC
*** Bug 12861 has been marked as a duplicate of this bug. ***
Comment 11 Volker Reichelt 2004-08-06 22:15:23 UTC
*** Bug 16906 has been marked as a duplicate of this bug. ***