public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/43467] LTO error "bytecode stream: trying to read 0 bytes after the end of the input buffer"
Date: Sat, 24 Apr 2010 20:23:00 -0000	[thread overview]
Message-ID: <20100424202301.27818.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43467-16926@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-04-24 20:23 -------
With -fipa-cp -flto -fuse-linker-plugin -Wl,--allow-multiple-definition,
but gold does not know --allow-multiple-definition and thus I get

> gcc-4.5 1.c 2.c -fipa-cp -flto -fuse-linker-plugin
/usr/bin/gold: error: /tmp/ccLqKKQ3.o: multiple definition of f
/usr/bin/gold: error: /tmp/ccgya79G.o: previous definition here
lto1: internal compiler error: bytecode stream: trying to read 0 bytes after
the end of the input buffer

which simply means that we do not properly detect gold exiting with an error.

With GNU ld and w/o -fuse-linker-plugin I see

$ ./xgcc -B. 2.c 1.c -fipa-cp -flto -Wl,--allow-multiple-definition
/tmp/ccedC6yL.o: In function `f':
2.c:(.text+0x7): undefined reference to `g'
2.c:(.text+0xf): undefined reference to `h'
collect2: ld returned 1 exit status

which means it "works" and we choose the wrong f() to succeed linking
and thus we never end up invoking lto1 (which is what should happen
in the gold case as well).

Yes, we _do_ invoke the linker before invoking lto1!


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-24 20:23:01
               date|                            |


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


  parent reply	other threads:[~2010-04-24 20:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-21 17:24 [Bug lto/43467] New: " d dot g dot gorbachev at gmail dot com
2010-03-21 17:25 ` [Bug lto/43467] " d dot g dot gorbachev at gmail dot com
2010-04-24 20:23 ` rguenth at gcc dot gnu dot org [this message]
2010-06-03 15:31 ` rguenth at gcc dot gnu dot org
2010-06-03 18:29 ` ccoutant at gcc dot gnu dot org
     [not found] <bug-43467-4@http.gcc.gnu.org/bugzilla/>
2010-11-20 15:55 ` d.g.gorbachev at gmail dot com
2011-01-26 14:47 ` hubicka at gcc dot gnu.org
2011-01-26 18:21 ` d.g.gorbachev at gmail dot com

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=20100424202301.27818.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).