public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/44246] ICE with -fwhopr/-flto when using strlen and strcat without previous declaration
Date: Fri, 17 Sep 2010 13:26:00 -0000	[thread overview]
Message-ID: <20100917132603.1132.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44246-14164@http.gcc.gnu.org/bugzilla/>



------- 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)
>  <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?

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


  parent reply	other threads:[~2010-09-17 13:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22 21:38 [Bug lto/44246] New: " zsojka at seznam dot cz
2010-07-22 14:34 ` [Bug lto/44246] " rguenth at gcc dot gnu dot org
2010-09-17 12:19 ` hubicka at gcc dot gnu dot org
2010-09-17 12:48 ` hubicka at ucw dot cz
2010-09-17 13:13 ` hubicka at gcc dot gnu dot org
2010-09-17 13:26 ` rguenther at suse dot de [this message]
2010-09-17 13:31 ` hubicka at ucw dot cz
2010-09-17 13:43 ` rguenther at suse dot de
2010-09-19 21:49 ` hubicka at gcc dot gnu dot org
2010-09-19 21:57 ` hubicka at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100917132603.1132.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).