From patchwork Mon Feb 27 15:40:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 143213 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 91174B6FA9 for ; Tue, 28 Feb 2012 02:40:50 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1330962051; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=wlJ7/dG gUmFy5M7sXonvNt83GhM=; b=NjPg5OnQ+BoMvKY8yVEs/1e8CksZeC5LBm8eWNP aXKpC5NosKymMo5ZshrqRK3gd1w+SaVYt8CfB7sALubUqL0QCy0zztRiNDtBIIE0 7ZacDNDd18oNNUmTDWHl7cv2IV/3SoP0Z3zCMkBS6Vl/+UMzh5tEOWmhSfge0MmL K79c= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Qu3VPV0+k7vO23Lwz/q/hnJ5aqT4bfK7LCdR0O3Pk1QuYQdioIw4v3bVefl1qc c4nw4Cezm16V9ctVVztfTVdyBrLXztNByFODPSBbgCeFYk3eAE40OWZnefYoIIb3 nGHMCf00rVEquJpoRcVwSXLrMgK8h6IwVpoMvAkyymMHc=; Received: (qmail 4469 invoked by alias); 27 Feb 2012 15:40:43 -0000 Received: (qmail 4460 invoked by uid 22791); 27 Feb 2012 15:40:42 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Feb 2012 15:40:29 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id B69E690CE3 for ; Mon, 27 Feb 2012 16:40:28 +0100 (CET) Date: Mon, 27 Feb 2012 16:40:28 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka Subject: [PATCH] Fix PR52400 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 This fixes PR52400 - we cannot register renamed decl mappings when we can have name duplicates. Which we trivially can have with local fn decls. At least the reverse mapping should no longer be necessary as the alias pair handling has been rewritten to work on the cgraph level. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2012-02-27 Richard Guenther PR lto/52400 * lto.c (lto_register_function_decl_in_symtab): Do not register a reverse renamed decl mapping. * g++.dg/lto/pr52400_0.C: New testcase. Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 184591) +++ gcc/lto/lto.c (working copy) @@ -689,13 +689,6 @@ lto_register_function_decl_in_symtab (st lto_record_renamed_decl (data_in->file_data, IDENTIFIER_POINTER (old_assembler_name), IDENTIFIER_POINTER (new_assembler_name)); - - /* Also register the reverse mapping so that we can find the - new name given to an existing assembler name (used when - restoring alias pairs in input_constructors_or_inits. */ - lto_record_renamed_decl (data_in->file_data, - IDENTIFIER_POINTER (new_assembler_name), - IDENTIFIER_POINTER (old_assembler_name)); } } Index: gcc/testsuite/g++.dg/lto/pr52400_0.C =================================================================== --- gcc/testsuite/g++.dg/lto/pr52400_0.C (revision 0) +++ gcc/testsuite/g++.dg/lto/pr52400_0.C (revision 0) @@ -0,0 +1,18 @@ +// { dg-lto-do run } + +extern "C" { + static int f4(int); + +int f5(int a) { + extern int f4(int); + return f4(a); +} +} + +int f4(int a) { return 4+a; } + +int main(int argc, char *argv[]) +{ + int a = f4(1); + return !(a == 5); +}