public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] [Ada] Skip unnecessary iterations over constraint expressions
@ 2020-08-22 22:25 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 22:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:047a918d5fbd636aaae21da466da04f1d7df236a

commit 047a918d5fbd636aaae21da466da04f1d7df236a
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Mar 13 21:07:56 2020 +0100

    [Ada] Skip unnecessary iterations over constraint expressions
    
    2020-06-11  Piotr Trojanek  <trojanek@adacore.com>
    
    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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 22:25 [gcc/devel/autopar_devel] [Ada] Skip unnecessary iterations over constraint expressions Giuliano Belinassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).