gcc (GCC) 4.4.0 20080828 (experimental) gcc -g -O2 -march=i686 -fstack-protector -c task.c -o task.o
Created attachment 16160 [details] the preprocessed source
Can you say what the ICE is?
[~/tmp]$gcc --version |head -1 gcc (GCC) 4.4.0 20080902 (experimental) [~/tmp]$gcc -g -O2 -march=i686 -fstack-protector -c task.c -o task.o /trunk/libgomp/task.c: In function 'GOMP_task': /trunk/libgomp/task.c:186: internal compiler error: in mem_loc_descriptor, at dwarf2out.c:10098 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
What happens here is that there is a variable (task) initialized from a value within thread local aggregate (gomp_tls_data.task) and it is never modified, and as i386 has very few registers and register preassure is high, its pseudo is replaced by equiv mem, which happens to be: (mem/s/f/c:SI (plus:SI (plus:SI (unspec:SI [ (const_int 0 [0x0]) ] 18) (reg:SI 3 bx [168])) (const_int 36 [0x24])) [16 gomp_tls_data.task+0 S4 A32]) (the unspec there is thread pointer). This is then what dwarf2out sees and fails on gcc_unreachable, because it doesn't handle that UNSPEC.
Subject: Bug 37275 Author: jakub Date: Fri Sep 26 20:59:03 2008 New Revision: 140712 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140712 Log: PR middle-end/37275 * dwarf2out.c (tls_mem_loc_descriptor): New function. (mem_loc_descriptor): Use it for MEM. For PLUS fail if second mem_loc_descriptor failed. Accept UNSPEC. (loc_descriptor): Use tls_mem_loc_descriptor for MEM. For PARALLEL fail if one of the loc_descriptor calls for pieces failed. (loc_descriptor_from_tree_1): Handle even DECL_EXTERNAL __thread vars, as long as they bind locally. For COMPONENT_REF, ARRAY_REF etc. fail if loc_descriptor_from_tree_1 on offset failed. * gcc.target/i386/pr37275.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr37275.c Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog
Fixed.