http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50644

--- Comment #17 from Michael Matz <matz at gcc dot gnu.org> 2011-10-31 13:16:49 
UTC ---
Thank you very much!  This really helps and at least reveals something quite
strange with LTO.  It falls over the __func__ member of one of the two
static initializers:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000b757b0 in set_is_used (var=0x7ffff527b320)
    at ../../gcc/gcc/tree-flow-inline.h:562
562       ann->used = true;
(gdb) p debug_generic_expr (var)
__func__
(gdb) up
...
#4  0x0000000000b77d7e in mark_all_vars_used (expr_p=0x7ffff527b2d0,
    data=0x1a823f0) at ../../gcc/gcc/tree-ssa-live.c:595
595       walk_tree (expr_p, mark_all_vars_used_1, data, NULL);
(gdb) p debug_generic_expr (*expr_p)
{.modname="", .function=&__func__, .filename="", .format=151B, .enabled=0}

So it walks the one with 'format=151', i.e. the one from
check_tsc_sync_source.  The strange this is:

(gdb) p debug_generic_expr (current_function_decl)
native_cpu_up

Huh?  These two functions have no relation with each other.  This static
initializer shouldn't be reached while dealing with native_cpu_up.

And indeed (from remove_unused_locals):

(gdb) p debug_tree (var)
<var_decl 0x7ffff527b280 descriptor
  ...
    context <function_decl 0x7ffff539ff00 check_tsc_sync_source>
    initial <constructor 0x7ffff5391738>>

So, we have this local static in the cfun->local_decls list, which is
just wrong.

Reply via email to