# cat tmp.c int main() { } # LANG=C gcc -std=gnu9x -O2 -fmudflap -c -lmudflap -fprofile-generate tmp.c tmp.c: In function '_GLOBAL__I_1_main': tmp.c:1: internal compiler error: Segmentation fault # gcc -v Reading specs from /usr/lib/gcc/i686-pld-linux/4.0.0/specs Target: i686-pld-linux Configured with: ../configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,ada --enable-c99 --enable-long-long --disable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-demangler-in-ld --with-system-zlib --with-slibdir=/lib --without-x --enable-cmath i686-pld-linux Thread model: posix gcc version 4.0.0 20050220 (experimental) (PLD Linux)
Confirmed.
also ices with current mainline.
with 4.1.0-20050724 testcase works.
(In reply to comment #3) > with 4.1.0-20050724 testcase works. > wrrr, please ignore previous comment. case still fails.
# testcase: `int main() { return 0; } Program received signal SIGSEGV, Segmentation fault. 0x082924bf in categorize_ctor_elements_1 (ctor=0xb7d41030, p_nz_elts=0xbffbec7c, p_nc_elts=0xbffbec78, p_elt_count=0xbffbec80, p_must_clear=0xbffbec77 "") at ../../gcc/expr.c:4413 4413 if (TREE_CODE (purpose) == RANGE_EXPR) (gdb) bt #0 0x082924bf in categorize_ctor_elements_1 (ctor=0xb7d41030, p_nz_elts=0xbffbec7c, p_nc_elts=0xbffbec78, p_elt_count=0xbffbec80, p_must_clear=0xbffbec77 "") at ../../gcc/expr.c:4413 #1 0x08292f76 in categorize_ctor_elements (ctor=0xb7d41030, p_nz_elts=0xbffbec7c, p_nc_elts=0xbffbec78, p_elt_count=0xbffbec80, p_must_clear=0xbffbec77 "") at ../../gcc/expr.c:4527 #2 0x08119f56 in gimplify_init_constructor (expr_p=0xbffbf210, pre_p=0xbffbef34, post_p=0xbffbef30, want_value=0 '\0') at ../../gcc/gimplify.c:2676 #3 0x0811b9d8 in gimplify_modify_expr_rhs (expr_p=0xbffbf210, from_p=0xb7cd0338, to_p=0xb7cd0334, pre_p=0xbffbef34, post_p=0xbffbef30, want_value=0 '\0') at ../../gcc/gimplify.c:3027 #4 0x0811c244 in gimplify_modify_expr (expr_p=0xbffbf210, pre_p=0xbffbef34, post_p=0xbffbef30, want_value=0 '\0') at ../../gcc/gimplify.c:3162 #5 0x0811f6e4 in gimplify_expr (expr_p=0xbffbf210, pre_p=0xbffbef34, post_p=0xbffbef30, gimple_test_f=0x810aee9 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4044 #6 0x0811f1d5 in gimplify_stmt (stmt_p=0xbffbf210) at ../../gcc/gimplify.c:3872 #7 0x0810c15e in gimplify_and_add (t=0xb7cd0318, list_p=0xbffbfb34) at ../../gcc/gimplify.c:263 #8 0x0810cf51 in internal_get_tmp_var (val=0xb7d41030, pre_p=0xbffbfb34, post_p=0xbffbf6e0, is_formal=0 '\0') at ../../gcc/gimplify.c:503 #9 0x0810d044 in get_initialized_tmp_var (val=0xb7d41030, pre_p=0xbffbfb34, post_p=0xbffbf6e0) at ../../gcc/gimplify.c:525 #10 0x08122169 in gimplify_expr (expr_p=0xb7cce75c, pre_p=0xbffbfb34, post_p=0xbffbf6e0, gimple_test_f=0x810ae33 <is_gimple_addressable>, fallback=fb_either) at ../../gcc/gimplify.c:4512 #11 0x0811d61b in gimplify_addr_expr (expr_p=0xb7d411c4, pre_p=0xbffbfb34, post_p=0xbffbf6e0) at ../../gcc/gimplify.c:3476 #12 0x0811f9f4 in gimplify_expr (expr_p=0xb7d411c4, pre_p=0xbffbfb34, post_p=0xbffbf6e0, gimple_test_f=0x810b505 <is_gimple_val>, fallback=fb_rvalue) at ../../gcc/gimplify.c:4062 #13 0x081148a7 in gimplify_arg (expr_p=0xb7d411c4, pre_p=0xbffbfb34) at ../../gcc/gimplify.c:1741 #14 0x0811508f in gimplify_call_expr (expr_p=0xb7d3d4a0, pre_p=0xbffbfb34, want_value=0 '\0') at ../../gcc/gimplify.c:1824 #15 0x0811f63f in gimplify_expr (expr_p=0xb7d3d4a0, pre_p=0xbffbfb34, post_p=0xbffbfb30, gimple_test_f=0x810aee9 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4023 #16 0x0811f1d5 in gimplify_stmt (stmt_p=0xb7d3d4a0) at ../../gcc/gimplify.c:3872 #17 0x0811cbdb in gimplify_statement_list (expr_p=0xb7d33ed8) at ../../gcc/gimplify.c:3338 #18 0x08120f95 in gimplify_expr (expr_p=0xb7d33ed8, pre_p=0xbffbfe94, post_p=0xbffbfe90, gimple_test_f=0x810aee9 <is_gimple_stmt>, fallback=fb_none) at ../../gcc/gimplify.c:4282 #19 0x0811f1d5 in gimplify_stmt (stmt_p=0xb7d33ed8) at ../../gcc/gimplify.c:3872 #20 0x08123010 in gimplify_body (body_p=0xb7d33ed8, fndecl=0xb7d33e80, do_parms=1 '\001') at ../../gcc/gimplify.c:4753 #21 0x08123602 in gimplify_function_tree (fndecl=0xb7d33e80) at ../../gcc/gimplify.c:4828 #22 0x0857f0e4 in cgraph_build_static_cdtor (which=73 'I', body=0xb7d41240, priority=99) at ../../gcc/cgraphunit.c:1343 #23 0x080d64bb in mudflap_finish_file () at ../../gcc/tree-mudflap.c:1285 #24 0x084d1820 in compile_file () at ../../gcc/toplev.c:995 #25 0x084d2f1f in do_compile () at ../../gcc/toplev.c:1914 #26 0x084d2f87 in toplev_main (argc=16, argv=0xbffc0454) at ../../gcc/toplev.c:1946 #27 0x080dce54 in main (argc=16, argv=0xbffc0454) at ../../gcc/main.c:35
still ICEs with current mainline.
Also happens with "-fprofile-arcs -fmudflap".
The problem is triggered for the synthetic _gcov_* type global variables that the profiling code emits. mudflap tries to register them with libmudflap.
*** Bug 34617 has been marked as a duplicate of this bug. ***
Apparently, this has been fixed on the trunk, could somebody please add a testcase to the testsuite?
GCC 4.7.0 is being released, adjusting target milestone.
Fixed for 4.7.0.