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/40721] [LTO] complains about two tentative definitions
Date: Sat, 11 Jul 2009 17:53:00 -0000	[thread overview]
Message-ID: <20090711175315.2400.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40721-10053@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-07-11 17:53 -------
Cases like

t1.c
int i = 2;

t2.c
int i = 1;
int main() { return i; }

are diagnosed by the linker - not ideal, but not different from -fno-lto
either.


Index: lto-symtab.c
===================================================================
--- lto-symtab.c        (revision 149512)
+++ lto-symtab.c        (working copy)
@@ -568,15 +568,17 @@ lto_symtab_merge_decl (tree new_decl,
   if (resolution == LDPR_PREVAILING_DEF
       || resolution == LDPR_PREVAILING_DEF_IRONLY)
     {
-      if (old_resolution == LDPR_PREVAILING_DEF
-         || old_resolution == LDPR_PREVAILING_DEF_IRONLY)
+      if ((old_resolution == LDPR_PREVAILING_DEF
+          || old_resolution == LDPR_PREVAILING_DEF_IRONLY)
+         && old_resolution != resolution)
        {
          error ("%J%qD has already been defined", new_decl, new_decl);
          error ("%Jpreviously defined here", old_decl);
          return;
        }
       gcc_assert (old_resolution == LDPR_PREEMPTED_IR
-                 || old_resolution ==  LDPR_RESOLVED_IR);
+                 || old_resolution ==  LDPR_RESOLVED_IR
+                 || old_resolution == resolution);
       lto_symtab_set_identifier_decl (name, new_decl);
       return;
     }


-- 


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


  reply	other threads:[~2009-07-11 17:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 17:45 [Bug lto/40721] New: " rguenth at gcc dot gnu dot org
2009-07-11 17:53 ` rguenth at gcc dot gnu dot org [this message]
2009-07-11 18:05 ` [Bug lto/40721] " pinskia at gcc dot gnu dot org
2009-07-11 18:10 ` rguenther at suse dot de
2009-07-11 18:19 ` pinskia at gcc dot gnu dot org
2009-07-13  5:27 ` bje at gcc dot gnu dot org
2009-07-13 13:42 ` rguenth at gcc dot gnu dot org
2009-07-13 13:43 ` rguenth 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=20090711175315.2400.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).