From patchwork Mon Nov 21 11:59:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 126768 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 4E18BB7205 for ; Mon, 21 Nov 2011 23:00:16 +1100 (EST) Received: (qmail 19957 invoked by alias); 21 Nov 2011 12:00:09 -0000 Received: (qmail 19843 invoked by uid 22791); 21 Nov 2011 12:00:07 -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; Mon, 21 Nov 2011 11:59:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id BF6512BAFDE; Mon, 21 Nov 2011 06:59:51 -0500 (EST) 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 lnw0kratY9Db; Mon, 21 Nov 2011 06:59:51 -0500 (EST) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id ABF962BAFCF; Mon, 21 Nov 2011 06:59:51 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id A30203FEE8; Mon, 21 Nov 2011 06:59:51 -0500 (EST) Date: Mon, 21 Nov 2011 06:59:51 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Do not expand checks in Alfa mode Message-ID: <20111121115951.GA31121@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 In Alfa mode, formal verification backend takes care of checks, hence there is no need for the frontend to insert checks. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-11-21 Yannick Moy * checks.adb (Apply_Access_Check, Apply_Arithmetic_Overflow_Check, Apply_Discriminant_Check, Apply_Divide_Check, Apply_Selected_Length_Checks, Apply_Selected_Range_Checks, Build_Discriminant_Checks, Insert_Range_Checks, Selected_Length_Checks, Selected_Range_Checks): Replace reference to Expander_Active with reference to Full_Expander_Active, so that expansion of checks is not performed in Alfa mode Index: checks.adb =================================================================== --- checks.adb (revision 181556) +++ checks.adb (working copy) @@ -442,7 +442,7 @@ -- are cases (e.g. with pragma Debug) where generating the checks -- can cause real trouble). - if not Expander_Active then + if not Full_Expander_Active then return; end if; @@ -878,7 +878,7 @@ if Backend_Overflow_Checks_On_Target or else not Do_Overflow_Check (N) - or else not Expander_Active + or else not Full_Expander_Active or else (Present (Parent (N)) and then Nkind (Parent (N)) = N_Type_Conversion and then Integer_Promotion_Possible (Parent (N))) @@ -1178,7 +1178,7 @@ -- Nothing to do if discriminant checks are suppressed or else no code -- is to be generated - if not Expander_Active + if not Full_Expander_Active or else Discriminant_Checks_Suppressed (T_Typ) then return; @@ -1462,7 +1462,7 @@ -- Don't actually use this value begin - if Expander_Active + if Full_Expander_Active and then not Backend_Divide_Checks_On_Target and then Check_Needed (Right, Division_Check) then @@ -2118,7 +2118,7 @@ (not Length_Checks_Suppressed (Target_Typ)); begin - if not Expander_Active then + if not Full_Expander_Active then return; end if; @@ -2226,7 +2226,7 @@ (not Range_Checks_Suppressed (Target_Typ)); begin - if not Expander_Active or else not Checks_On then + if not Full_Expander_Active or else not Checks_On then return; end if; @@ -5309,7 +5309,7 @@ -- enhanced to check for an always True value in the condition and to -- generate a compilation warning??? - if not Expander_Active or else not Checks_On then + if not Full_Expander_Active or else not Checks_On then return; end if; @@ -6236,7 +6236,7 @@ -- Start of processing for Selected_Length_Checks begin - if not Expander_Active then + if not Full_Expander_Active then return Ret_Result; end if; @@ -6810,7 +6810,7 @@ -- Start of processing for Selected_Range_Checks begin - if not Expander_Active then + if not Full_Expander_Active then return Ret_Result; end if;