diff options
Diffstat (limited to 'gcc/ada')
| -rw-r--r-- | gcc/ada/ChangeLog | 126 | ||||
| -rw-r--r-- | gcc/ada/sem_ch12.adb | 4 | ||||
| -rw-r--r-- | gcc/ada/sem_ch8.adb | 115 | 
3 files changed, 177 insertions, 68 deletions
| diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bd1e2ae..fc58e04 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,129 @@ +2025-10-28  Eric Botcazou  <ebotcazou@adacore.com> + +	PR ada/48039 +	* sem_ch12.adb (Analyze_Subprogram_Instantiation): Call +	Remove_Homonym to remove the enclosing package from visibility. + +2025-10-28  Eric Botcazou  <ebotcazou@adacore.com> + +	* exp_util.adb (Remove_Side_Effects): Use separately the Etype of +	the expression to build new nodes and its Underlying_Type to drive +	part of the processing. + +2025-10-28  Johannes Kliemann  <kliemann@adacore.com> + +	* adaint.c: Remove __gnat_enable_signals, __gnat_disable_signals +	and related code for QNX. +	* libgnarl/s-taprop__qnx.adb: Disable and enable +	signals in Ada. + +2025-10-28  Alexandre Oliva  <oliva@adacore.com> + +	* sem_ch13.adb (Analyze_Aspect_Export_Import): Skip +	Set_Is_Imported on E_Exception. +	* sem_prag.adb (Process_Import_Or_Interface): Explain +	why not Set_Is_Imported. + +2025-10-28  Denis Mazzucato  <mazzucato@adacore.com> + +	* sem_util.adb (Collect_Primitive_Operations): Avoid setting +	Is_Primitive for noninherited and nonoverriding subprograms not +	declared immediately within a package specification. +	* sem_ch13.adb (Check_Nonoverridable_Aspect_Subprograms): Better +	error posting to allow multiple errors on same type but different +	aggregate subprogram. + +2025-10-28  Ronan Desplanques  <desplanques@adacore.com> + +	* table.ads (Clear, Is_Empty): New subprograms. +	* table.adb (Clear, Is_Empty): Likewise. +	(Init): Use new subprogram. +	* atree.adb (Traverse_Func_With_Parent): Use new subprograms. +	* fmap.adb (Empty_Tables): Use new subprogram. +	* par_sco.adb (Process_Pending_Decisions): Likewise. +	* sem_elab.adb (Check_Elab_Call): Likewise. +	* sem_ch12.adb (Build_Local_Package, Analyze_Package_Instantiation, +	Analyze_Subprogram_Instantiation): Likewise. +	(Save_And_Reset): Use Table.Table.First. + +2025-10-28  Eric Botcazou  <ebotcazou@adacore.com> + +	PR ada/122063 +	* exp_fixd.adb (Build_Double_Divide_Code): Convert the result of the +	multiply. +	(Build_Multiply): Use base types of operands to size the operation. +	(Build_Rem): Likewise. +	(Build_Scaled_Divide_Code): Convert the result of the multiply. + +2025-10-28  Tonu Naks  <naks@adacore.com> + +	* doc/gnat_rm/obsolescent_features.rst: typo +	* gnat_rm.texi: Regenerate. + +2025-10-28  Javier Miranda  <miranda@adacore.com> + +	* aspects.adb (Get_Aspect_Id): Enable aspect Unsigned_Base_Range +	using -gnatd.u +	* debug.adb (Debug_Flag_Dot_U): Document this switch. +	* einfo-utils.adb (Is_Modular_Integer_Type): Return True if +	the entity is a modular integer type and its base type does +	not have the attribute has_unsigned_base_range_aspect. +	(Is_Signed_Integer_Type): Return True if the entity is a signed +	integer type, or it is a modular integer type and its base type +	has the attribute has_unsigned_base_range_aspect. +	* einfo.ads (E_Modular_Integer_Type): Add documentation of +	Has_Unsigned_Base_Range_Aspect. +	* par-ch4.adb (Scan_Apostrophe): Enable attribute Unsigned_Base_Range +	using -gnatd.u +	* sem_ch13.adb (Analyze_One_Aspect): Check general language +	restrictions on aspect Unsigned_Base_Range. For Unsigned_Base_Range +	aspect, do not delay the generation of the pragma becase we need +	to process it before any type or subtype derivation is analyzed. +	* sem_ch3.adb (Build_Scalar_Bound): Disable code analyzing the +	bound with the base type of the parent type because, for unsigned +	base range types, their base type is a modular type but their +	type is a signed integer type. +	* sem_prag.adb (Analyze_Pragma): Enable pragma Unsigned_Base_Range +	using -gnatd.u. Check more errors on Unsigned_Base_Range pragma, +	and create the new base type only when required. + +2025-10-28  Ronan Desplanques  <desplanques@adacore.com> + +	* sem_ch12.adb (Build_Local_Package) +	(Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): +	Fix Set_Last calls. +	(Set_Instance_Of): Use Table.Table.Append. +	(Save_And_Reset): Remove useless call. Remove defensive code. +	(Restore): Remove incorrect Set_Last call and adapt to +	Set_Instance_Of change. + +2025-10-28  Denis Mazzucato  <mazzucato@adacore.com> + +	* sem_prag.adb (Analyze_Pragma): Add enclosing quotation when the +	invalid switch ends with a space. + +2025-10-28  Eric Botcazou  <ebotcazou@adacore.com> + +	PR ada/59234 +	* sem_ch12.adb (Analyze_Formal_Package_Declaration): Mark the +	special name built for the formal in the parent of a child unit +	as internal. + +2025-10-28  Eric Botcazou  <ebotcazou@adacore.com> + +	PR ada/34511 +	* sem_ch12.adb (Analyze_Associations): Add Parent_Installed formal +	parameter and pass it in call to Analyze_One_Association. +	(Analyze_One_Association): Add Parent_Installed formal parameter +	and pass it in call to Instantiate_Formal_Subprogram. +	(Analyze_Formal_Package_Declaration): Pass Parent_Installed in call +	to Analyze_Associations. +	(Analyze_Package_Instantiation): Likewise. +	(Analyze_Subprogram_Instantiation): Likewise. +	(Instantiate_Formal_Subprogram): Add Parent_Installed formal +	parameter and prune references to the parent unit(s) only if +	it is true. +  2025-10-27  Eric Botcazou  <ebotcazou@adacore.com>  	PR ada/29958 diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index b5c276a..deb19ee 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6735,7 +6735,7 @@ package body Sem_Ch12 is              --  Remove package itself from visibility, so it does not              --  conflict with subprogram. -            Set_Name_Entity_Id (Chars (Pack_Id), Homonym (Pack_Id)); +            Remove_Homonym (Pack_Id);              --  Set name and scope of internal subprogram so that the proper              --  external name will be generated. The proper scope is the scope @@ -13223,7 +13223,7 @@ package body Sem_Ch12 is                 --  to capture local names that may be hidden if the generic is                 --  a child unit. -               if Nkind (Actual) = N_Aggregate then +               if Nkind (Unqualify (Actual)) = N_Aggregate then                    Preanalyze_And_Resolve (Actual, Typ);                 end if; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 86344b5..e9d00d0 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -7225,6 +7225,8 @@ package body Sem_Ch8 is        begin           while Present (Id) loop +            --  The immediate case is when Id is an entity of the prefix +              if Scope (Id) = P_Name then                 Candidate        := Id;                 Is_New_Candidate := True; @@ -7250,6 +7252,53 @@ package body Sem_Ch8 is                    end if;                 end if; +            --  If the name of a generic child unit appears within an instance +            --  of itself, then it is resolved to the renaming of the name of +            --  the instance built in Sem_Ch12, so we get to the generic parent +            --  through the renaming. + +            elsif Ekind (Id) in E_Function | E_Package | E_Procedure +              and then Present (Renamed_Entity (Id)) +              and then Is_Generic_Instance (Renamed_Entity (Id)) +              and then In_Open_Scopes (Renamed_Entity (Id)) +            then +               declare +                  Gen_Inst : constant Entity_Id := Renamed_Entity (Id); +                  Gen_Par  : constant Entity_Id := +                    Generic_Parent +                      (Specification (Unit_Declaration_Node (Gen_Inst))); + +               begin +                  --  The easy case is when Gen_Par is an entity of the prefix + +                  if Scope (Gen_Par) = P_Name then +                     Is_New_Candidate := True; + +                  --  Now the prefix may also be within an instance of itself, +                  --  but we do not need to go through the renaming for it, as +                  --  this was done on entry to the procedure. + +                  elsif Is_Generic_Instance (P_Name) +                    and then In_Open_Scopes (P_Name) +                  then +                     declare +                        Gen_Par_P : constant Entity_Id := +                          Generic_Parent +                            (Specification (Unit_Declaration_Node (P_Name))); + +                     begin +                        if Scope (Gen_Par) = Gen_Par_P then +                           Is_New_Candidate := True; +                        else +                           Is_New_Candidate := False; +                        end if; +                     end; + +                  else +                     Is_New_Candidate := False; +                  end if; +               end; +              --  Ada 2005 (AI-217): Handle shadow entities associated with              --  types declared in limited-withed nested packages. We don't need              --  to handle E_Incomplete_Subtype entities because the entities @@ -7284,22 +7333,6 @@ package body Sem_Ch8 is                 Candidate        := Get_Full_View (Id);                 Is_New_Candidate := True; -            --  An unusual case arises with a fully qualified name for an -            --  entity local to a generic child unit package, within an -            --  instantiation of that package. The name of the unit now -            --  denotes the renaming created within the instance. This is -            --  only relevant in an instance body, see below. - -            elsif Is_Generic_Instance (Scope (Id)) -              and then In_Open_Scopes (Scope (Id)) -              and then In_Instance_Body -              and then Ekind (Scope (Id)) = E_Package -              and then Ekind (Id) = E_Package -              and then Renamed_Entity (Id) = Scope (Id) -              and then Is_Immediately_Visible (P_Name) -            then -               Is_New_Candidate := True; -              else                 Is_New_Candidate := False;              end if; @@ -7434,55 +7467,6 @@ package body Sem_Ch8 is                 end if;              else -               --  Within the instantiation of a child unit, the prefix may -               --  denote the parent instance, but the selector has the name -               --  of the original child. That is to say, when A.B appears -               --  within an instantiation of generic child unit B, the scope -               --  stack includes an instance of A (P_Name) and an instance -               --  of B under some other name. We scan the scope to find this -               --  child instance, which is the desired entity. -               --  Note that the parent may itself be a child instance, if -               --  the reference is of the form A.B.C, in which case A.B has -               --  already been rewritten with the proper entity. - -               if In_Open_Scopes (P_Name) -                 and then Is_Generic_Instance (P_Name) -               then -                  declare -                     Gen_Par : constant Entity_Id := -                                 Generic_Parent (Specification -                                   (Unit_Declaration_Node (P_Name))); -                     S : Entity_Id := Current_Scope; -                     P : Entity_Id; - -                  begin -                     for J in reverse 0 .. Scope_Stack.Last loop -                        S := Scope_Stack.Table (J).Entity; - -                        exit when S = Standard_Standard; - -                        if Ekind (S) in E_Function | E_Package | E_Procedure -                        then -                           P := -                             Generic_Parent (Specification -                               (Unit_Declaration_Node (S))); - -                           --  Check that P is a generic child of the generic -                           --  parent of the prefix. - -                           if Present (P) -                             and then Chars (P) = Chars (Selector) -                             and then Scope (P) = Gen_Par -                           then -                              Id := S; -                              goto Found; -                           end if; -                        end if; - -                     end loop; -                  end; -               end if; -                 --  If this is a selection from Ada, System or Interfaces, then                 --  we assume a missing with for the corresponding package. @@ -7589,7 +7573,6 @@ package body Sem_Ch8 is           end if;        end if; -      <<Found>>        if Comes_From_Source (N)          and then Is_Remote_Access_To_Subprogram_Type (Id)          and then Ekind (Id) = E_Access_Subprogram_Type | 
