$ gcc -Wp,-MD,kernel/.sched.o.d -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.3.1/include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/bunk/linux/kernel-2.6/git/linux-2.6/include -include include/linux/autoconf.h -I/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel -Ikernel -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -fno-stack-protector -D__arch_um__ -DSUBARCH=\"i386\" -I/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/um/include -Iarch/um/include -I/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/um/include -I/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/um/include/skas -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=kernel_in6addr_any -march=i686 -mpreferred-stack-boundary=2 -ffreestanding -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime -fno-unit-at-a-time -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-omit-frame-pointer -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(sched)" -D"KBUILD_MODNAME=KBUILD_STR(sched)" -c -o kernel/sched.o /home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:1213: /home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched_idletask.c: In function ‘check_preempt_curr_idle’: /home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched_idletask.c:20: internal compiler error: in cgraph_estimate_size_after_inlining, at ipa-inline.c:188 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions. $ gcc --version gcc (Debian 4.3.0-1) 4.3.1 20080309 (prerelease)
Created attachment 15337 [details] preprocessed source
First -fno-unit-at-a-time seems wrong.
That's the UML kernel, and it was added there quite some time ago. I do not know whether that might be dropped or whether it might still result in increased stack usage with gcc 4.3, but IMHO as long as gcc offers this option it shouldn't cause an ICE.
I can't reproduce this with tmp/g> /home/bangerth/bin/x86/gcc-mainline/bin/gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../mainline/configure --prefix=/home/bangerth/bin/x86/gcc-mainline --enable-languages=c,c++ --enable-checking --with-gmp=/home/bangerth/bin/x86 --with-mpfr=/home/bangerth/bin/x86 Thread model: posix gcc version 4.4.0 20080317 (experimental) [trunk revision 133287] (GCC) Can you state which flags you actually need to reproduce the bug with your preprocessed sources? W.
The flags I used are in my bug description. It seems "-Os -fno-unit-at-a-time" are the minimum flags required for reproducing it.
It appears to work with "gcc version 4.4.0 20080317". Can you see if it works for you as well with a more recent gcc version (either from top-of-tree or the top of the 4.3 branch that you used in your experiments)? W.
Bug seems to be no longer present with svn HEAD. Bug is still present in 4.3 as of 4.3-20080320.
Confirmed. Testcase, -Os -fno-unit-at-a-time static void __resched_task(void *p, int tif_bit); static inline __attribute__((always_inline)) void resched_task(void *p) { __resched_task(p, 2); } static void __resched_task(void *p, int tif_bit) { } void check_preempt_curr_idle(void *p) { resched_task(p); } if you put an inline onto the definition of __resched_task the testcase also ICEs for -O and -O2, so quite likely we are more agressive with -Os inlining but decide so after-the-fact which confuses the size estimates. Honza, can you please have a look here?
4.3.1 is being released, adjusting target milestone.
4.3.2 is released, changing milestones to 4.3.3.
GCC 4.3.3 is being released, adjusting target milestone.
GCC 4.3.4 is being released, adjusting target milestone.
GCC 4.3.5 is being released, adjusting target milestone.
The reduced test case in comment #8, with options "-c -Os -fno-unit-at-a-time", does not ICE in gcc 4.4.5 20100909, gcc 4.6.0 20100828. But it gives an ICE with gcc 4.3.5. Also, for sched.i, with options "-c -Os -fno-unit-at-a-time", there is no ICE with gcc 4.4.5 20100909, gcc 4.6.0 20100828. But it gives an ICE with gcc 4.3.5. Just FYI.
Fixed for 4.4.0.