From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2100) id D6B5F385701F; Sat, 22 Aug 2020 22:25:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6B5F385701F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598135105; bh=c7zuHM3MOtu8HhXWCuv/71jGaafHWhrqKRBVR2gHwcM=; h=From:To:Subject:Date:From; b=vTfFcyT4hRKOh6k8WDJVn483iKKeZsfrIZn3Ubw/56sdM0ZXuai0FOgx1QzDcx8av lrOkEwnnqlhp8Nt1jrA/SvVc1yMtII08g50+99xA2UOsmuxAOW9AWjrkxRY3zvuTPu +OJRK/WdPRUIYDfPIj5MN0O+pKfMgog1/N9B3ATA= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Giuliano Belinassi To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/autopar_devel] [Ada] Skip unnecessary iterations over constraint expressions X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/devel/autopar_devel X-Git-Oldrev: 32dfb125ddfb3defa60836e6af1211dfd4df8924 X-Git-Newrev: 047a918d5fbd636aaae21da466da04f1d7df236a Message-Id: <20200822222505.D6B5F385701F@sourceware.org> Date: Sat, 22 Aug 2020 22:25:05 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2020 22:25:06 -0000 https://gcc.gnu.org/g:047a918d5fbd636aaae21da466da04f1d7df236a commit 047a918d5fbd636aaae21da466da04f1d7df236a Author: Piotr Trojanek Date: Fri Mar 13 21:07:56 2020 +0100 [Ada] Skip unnecessary iterations over constraint expressions 2020-06-11 Piotr Trojanek gcc/ada/ * sem_ch3.adb (Build_Constrained_Array_Type, Build_Constrained_Discriminated_Type): Skip unnecessary loop iterations. Diff: --- gcc/ada/sem_ch3.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 026bcefdba3..ccb0ea9a2f1 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -13093,7 +13093,7 @@ package body Sem_Ch3 is Scop : Entity_Id; begin - -- if the original access type was not embedded in the enclosing + -- If the original access type was not embedded in the enclosing -- type definition, there is no need to produce a new access -- subtype. In fact every access type with an explicit constraint -- generates an itype whose scope is the enclosing record. @@ -13192,6 +13192,7 @@ package body Sem_Ch3 is Is_Discriminant (Hi_Expr) then Need_To_Create_Itype := True; + exit; end if; Next_Index (Old_Index); @@ -13248,6 +13249,7 @@ package body Sem_Ch3 is if Is_Discriminant (Expr) then Need_To_Create_Itype := True; + exit; -- After expansion of discriminated task types, the value -- of the discriminant may be converted to a run-time type @@ -13259,6 +13261,7 @@ package body Sem_Ch3 is and then Is_Discriminant (Expression (Expr)) then Need_To_Create_Itype := True; + exit; end if; Next_Elmt (Old_Constraint);