Bug 10890 - [3.3/3.4 regression] ICE in merge_assigned_reloads building Linux 2.4.2x sched.c
Summary: [3.3/3.4 regression] ICE in merge_assigned_reloads building Linux 2.4.2x sched.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 3.3
: P1 critical
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 10884 11007 11053 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-20 21:56 UTC by rfreund
Modified: 2004-01-17 04:22 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
sched.i (66.24 KB, text/x-c)
2003-05-21 15:17 UTC, rfreund
Details
reduced testcase (706 bytes, text/plain)
2003-05-22 03:39 UTC, Dara Hazeghi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rfreund 2003-05-20 21:56:00 UTC
note that I submitted this bug before, but forgot some information.

the compiler stops with the following message (when trying to compile linux 2.4.21-rc2):

sched.c: In function `schedule':
sched.c:709: internal compiler error: in merge_assigned_reloads, at reload1.c:6134

some info about gcc:
 --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc-Version 3.3

Release:
3.3

Environment:
linux x86

How-To-Repeat:
gcc -D__KERNEL__ -I/usr/src/linux-2.4.20/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=pentium3 -mcpu=pentium4   -nostdinc -iwithprefix include -DKBUILD_BASENAME=sched  -fno-omit-frame-pointer -c -o sched.o sched.c
Comment 1 Dara Hazeghi 2003-05-22 03:37:52 UTC
Hello,

I can confirm that this bug occurs with gcc 3.3 branch and mainline (20030521), but not with gcc 
3.2.3. This makes this a regression, and considering that this is code in the linux kernel, I'd say it's 
a rather serious regression. I've attached a reduced testcase (not positive if the testcase is legal, 
but it causes exactly the same error as the original).

Dara
Comment 2 Dara Hazeghi 2003-05-22 03:39:05 UTC
Created attachment 4050 [details]
reduced testcase
Comment 3 Volker Reichelt 2003-05-22 12:50:48 UTC
*** Bug 10884 has been marked as a duplicate of this bug. ***
Comment 4 Wolfgang Bangerth 2003-05-22 14:06:46 UTC
It's indeed a regression in 3.3 and 3.4, but I suspect the inline-asm is
invalid, since we get an error if no optimization is switched on.

g/x> /home/bangerth/bin/gcc-3.2.3-pre/bin/gcc -c x.c -O2

g/x> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -c x.c -O2
x.c: In function `schedule':
x.c:78: internal compiler error: in merge_assigned_reloads, at reload1.c:6134
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

g/x> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -c x.c
x.c: In function `schedule':
x.c:77: error: can't find a register in class `GENERAL_REGS' while reloading `asm'

Comment 5 Dara Hazeghi 2003-06-01 03:14:42 UTC
*** Bug 11007 has been marked as a duplicate of this bug. ***
Comment 6 Dara Hazeghi 2003-06-01 18:46:58 UTC
Make the bug's summary more clear...
Comment 7 Dara Hazeghi 2003-06-01 18:52:05 UTC
*** Bug 11053 has been marked as a duplicate of this bug. ***
Comment 8 Wolfgang Bangerth 2003-06-06 16:52:08 UTC
Patch here:
    http://gcc.gnu.org/ml/gcc-bugs/2003-06/msg00743.html
Comment 9 Dara Hazeghi 2003-06-08 03:02:33 UTC
Jim,

thanks for looking at this. Just one quick question, when compiling the  testcase without 
optimization, gcc gives the following error:

junk.i: In function `schedule':
junk.i:77: error: can't find a register in class `GENERAL_REGS' while reloading `asm'

Is this a bug in the testcase or gcc? Thanks,

Dara
Comment 10 Jim Wilson 2003-06-16 19:15:13 UTC
The linux kernel must be compiled with optimization in order to work, because of
design choices, so the fact that the asm does not work without optimization is a
non-issue for the linux kernel folks.

I didn't look at this too closely, but my impression is that the asm is too
complicated to work without optimization.  That is, it needs more registers than
are available when not optimizing.
Comment 11 Dara Hazeghi 2003-06-16 19:41:45 UTC
Thanks Jim, I think that answers the question. Closing as FIXED...