From patchwork Sun Jul 11 08:19:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 58512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A6F6EB6F01 for ; Sun, 11 Jul 2010 18:19:33 +1000 (EST) Received: (qmail 4520 invoked by alias); 11 Jul 2010 08:19:32 -0000 Received: (qmail 4511 invoked by uid 22791); 11 Jul 2010 08:19:31 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, TW_SV, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (213.235.205.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Jul 2010 08:19:26 +0000 Received: from basil.firstfloor.org (p5B3C8A87.dip0.t-ipconnect.de [91.60.138.135]) by one.firstfloor.org (Postfix) with ESMTP id 07BC322C806C for ; Sun, 11 Jul 2010 10:19:24 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 76EA3B24FE; Sun, 11 Jul 2010 10:19:23 +0200 (CEST) Date: Sun, 11 Jul 2010 10:19:23 +0200 From: Andi Kleen To: gcc-patches@gcc.gnu.org Subject: [PATCH] better error message for multiple prevailing defs Message-ID: <20100711081923.GA7694@basil.fritz.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I have some trouble with the linker providing multiple prevailing definitions for a single LTO symbol. Right now it's difficult to find out which symbol this even is, can be only done with the debugger. Fix the error message to print out the symbol. I have no svn account, so someone would need to commit it for me. -Andi 2010-07-11 Andi Kleen * lto-symtab.c (lto_symtab_merge_decls_1): Use internal_error instead of gcc_assert to print better error message for multiple prevailing defs. diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index d101449..c907723 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -648,9 +648,13 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED) /* Assert it's the only one. */ if (prevailing) - for (e = prevailing->next; e; e = e->next) - gcc_assert (e->resolution != LDPR_PREVAILING_DEF_IRONLY - && e->resolution != LDPR_PREVAILING_DEF); + for (e = prevailing->next; e; e = e->next) + { + if (e->resolution != LDPR_PREVAILING_DEF_IRONLY + && e->resolution != LDPR_PREVAILING_DEF) + internal_error ("multiple prevailing defs for %qE", + DECL_NAME (prevailing->decl)); + } /* If there's not a prevailing symbol yet it's an external reference. Happens a lot during ltrans. Choose the first symbol with a