diff options
author | Javier Miranda <miranda@adacore.com> | 2019-08-14 09:51:07 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-14 09:51:07 +0000 |
commit | d2d56bbae32be728ff82191b6d328e3a8d7c1530 (patch) | |
tree | 5825655425ac3f107c7b034f9c769bb1ce35de09 | |
parent | cc248146c12018675f203f6be6b4d652765f0f76 (diff) | |
download | gcc-d2d56bbae32be728ff82191b6d328e3a8d7c1530.zip gcc-d2d56bbae32be728ff82191b6d328e3a8d7c1530.tar.gz gcc-d2d56bbae32be728ff82191b6d328e3a8d7c1530.tar.bz2 |
[Ada] Fix a recent ACATS regression (c552001)
2019-08-14 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_aggr.adb (Is_CCG_Supported_Aggregate): Return False for
arrays with bounds not known at compile time.
From-SVN: r274450
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_aggr.adb | 33 |
2 files changed, 32 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e7bebe6..72528d3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-08-14 Javier Miranda <miranda@adacore.com> + + * exp_aggr.adb (Is_CCG_Supported_Aggregate): Return False for + arrays with bounds not known at compile time. + 2019-08-14 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 8668188..174da6e 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -7707,15 +7707,36 @@ package body Exp_Aggr is P := Parent (P); end loop; - -- Cases where aggregates are supported by the CCG backend + -- Check cases where aggregates are supported by the CCG backend if Nkind (P) = N_Object_Declaration then - return True; + declare + P_Typ : constant Entity_Id := Etype (Defining_Identifier (P)); - elsif Nkind (P) = N_Qualified_Expression - and then Nkind_In (Parent (P), N_Allocator, N_Object_Declaration) - then - return True; + begin + if Is_Record_Type (P_Typ) then + return True; + else + return Compile_Time_Known_Bounds (P_Typ); + end if; + end; + + elsif Nkind (P) = N_Qualified_Expression then + if Nkind (Parent (P)) = N_Object_Declaration then + declare + P_Typ : constant Entity_Id := + Etype (Defining_Identifier (Parent (P))); + begin + if Is_Record_Type (P_Typ) then + return True; + else + return Compile_Time_Known_Bounds (P_Typ); + end if; + end; + + elsif Nkind (Parent (P)) = N_Allocator then + return True; + end if; end if; return False; |