From patchwork Mon Oct 22 08:04:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 193104 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 662F42C008C for ; Mon, 22 Oct 2012 19:05:55 +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=1351497956; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=sKncGTinvBd1TX2DEhWkgoso9SA=; b=iipV6duRIQP7RBD I75ngHmgKy/RFt7NeKadQlBta7OzcaoZlEf0fpLpctFFBVKSjMj68y7iGANn0MCR KRUqkn7jbAxrXwhsBq6O0+vgDa7o1P68FTtdq/ijyLIcaUoaYaxhpzUQfbpkcOAX SSH6sdOgsvugqE4E0GG5eGvUdrcU= 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:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=M/GKTOwosmCIOWyB40SB7oqJQTbLtzbaGhs6e4xlwNhJGnIuclNUZXC47vDE0t aoWEHXnPgAIB7/+BKuTzrpZNJKjyOKUYr7pCX7WVVcI7L9Z6wCZPXltEmlgzlzWO UNNA2SPQiPJucSAb0/3YGKEEzF2PAC0cPCOx57PSzO/k8=; Received: (qmail 755 invoked by alias); 22 Oct 2012 08:05:50 -0000 Received: (qmail 650 invoked by uid 22791); 22 Oct 2012 08:05:49 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Oct 2012 08:05:44 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 24538290AF2 for ; Mon, 22 Oct 2012 10:05:43 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qDZPdC0wV29f for ; Mon, 22 Oct 2012 10:05:43 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id E7982290AF0 for ; Mon, 22 Oct 2012 10:05:42 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Do not generate special PARM_DECL in LTO mode Date: Mon, 22 Oct 2012 10:04:06 +0200 Message-ID: <5495945.UYn8P9iJAj@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) 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 We generate a special PARM_DECL for Out parameters passed by copy at -O0, but it doesn't play nice with LTO so this patch removes it when LTO is enabled. Tested on x86_64-suse-linux, applied on the mainline and 4.7 branch. 2012-10-22 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity) : Do not generate the special PARM_DECL for an Out parameter in LTO mode. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 192648) +++ gcc-interface/decl.c (working copy) @@ -1503,7 +1503,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entit the VAR_DECL. Suppress debug info for the latter but make sure it will live on the stack so that it can be accessed from within the debugger through the PARM_DECL. */ - if (kind == E_Out_Parameter && definition && !optimize && debug_info_p) + if (kind == E_Out_Parameter + && definition + && debug_info_p + && !optimize + && !flag_generate_lto) { tree param = create_param_decl (gnu_entity_name, gnu_type, false); gnat_pushdecl (param, gnat_entity);