Building kdelibs 3.4 with gcc 4.0.0 on i686-pc-linux-gnu. Failed with "internal compiler error" on kimgio/exr.cpp. Command line as follows: /bin/sh ../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../dcop -I../kdecore -I../kio/kssl -I../kio -I../dcop -I../libltdl -I../dcop -I../libltdl -I../kdefx -I../kdecore -I../kdecore -I../kdeui -I../kio -I../kio/kio -I../kio/kfile -I.. -I/opt/qt/include -I/usr/X11R6/include -I/opt/kde/include -Drestrict= -I/usr/include/OpenEXR -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=i686 -O2 -pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -fno-exceptions -fno-check-new -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -fexceptions -c -o exr.lo exr.cpp -v -save-temps >& gcc4-bug-output.txt
Created attachment 8751 [details] The command line generating the error.
Created attachment 8752 [details] Output as generated from command line.
Created attachment 8753 [details] preprocessed file (gzipped due to size - *.ii.gz) as required by bug-submit guidelines Note: gzipped due to uncompressed size > 1 meg.
I cannot reproduce this on the mainline or "4.0.0 20050410", I will build a 4.0.0 release later today, this might also be already fixed on the 4.0 branch too.
ICE in gcc/expr.c:3087 emit_move_insn is called with y == NULL. #0 emit_move_insn (x=0x42dbc170, y=0x0) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:3087 #1 0x081d2ddc in convert_modes (mode=QImode, oldmode=SFmode, x=0x42dbc170, unsignedp=0) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:800 #2 0x081d31a5 in convert_to_mode (mode=QImode, x=0xa, unsignedp=10) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:694 #3 0x081d43a2 in store_expr (exp=0x4021b6c0, target=0x42d8f660, call_param_p=0) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:4181 #4 0x081d589e in expand_assignment (to=0x42db2000, from=0x5) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:3990 #5 0x081cc4b3 in expand_expr_real_1 (exp=Variable "exp" is not available. ) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:8136 #6 0x081cfa6e in expand_expr_real (exp=0x42daa9fc, target=0x40144210, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.c:6358 #7 0x0832b796 in expand_expr_stmt (exp=0x42daa9fc) at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/expr.h:482 #8 0x0834fb15 in tree_expand_cfg () at /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/cfgexpand.c:1133 ...
// reduced testcase, compile with -O1 -free-pre template <class T> inline T klamp (T a, T l, T h) { return (a < l)? l : ((a > h)? h : a); } int foo (char); int f (void) { float r; return foo (klamp (r * 1.1f, 0.f, 255.f)); } reverting patch from bug 21173 exposes this bug, so this is a dup. *** This bug has been marked as a duplicate of 21173 ***