From patchwork Thu Aug 4 11:57:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 108418 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 EE1D7B6F64 for ; Thu, 4 Aug 2011 21:58:10 +1000 (EST) Received: (qmail 14972 invoked by alias); 4 Aug 2011 11:58:08 -0000 Received: (qmail 14957 invoked by uid 22791); 4 Aug 2011 11:58:06 -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; Thu, 04 Aug 2011 11:57:50 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3ABBB2BAF03; Thu, 4 Aug 2011 07:57:49 -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 qJLD0ur+KZsl; Thu, 4 Aug 2011 07:57:49 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 269E42BAED5; Thu, 4 Aug 2011 07:57:49 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 170573FEE8; Thu, 4 Aug 2011 07:57:49 -0400 (EDT) Date: Thu, 4 Aug 2011 07:57:49 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [Ada] Save/restore value of pragma Normalize_Scalars Message-ID: <20110804115748.GA22766@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 adds the missing support to the frontend to save and restore consistently the settings of pragma Normalize_Scalars. Required to have consistent setting of its value when the compilation of a unit causes implicit analysis of runtime units. Before applying this patch the compilation of the following small test caused an assertion failure in the frontend. with Ada.Text_IO; package ImpDef is end; pragma Normalize_Scalars; with Impdef; package CXH1001_0 is end; Command: gcc -c cxh1001_0.ads Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Javier Miranda * opt.ads (Normalize_Scalars_Config): Value of the configuration switch set by pragma Normalize_Scalars when it appears in the gnat.adc file. (Normalize_Scalars): New field for record Config_Switches_Type. Used to save and restore settings of this pragma. * opt.adb (Register_Opt_Config_Switches, Save_Opt_Config_Switches, Restore_Opt_Config_Switches): Add missing support for Normalize_Scalars. Index: opt.adb =================================================================== --- opt.adb (revision 177274) +++ opt.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- -- @@ -59,6 +59,7 @@ Fast_Math_Config := Fast_Math; Init_Or_Norm_Scalars_Config := Init_Or_Norm_Scalars; Initialize_Scalars_Config := Initialize_Scalars; + Normalize_Scalars_Config := Normalize_Scalars; Optimize_Alignment_Config := Optimize_Alignment; Persistent_BSS_Mode_Config := Persistent_BSS_Mode; Polling_Required_Config := Polling_Required; @@ -93,6 +94,7 @@ Fast_Math := Save.Fast_Math; Init_Or_Norm_Scalars := Save.Init_Or_Norm_Scalars; Initialize_Scalars := Save.Initialize_Scalars; + Normalize_Scalars := Save.Normalize_Scalars; Optimize_Alignment := Save.Optimize_Alignment; Optimize_Alignment_Local := Save.Optimize_Alignment_Local; Persistent_BSS_Mode := Save.Persistent_BSS_Mode; @@ -122,6 +124,7 @@ Save.Fast_Math := Fast_Math; Save.Init_Or_Norm_Scalars := Init_Or_Norm_Scalars; Save.Initialize_Scalars := Initialize_Scalars; + Save.Normalize_Scalars := Normalize_Scalars; Save.Optimize_Alignment := Optimize_Alignment; Save.Optimize_Alignment_Local := Optimize_Alignment_Local; Save.Persistent_BSS_Mode := Persistent_BSS_Mode; @@ -189,6 +192,7 @@ Fast_Math := Fast_Math_Config; Init_Or_Norm_Scalars := Init_Or_Norm_Scalars_Config; Initialize_Scalars := Initialize_Scalars_Config; + Normalize_Scalars := Normalize_Scalars_Config; Optimize_Alignment := Optimize_Alignment_Config; Optimize_Alignment_Local := False; Persistent_BSS_Mode := Persistent_BSS_Mode_Config; Index: opt.ads =================================================================== --- opt.ads (revision 177356) +++ opt.ads (working copy) @@ -1730,6 +1730,13 @@ -- This switch is not set when the pragma appears ahead of a given -- unit, so it does not affect the compilation of other units. + Normalize_Scalars_Config : Boolean; + -- GNAT + -- This is the value of the configuration switch that is set by the + -- pragma Normalize_Scalars when it appears in the gnat.adc file. + -- This switch is not set when the pragma appears ahead of a given + -- unit, so it does not affect the compilation of other units. + Optimize_Alignment_Config : Character; -- GNAT -- This is the value of the configuration switch that controls the @@ -1911,6 +1918,7 @@ Fast_Math : Boolean; Init_Or_Norm_Scalars : Boolean; Initialize_Scalars : Boolean; + Normalize_Scalars : Boolean; Optimize_Alignment : Character; Optimize_Alignment_Local : Boolean; Persistent_BSS_Mode : Boolean;