Commit d2d56bba by Javier Miranda Committed by Pierre-Marie de Rodat

[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
parent cc248146
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> 2019-08-14 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified * sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified
......
...@@ -7707,15 +7707,36 @@ package body Exp_Aggr is ...@@ -7707,15 +7707,36 @@ package body Exp_Aggr is
P := Parent (P); P := Parent (P);
end loop; 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 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 begin
and then Nkind_In (Parent (P), N_Allocator, N_Object_Declaration) if Is_Record_Type (P_Typ) then
then return True;
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; end if;
return False; return False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment