This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/44246] ICE with -fwhopr/-flto when using strlen and strcat without previous declaration



------- Comment #4 from hubicka at gcc dot gnu dot org  2010-09-17 13:13 -------
OK, the problem is that we stream two cgraph nodes.  One for strlen function
and other for __bulitin_strlen.  Decl of __bulitin_strlen have same asm name as
strlen:
(gdb) p debug_tree (node->decl)
 <function_decl 0x7ffff7f40000 strlen
    type <function_type 0x7ffff7f3db28
        type <integer_type 0x7ffff7ed0690 long unsigned int public unsigned DI
            size <integer_cst 0x7ffff7ebc7d0 constant 64>
            unit size <integer_cst 0x7ffff7ebc7f8 constant 8>
            align 64 symtab 0 alias set 4 canonical type 0x7ffff7ed0690
precision 64 min <integer_cst 0x7ffff7ebc820 0> max <integer_cst 0x7ffff7ebc7a8
18446744073709551615>>
        QI
        size <integer_cst 0x7ffff7ebc4d8 constant 8>
        unit size <integer_cst 0x7ffff7ebc500 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7ffff7ee8888
        attributes <tree_list 0x7ffff7f3ac58
            purpose <identifier_node 0x7ffff7ecfc30 nonnull>>
        arg-types <tree_list 0x7ffff7ee6640 value <pointer_type 0x7ffff7ee3dc8>
            chain <tree_list 0x7ffff7ebceb0 value <void_type 0x7ffff7ed0e70
void>>>
        pointer_to_this <pointer_type 0x7ffff5aebb28>>
    addressable used nothrow public external built-in decl_2 decl_5 decl_6 QI
file <built-in> line 0 col 0
    align 8 built-in BUILT_IN_NORMAL:BUILT_IN_STRLEN attributes <tree_list
0x7ffff7f3acf8> chain <function_decl 0x7ffff7f40100 __builtin_strncasecmp>>
$6 = void
(gdb) c
Continuing.

Breakpoint 1, lto_output_node (set=0x7ffff7f98c00, vset=0x7ffff7f98c20) at
../../gcc/lto-cgraph.c:416
416       boundary_p = !cgraph_node_in_set_p (node, set);
(gdb) c
Continuing.

Breakpoint 1, lto_output_node (set=0x7ffff7f98c00, vset=0x7ffff7f98c20) at
../../gcc/lto-cgraph.c:416
416       boundary_p = !cgraph_node_in_set_p (node, set);
(gdb) p debug_tree (node->decl)
 <function_decl 0x7ffff7f3ef00 __builtin_strlen
    type <function_type 0x7ffff7f3db28
        type <integer_type 0x7ffff7ed0690 long unsigned int public unsigned DI
            size <integer_cst 0x7ffff7ebc7d0 constant 64>
            unit size <integer_cst 0x7ffff7ebc7f8 constant 8>
            align 64 symtab 0 alias set 4 canonical type 0x7ffff7ed0690
precision 64 min <integer_cst 0x7ffff7ebc820 0> max <integer_cst 0x7ffff7ebc7a8
18446744073709551615>>
        QI
        size <integer_cst 0x7ffff7ebc4d8 constant 8>
        unit size <integer_cst 0x7ffff7ebc500 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7ffff7ee8888
        attributes <tree_list 0x7ffff7f3ac58
            purpose <identifier_node 0x7ffff7ecfc30 nonnull>>
        arg-types <tree_list 0x7ffff7ee6640 value <pointer_type 0x7ffff7ee3dc8>
            chain <tree_list 0x7ffff7ebceb0 value <void_type 0x7ffff7ed0e70
void>>>
        pointer_to_this <pointer_type 0x7ffff5aebb28>>
    nothrow public external built-in decl_6 QI file <built-in> line 0 col 0
    align 8 built-in BUILT_IN_NORMAL:BUILT_IN_STRLEN attributes <tree_list
0x7ffff7f3ac80> chain <function_decl 0x7ffff7f40000 strlen>>

and when reading back those two decls identify into single and thus also the
cgraph nodes.

Richi: is that intended behaviour?


-- 

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenther at suse dot de


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]