Bug 20128 - ice with mudflap + profile generate
Summary: ice with mudflap + profile generate
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.7.0
Assignee: Frank Ch. Eigler
URL:
Keywords: ice-on-valid-code, monitored
: 34617 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-21 22:26 UTC by Pawel Sikora
Modified: 2012-07-02 13:50 UTC (History)
3 users (show)

See Also:
Host:
Target: *-linux
Build:
Known to work: 4.7.0
Known to fail: 4.0.0, 4.1.0, 4.2.0, 4.6.1
Last reconfirmed: 2006-09-03 21:39:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2005-02-21 22:26:19 UTC
# 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)
Comment 1 Andrew Pinski 2005-02-21 22:33:12 UTC
Confirmed.
Comment 2 Pawel Sikora 2005-06-24 17:16:47 UTC
also ices with current mainline. 
Comment 3 Pawel Sikora 2005-07-25 17:03:10 UTC
with 4.1.0-20050724 testcase works. 
 
Comment 4 Pawel Sikora 2005-07-25 17:04:20 UTC
(In reply to comment #3) 
> with 4.1.0-20050724 testcase works.  
>   
 
wrrr, please ignore previous comment. case still fails. 
 
Comment 5 Pawel Sikora 2005-07-31 13:31:51 UTC
# 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 
 
Comment 6 Pawel Sikora 2005-09-23 22:03:56 UTC
still ICEs with current mainline. 
 
Comment 7 Volker Reichelt 2006-03-21 23:38:50 UTC
Also happens with "-fprofile-arcs -fmudflap".
Comment 8 Frank Ch. Eigler 2006-04-22 20:10:25 UTC
The problem is triggered for the synthetic  _gcov_* type global variables that the profiling code emits.  mudflap tries to register them with libmudflap.
Comment 9 Volker Reichelt 2011-11-16 19:24:55 UTC
*** Bug 34617 has been marked as a duplicate of this bug. ***
Comment 10 Volker Reichelt 2011-11-16 19:30:31 UTC
Apparently, this has been fixed on the trunk, could somebody please add a testcase to the testsuite?
Comment 11 Richard Biener 2012-03-22 08:26:48 UTC
GCC 4.7.0 is being released, adjusting target milestone.
Comment 12 Richard Biener 2012-07-02 13:50:34 UTC
Fixed for 4.7.0.