From patchwork Fri Jan 27 09:47:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 138205 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 547A4B6F65 for ; Fri, 27 Jan 2012 20:51:11 +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=1328262672; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:References:In-Reply-To: MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=cMMcFREHLtJJw755B/00sUsgjIQ=; b=U6YxoD6Qgw0laWh b+JdwE//SfS/YFhFeDF6/+7DdXjy9wrDlvR2PKsAXeGi8Tn6ehUeAsCujc/1oSWa ps1HAijho0/0l98hypGF8Gwvjs3E1w2l3rVby6Eyhwn1aSQZfqrsoB5eI83YBl2z Zm8hrV16hXA/++2zCa9u/lHB1hJk= 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:User-Agent:References:In-Reply-To:MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=uZfZn1lUC8iHNVtOdLNgVvKMMPKes5AcjlJYkPIt3z4ELvXpsAQcSXnxJTke6f wZqFrcV35uzhITwVZxXKyuQpGdkg+YN63Ge5Iodik0Dg5bGGexmcPCL+sVn14Oxf 4dSCU3lXrm/BqMjmuANYcrpoq0zWyG1/CSg/RBMvRek18=; Received: (qmail 10545 invoked by alias); 27 Jan 2012 09:51:07 -0000 Received: (qmail 10533 invoked by uid 22791); 27 Jan 2012 09:51:06 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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; Fri, 27 Jan 2012 09:50:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id DCB5C29005E for ; Fri, 27 Jan 2012 10:50:51 +0100 (CET) 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 s1ns1Btu5ts9 for ; Fri, 27 Jan 2012 10:50:51 +0100 (CET) Received: from [192.168.1.2] (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 8B95029006B for ; Fri, 27 Jan 2012 10:50:51 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: [Ada] improve layout of RETURN type made for CICO mechanism Date: Fri, 27 Jan 2012 10:47:51 +0100 User-Agent: KMail/1.9.9 References: <201104082230.27123.ebotcazou@adacore.com> In-Reply-To: <201104082230.27123.ebotcazou@adacore.com> MIME-Version: 1.0 Message-Id: <201201271047.51497.ebotcazou@adacore.com> 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 > 2011-04-08 Eric Botcazou > > * gcc-interface/decl.c (gnat_to_gnu_entity) : Set minimum > alignment on fields of the RETURN type built for the Copy-In Copy-Out > mechanism. This can be counter-productive, as the RETURN type is bigger and might not fit in registers anymore. This is visible on both x86-64 and PowerPC. Tested on i586-suse-linux, applied on the mainline. 2012-01-27 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity) : Do not set an alignment on fields of the RETURN type built for the CICO mechanism. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 183609) +++ gcc-interface/decl.c (working copy) @@ -4305,7 +4305,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entit gnu_return_type = gnu_new_ret_type; TYPE_NAME (gnu_return_type) = get_identifier ("RETURN"); - /* Set a default alignment to speed up accesses. */ + /* Set a default alignment to speed up accesses. But we + shouldn't increase the size of the structure too much, + lest it doesn't fit in return registers anymore. */ TYPE_ALIGN (gnu_return_type) = get_mode_alignment (ptr_mode); } @@ -4314,9 +4316,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entit = create_field_decl (gnu_param_name, gnu_param_type, gnu_return_type, NULL_TREE, NULL_TREE, 0, 0); - /* Set a minimum alignment to speed up accesses. */ - if (DECL_ALIGN (gnu_field) < TYPE_ALIGN (gnu_return_type)) - DECL_ALIGN (gnu_field) = TYPE_ALIGN (gnu_return_type); Sloc_to_locus (Sloc (gnat_param), &DECL_SOURCE_LOCATION (gnu_field)); DECL_CHAIN (gnu_field) = gnu_field_list;