From patchwork Wed Aug 3 07:46:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 108033 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 6EDBEB71CE for ; Wed, 3 Aug 2011 17:46:39 +1000 (EST) Received: (qmail 22989 invoked by alias); 3 Aug 2011 07:46:36 -0000 Received: (qmail 22975 invoked by uid 22791); 3 Aug 2011 07:46:34 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Aug 2011 07:46:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 642722BB1FA; Wed, 3 Aug 2011 03:46:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oZjC+CEeRnfw; Wed, 3 Aug 2011 03:46:20 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 5224D2BB1C0; Wed, 3 Aug 2011 03:46:20 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 51BD33FEE8; Wed, 3 Aug 2011 03:46:20 -0400 (EDT) Date: Wed, 3 Aug 2011 03:46:20 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [Ada] Disable aggregate expansion in assignments in VM targets Message-ID: <20110803074620.GA9539@adacore.com> 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 This patch does not change the behavior of native compilers. It disables the frontend expansion of aggregates into assignments when the type of the aggregate whose size is not known at compile time. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-03 Javier Miranda * exp_aggr.adb (Expand_Record_Aggregate): In VM targets disable the expansion into assignments of aggregates whose type is not known at compile time. Index: exp_aggr.adb =================================================================== --- exp_aggr.adb (revision 177086) +++ exp_aggr.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -5649,7 +5649,9 @@ -- Gigi doesn't handle properly temporaries of variable size -- so we generate it in the front-end - elsif not Size_Known_At_Compile_Time (Typ) then + elsif not Size_Known_At_Compile_Time (Typ) + and then Tagged_Type_Expansion + then Convert_To_Assignments (N, Typ); -- Temporaries for controlled aggregates need to be attached to a