From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1669 invoked by alias); 17 Sep 2010 13:26:21 -0000 Received: (qmail 1134 invoked by alias); 17 Sep 2010 13:26:03 -0000 Date: Fri, 17 Sep 2010 13:26:00 -0000 Message-ID: <20100917132603.1132.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug lto/44246] ICE with -fwhopr/-flto when using strlen and strcat without previous declaration In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg01949.txt.bz2 ------- Comment #5 from rguenther at suse dot de 2010-09-17 13:26 ------- Subject: Re: ICE with -fwhopr/-flto when using strlen and strcat without previous declaration On Fri, 17 Sep 2010, hubicka at gcc dot gnu dot org wrote: > > > ------- 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) > type type size > unit size > align 64 symtab 0 alias set 4 canonical type 0x7ffff7ed0690 > precision 64 min max 18446744073709551615>> > QI > size > unit size > align 8 symtab 0 alias set -1 canonical type 0x7ffff7ee8888 > attributes purpose > > arg-types > chain void>>> > pointer_to_this > > addressable used nothrow public external built-in decl_2 decl_5 decl_6 QI > file line 0 col 0 > align 8 built-in BUILT_IN_NORMAL:BUILT_IN_STRLEN attributes 0x7ffff7f3acf8> chain > > $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) > type type size > unit size > align 64 symtab 0 alias set 4 canonical type 0x7ffff7ed0690 > precision 64 min max 18446744073709551615>> > QI > size > unit size > align 8 symtab 0 alias set -1 canonical type 0x7ffff7ee8888 > attributes purpose > > arg-types > chain void>>> > pointer_to_this > > nothrow public external built-in decl_6 QI file line 0 col 0 > align 8 built-in BUILT_IN_NORMAL:BUILT_IN_STRLEN attributes 0x7ffff7f3ac80> chain > > > and when reading back those two decls identify into single and thus also the > cgraph nodes. > > Richi: is that intended behaviour? No, we shouldn't stream them at all. Why do we even bother? And yes, same cgraph node is intended (one is an alias for the other). Maybe that's what we get "wrong" even in non-LTO mode? Do we have two different cgraph nodes for strlen vs. __builtin_strlen? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44246