[gcc r15-587] ada: Add support for 'Object_Size to pragma Compile_Time_{Warning, Error}
https://gcc.gnu.org/g:d7d49b2d58c709f15d51651119e325d8a56b5950 commit r15-587-gd7d49b2d58c709f15d51651119e325d8a56b5950 Author: Eric Botcazou Date: Fri Mar 1 11:26:32 2024 +0100 ada: Add support for 'Object_Size to pragma Compile_Time_{Warning,Error} With the same level as for 'Size, that is to say, full evaluation of the boolean expressions it may be contained in and handling of private types. gcc/ada/ * sem_attr.adb (Analyze_Attribute) : Remove special processing for pragma Compile_Time_{Warning,Error}. (Eval_Attribute.Compile_Time_Known_Attribute): Set Is_Static on the resulting value if In_Compile_Time_Warning_Or_Error is set. (Eval_Attribute.Full_Type): New helper function. (Eval_Attribute): Call Full_Type for type attributes. Add handling of Object_Size and adjust that of Max_Size_In_Storage_Elements in the non-static case. Diff: --- gcc/ada/sem_attr.adb | 129 ++- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index c78b11bbd170..629033ca5acc 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -6448,49 +6448,6 @@ package body Sem_Attr is Check_Not_CPP_Type; Set_Etype (N, Universal_Integer); - -- If we are processing pragmas Compile_Time_Warning and Compile_ - -- Time_Errors after the back end has been called and this occurrence - -- of 'Size is known at compile time then it is safe to perform this - -- evaluation. Needed to perform the static evaluation of the full - -- boolean expression of these pragmas. Note that Known_RM_Size is - -- sometimes True when Size_Known_At_Compile_Time is False, when the - -- back end has computed it. - - if In_Compile_Time_Warning_Or_Error - and then Is_Entity_Name (P) - and then (Is_Type (Entity (P)) - or else Ekind (Entity (P)) = E_Enumeration_Literal) - and then (Known_RM_Size (Entity (P)) - or else Size_Known_At_Compile_Time (Entity (P))) - then -declare - Prefix_E : Entity_Id := Entity (P); - Siz : Uint; - -begin - -- Handle private and incomplete types - - if Present (Underlying_Type (Prefix_E)) then - Prefix_E := Underlying_Type (Prefix_E); - end if; - - if Known_Static_RM_Size (Prefix_E) then - Siz := RM_Size (Prefix_E); - else - Siz := Esize (Prefix_E); - end if; - - -- Protect the frontend against cases where the attribute - -- Size_Known_At_Compile_Time is set, but the Esize value - -- is not available (see Einfo.ads). - - if Present (Siz) then - Rewrite (N, Make_Integer_Literal (Sloc (N), Siz)); - Analyze (N); - end if; -end; - end if; - --- -- Small -- --- @@ -7867,6 +7824,9 @@ package body Sem_Attr is -- Computes the Fore value for the current attribute prefix, which is -- known to be a static fixed-point type. Used by Fore and Width. + function Full_Type (Typ : Entity_Id) return Entity_Id; + -- Return the Underlying_Type of Typ if it exists, otherwise return Typ + function Mantissa return Uint; -- Returns the Mantissa value for the prefix type @@ -7930,7 +7890,13 @@ package body Sem_Attr is T : constant Entity_Id := Etype (N); begin - Fold_Uint (N, Val, False); + -- If we are processing a pragma Compile_Time_{Warning,Error} after + -- the back end has been called and the value of this attribute is + -- known at compile time, then it is safe to perform its evaluation + -- as static. This is needed to perform the evaluation of the full + -- boolean expression of these pragmas. + + Fold_Uint (N, Val, Static => In_Compile_Time_Warning_Or_Error); -- Check that result is in bounds of the type if it is static @@ -7994,6 +7960,22 @@ package body Sem_Attr is return R; end Fore_Value; + --- + -- Full_Type -- + --- + + function Full_Type (Typ : Entity_Id) return Entity_Id is + Underlying_Typ : constant Entity_Id := Underlying_Type (Typ); + + begin + if Present (Underlying_Typ) then +return Underlying_Typ; + + else +return Typ; + end if; + end Full_Type; + -- -- Mantissa -- -- @@ -8655,25 +8637,40 @@ package body Sem_Attr is -- for a size from an attribute definition clause).
[gcc r15-589] ada: Remove superfluous Relocate_Node calls
https://gcc.gnu.org/g:4db82bfb3a178e861dc9a07596fefcd812da6614 commit r15-589-g4db82bfb3a178e861dc9a07596fefcd812da6614 Author: Ronan Desplanques Date: Fri Mar 1 12:54:58 2024 +0100 ada: Remove superfluous Relocate_Node calls This patch removes two calls to Relocate_Node that were not needed. This does not affect the behavior of the compiler. gcc/ada/ * exp_ch4.adb (Expand_N_Case_Expression): Remove call to Relocate_Node. * sem_attr.adb (Analyze_Attribute): Likewise. Diff: --- gcc/ada/exp_ch4.adb | 2 +- gcc/ada/sem_attr.adb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 448cd5c82b61..42d18f11 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5109,7 +5109,7 @@ package body Exp_Ch4 is else Alt_Expr := Make_Attribute_Reference (Alt_Loc, - Prefix => Relocate_Node (Alt_Expr), + Prefix => Alt_Expr, Attribute_Name => Name_Unrestricted_Access); end if; end if; diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 629033ca5acc..a921909685a7 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3425,7 +3425,7 @@ package body Sem_Attr is -- perform legality checks on the original tree. if Nkind (P) in N_Raise_xxx_Error then - Rewrite (N, Relocate_Node (P)); + Rewrite (N, P); P := Original_Node (P_Old); end if;
[gcc r15-590] ada: Fix checking range constraints within composite types
https://gcc.gnu.org/g:8fc79eac8047edaebc2a4f04cd9c1e11fc2a25c1 commit r15-590-g8fc79eac8047edaebc2a4f04cd9c1e11fc2a25c1 Author: Viljar Indus Date: Fri Mar 1 14:42:48 2024 +0200 ada: Fix checking range constraints within composite types Subtype indications were never analyzed if they were within composite types. Analyze them explicitly within Analyze_Component_Declaration. gcc/ada/ * sem_ch3.adb (Analyze_Component_Declaration): Add Range_Checks for Subtype_Indications Diff: --- gcc/ada/sem_ch3.adb | 50 ++ 1 file changed, 50 insertions(+) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index c3f216c826c8..7ee4ca299d9d 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1965,6 +1965,9 @@ package body Sem_Ch3 is -- a limited type. Used to validate declaration against that of -- enclosing record. + procedure Add_Range_Checks (Subt_Indic : Node_Id); + -- Adds range constraint checks for a subtype indication + -- -- Is_Known_Limited -- -- @@ -1999,6 +2002,50 @@ package body Sem_Ch3 is end if; end Is_Known_Limited; + -- + -- Add_Range_Checks -- + -- + + procedure Add_Range_Checks (Subt_Indic : Node_Id) + is + + begin + if Present (Subt_Indic) and then + Nkind (Subt_Indic) = N_Subtype_Indication and then + Nkind (Constraint (Subt_Indic)) = N_Index_Or_Discriminant_Constraint + then + +declare + Typ : constant Entity_Id := Entity (Subtype_Mark (Subt_Indic)); + Indic_Typ: constant Entity_Id := Underlying_Type (Typ); + Subt_Index : Node_Id; + Target_Index : Node_Id; +begin + + if Present (Indic_Typ) and then Is_Array_Type (Indic_Typ) then + + Target_Index := First_Index (Indic_Typ); + Subt_Index := First (Constraints (Constraint (Subt_Indic))); + + while Present (Target_Index) loop + if Nkind (Subt_Index) in N_Expanded_Name | N_Identifier + and then Nkind +(Scalar_Range (Entity (Subt_Index))) = N_Range + then +Apply_Range_Check + (Expr=> Scalar_Range (Entity (Subt_Index)), +Target_Typ => Etype (Target_Index), +Insert_Node => Subt_Indic); + end if; + + Next (Subt_Index); + Next_Index (Target_Index); + end loop; + end if; +end; + end if; + end Add_Range_Checks; + -- Start of processing for Analyze_Component_Declaration begin @@ -2224,6 +2271,9 @@ package body Sem_Ch3 is Analyze_Aspect_Specifications (N, Id); Analyze_Dimension (N); + + Add_Range_Checks (Subtype_Indication (Component_Definition (N))); + end Analyze_Component_Declaration; --
[gcc r15-591] ada: Check subtype to avoid a precondition failure
https://gcc.gnu.org/g:811bfc3f3e4f6f3e7a98e90409a8a6dbaa1509e1 commit r15-591-g811bfc3f3e4f6f3e7a98e90409a8a6dbaa1509e1 Author: Viljar Indus Date: Tue Mar 5 11:57:12 2024 +0200 ada: Check subtype to avoid a precondition failure gcc/ada/ * sem_ch3.adb (Analyze_Component_Declaration): Apply range checks only for Scalar_Types to ensure that they have the Scalar_Range attribute. Diff: --- gcc/ada/sem_ch3.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 7ee4ca299d9d..263be607ec14 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2029,8 +2029,9 @@ package body Sem_Ch3 is while Present (Target_Index) loop if Nkind (Subt_Index) in N_Expanded_Name | N_Identifier - and then Nkind -(Scalar_Range (Entity (Subt_Index))) = N_Range + and then Is_Scalar_Type (Entity (Subt_Index)) + and then + Nkind (Scalar_Range (Entity (Subt_Index))) = N_Range then Apply_Range_Check (Expr=> Scalar_Range (Entity (Subt_Index)),
[gcc r15-593] ada: Tune detection of unconstrained and tagged items in Depends contract
https://gcc.gnu.org/g:b87148fa43dfa2d8324cac4625a2b41ffda6bac9 commit r15-593-gb87148fa43dfa2d8324cac4625a2b41ffda6bac9 Author: Piotr Trojanek Date: Tue Mar 5 12:57:50 2024 +0100 ada: Tune detection of unconstrained and tagged items in Depends contract The Tagged/Array/Record/Private types are mutually exclusive, so they can be examined like with a case statement (except for records with private extensions, but their handling is not affected by this change). gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Tune repeated testing of type kinds. Diff: --- gcc/ada/sem_prag.adb | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 2fc46ab0cd24..9dc22e3edc17 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -32970,14 +32970,14 @@ package body Sem_Prag is if Is_Tagged_Type (Typ) then return True; - elsif Is_Array_Type (Typ) and then not Is_Constrained (Typ) then - return True; + elsif Is_Array_Type (Typ) then + return not Is_Constrained (Typ); elsif Is_Record_Type (Typ) then return Has_Discriminants (Typ) and then not Is_Constrained (Typ); - elsif Is_Private_Type (Typ) and then Has_Discriminants (Typ) then - return True; + elsif Is_Private_Type (Typ) then + return Has_Discriminants (Typ); else return False;
[gcc r15-596] ada: Only record types with discriminants can be unconstrained
https://gcc.gnu.org/g:376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa commit r15-596-g376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa Author: Piotr Trojanek Date: Tue Mar 5 14:42:08 2024 +0100 ada: Only record types with discriminants can be unconstrained Remove redundant condition for detecting unconstrained record types. Code cleanup; behavior is unaffected. gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Remove call to Has_Discriminants; combine ELSIF branches. Diff: --- gcc/ada/sem_prag.adb | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e57f42d9a54d..02aad4d1caa2 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -32971,13 +32971,10 @@ package body Sem_Prag is if Is_Tagged_Type (Typ) then return True; - elsif Is_Array_Type (Typ) then - return not Is_Constrained (Typ); - - elsif Is_Record_Type (Typ) then - return Has_Discriminants (Typ) and then not Is_Constrained (Typ); - - elsif Is_Private_Type (Typ) then + elsif Is_Array_Type (Typ) +or else Is_Record_Type (Typ) +or else Is_Private_Type (Typ) + then return not Is_Constrained (Typ); else
[gcc r15-597] ada: Fix Constraint_Error on mutable assignment
https://gcc.gnu.org/g:cb71c251d846032cfb31e86c8e4d678c58a90ecc commit r15-597-gcb71c251d846032cfb31e86c8e4d678c58a90ecc Author: Bob Duff Date: Tue Mar 5 18:35:25 2024 -0500 ada: Fix Constraint_Error on mutable assignment For an assignment statement "X := Y;", where X is a formal parameter of a "late overriding" subprogram (i.e. it has no spec, and the body is overriding), and the subtype of X is an unconstrained record with defaulted discriminants, if the actual parameter passed to X is unconstrained, then X is unconstrained. This patch fixes a bug where X was incorrectly considered constrained, so that if Y's discriminants are different from X, Constraint_Error was raised. The bug was caused by the fact that an extra "constrained" formal parameter was missing in both caller and callee. gcc/ada/ * sem_disp.adb (Check_Dispatching_Operation): Call Create_Extra_Formals, so that the caller will have an extra "constrained" parameter, which will be checked on assignment in the callee, and will be passed in by the caller. Diff: --- gcc/ada/sem_disp.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 525a9f7f0a1a..fd521a09bc0f 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1514,10 +1514,10 @@ package body Sem_Disp is Subp); else - -- The subprogram body declares a primitive operation. -- We must update its dispatching information here. The -- information is taken from the overridden subprogram. + -- Such a late-overriding body also needs extra formals. -- We must also generate a cross-reference entry because -- references to other primitives were already created -- when type was frozen. @@ -1527,6 +1527,7 @@ package body Sem_Disp is if Present (DTC_Entity (Old_Subp)) then Set_DTC_Entity (Subp, DTC_Entity (Old_Subp)); Set_DT_Position_Value (Subp, DT_Position (Old_Subp)); +Create_Extra_Formals (Subp); if not Restriction_Active (No_Dispatching_Calls) then if Building_Static_DT (Tagged_Type) then
[gcc r15-598] ada: Fix crash caused by missing New_Copy_tree
https://gcc.gnu.org/g:93035031c5045255c7248576cc5750c1cb3dfd15 commit r15-598-g93035031c5045255c7248576cc5750c1cb3dfd15 Author: Marc Poulhiès Date: Tue Mar 5 15:16:59 2024 +0100 ada: Fix crash caused by missing New_Copy_tree Since a recent refactor ("Factor common processing in expansion of aggregates") where Initialize_Array_Component and Initialize_Record_Component are merged, the behavior has slightly changed. In the case of the expansion of an aggregate initialization where the number of 'others' components is <= 3, the initialization expression is not duplicated anymore, causing some incorrect multiple definition when said expression is later transformed with Expressions_With_Action that declares an object. The simple fix is to add the now missing New_Copy_Tree where the assignments are created. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code) : Copy the initialization expression when unrolling the loop. Diff: --- gcc/ada/exp_aggr.adb | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index cff04fc1b79c..9c5944a917d0 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1649,11 +1649,14 @@ package body Exp_Aggr is and then Local_Expr_Value (H) - Local_Expr_Value (L) <= 2 and then not Is_Iterated_Component then -Append_List_To (S, Gen_Assign (New_Copy_Tree (L), Expr)); -Append_List_To (S, Gen_Assign (Add (1, To => L), Expr)); +Append_List_To + (S, Gen_Assign (New_Copy_Tree (L), New_Copy_Tree (Expr))); +Append_List_To + (S, Gen_Assign (Add (1, To => L), New_Copy_Tree (Expr))); if Local_Expr_Value (H) - Local_Expr_Value (L) = 2 then - Append_List_To (S, Gen_Assign (Add (2, To => L), Expr)); + Append_List_To + (S, Gen_Assign (Add (2, To => L), New_Copy_Tree (Expr))); end if; return S;
[gcc r15-599] ada: Make raise-gcc.c compatible with Clang
https://gcc.gnu.org/g:14aef595f01707c54926788346960b909ebea3b7 commit r15-599-g14aef595f01707c54926788346960b909ebea3b7 Author: Sebastian Poeplau Date: Wed Mar 6 21:10:04 2024 +0100 ada: Make raise-gcc.c compatible with Clang The Morello variant of Clang doesn't have __builtin_code_address_from_pointer; work around it where necessary. gcc/ada/ * raise-gcc.c: Work around __builtin_code_address_from_pointer if it is unavailable. Diff: --- gcc/ada/raise-gcc.c | 8 1 file changed, 8 insertions(+) diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 01cf4b6236d1..7179f62529e1 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -596,7 +596,15 @@ get_ip_from_context (_Unwind_Context *uw_context) #endif #if !defined(__USING_SJLJ_EXCEPTIONS__) && defined(__CHERI__) +#if __has_builtin (__builtin_code_address_from_pointer) ip = __builtin_code_address_from_pointer ((void *)ip); +#elif defined(__aarch64__) + /* Clang doesn't have __builtin_code_address_from_pointer to abstract over + target-specific differences. On AArch64, we need to drop the LSB of the + instruction pointer because it's not part of the address; it indicates the + CPU mode. */ + ip &= ~1UL; +#endif #endif /* Subtract 1 if necessary because GetIPInfo yields a call return address
[gcc r15-601] ada: correction to gnatbind-related cleanups
https://gcc.gnu.org/g:bf935572b076b822033cf1e9d31312c75e4c90d3 commit r15-601-gbf935572b076b822033cf1e9d31312c75e4c90d3 Author: Bob Duff Date: Thu Mar 7 10:55:56 2024 -0500 ada: correction to gnatbind-related cleanups Correction to previous change; Asserts had been moved to before Buf was initialized. gcc/ada/ * uname.adb (Get_Unit_Name_String): Move Asserts after Buf is initialized. Diff: --- gcc/ada/uname.adb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/ada/uname.adb b/gcc/ada/uname.adb index dbb08b88cfdc..5a7dac53b3d4 100644 --- a/gcc/ada/uname.adb +++ b/gcc/ada/uname.adb @@ -404,11 +404,10 @@ package body Uname is Suffix : Boolean := True) is begin - pragma Assert (Buf.Chars (1) /= '"'); - pragma Assert (Is_Body_Name (N) or else Is_Spec_Name (N)); - Buf.Length := 0; Append_Decoded (Buf, N); + pragma Assert (Buf.Chars (1) /= '"'); + pragma Assert (Is_Body_Name (N) or else Is_Spec_Name (N)); -- Buf always ends with "%s" or "%b", which we either remove, or replace -- with " (spec)" or " (body)". Set_Casing of Buf after checking for
[gcc r15-600] ada: gnatbind-related cleanups
https://gcc.gnu.org/g:a0c87f1bb76e8afa22e0b585441dff612b90e88f commit r15-600-ga0c87f1bb76e8afa22e0b585441dff612b90e88f Author: Bob Duff Date: Thu Mar 7 07:43:26 2024 -0500 ada: gnatbind-related cleanups This patch cleans up some things noticed while working on gnatbind. No change in behavior yet. gcc/ada/ * ali-util.adb (Read_Withed_ALIs): Minor reformatting. * bindo-units.adb (Corresponding_Body): Add assert. (Corresponding_Spec): Likewise. * uname.adb: Clean up assertions, use available functions. Get_Spec_Name/Get_Body_Name can assert that N obeys the conventions for Unit_Name_Type (end in "%s" or "%b"). Diff: --- gcc/ada/ali-util.adb| 4 +--- gcc/ada/bindo-units.adb | 8 +-- gcc/ada/uname.adb | 61 + 3 files changed, 28 insertions(+), 45 deletions(-) diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb index fe0af74086cc..61dddb94e852 100644 --- a/gcc/ada/ali-util.adb +++ b/gcc/ada/ali-util.adb @@ -161,9 +161,7 @@ package body ALI.Util is -- Process all dependent units for U in ALIs.Table (Id).First_Unit .. ALIs.Table (Id).Last_Unit loop - for - W in Units.Table (U).First_With .. Units.Table (U).Last_With - loop + for W in Units.Table (U).First_With .. Units.Table (U).Last_With loop Afile := Withs.Table (W).Afile; -- Only process if not a generic (Afile /= No_File) and if diff --git a/gcc/ada/bindo-units.adb b/gcc/ada/bindo-units.adb index 0fbe8e9d3810..0acc6612270d 100644 --- a/gcc/ada/bindo-units.adb +++ b/gcc/ada/bindo-units.adb @@ -103,7 +103,9 @@ package body Bindo.Units is begin pragma Assert (U_Rec.Utype = Is_Spec); - return U_Id - 1; + return Result : constant Unit_Id := U_Id - 1 do + pragma Assert (ALI.Units.Table (Result).Utype = Is_Body); + end return; end Corresponding_Body; @@ -117,7 +119,9 @@ package body Bindo.Units is begin pragma Assert (U_Rec.Utype = Is_Body); - return U_Id + 1; + return Result : constant Unit_Id := U_Id + 1 do + pragma Assert (ALI.Units.Table (Result).Utype = Is_Spec); + end return; end Corresponding_Spec; diff --git a/gcc/ada/uname.adb b/gcc/ada/uname.adb index 085747841733..dbb08b88cfdc 100644 --- a/gcc/ada/uname.adb +++ b/gcc/ada/uname.adb @@ -50,14 +50,8 @@ package body Uname is Buffer : Bounded_String; begin Append (Buffer, N); - - pragma Assert -(Buffer.Length > 2 - and then Buffer.Chars (Buffer.Length - 1) = '%' - and then Buffer.Chars (Buffer.Length) = 's'); - + pragma Assert (Is_Spec_Name (N)); Buffer.Chars (Buffer.Length) := 'b'; - return Name_Find (Buffer); end Get_Body_Name; @@ -160,14 +154,8 @@ package body Uname is Buffer : Bounded_String; begin Append (Buffer, N); - - pragma Assert -(Buffer.Length > 2 - and then Buffer.Chars (Buffer.Length - 1) = '%' - and then Buffer.Chars (Buffer.Length) = 'b'); - + pragma Assert (Is_Body_Name (N)); Buffer.Chars (Buffer.Length) := 's'; - return Name_Find (Buffer); end Get_Spec_Name; @@ -416,6 +404,9 @@ package body Uname is Suffix : Boolean := True) is begin + pragma Assert (Buf.Chars (1) /= '"'); + pragma Assert (Is_Body_Name (N) or else Is_Spec_Name (N)); + Buf.Length := 0; Append_Decoded (Buf, N); @@ -424,17 +415,11 @@ package body Uname is -- (lower case) 's'/'b', and before appending (lower case) "spec" or -- "body". - pragma Assert (Buf.Length >= 3); - pragma Assert (Buf.Chars (1) /= '"'); - pragma Assert (Buf.Chars (Buf.Length) in 's' | 'b'); - declare S : constant String := (if Buf.Chars (Buf.Length) = 's' then " (spec)" else " (body)"); begin - Buf.Length := Buf.Length - 1; -- remove 's' or 'b' - pragma Assert (Buf.Chars (Buf.Length) = '%'); - Buf.Length := Buf.Length - 1; -- remove '%' + Buf.Length := Buf.Length - 2; -- remove "%s" or "%b" Set_Casing (Buf, Identifier_Casing (Source_Index (Main_Unit))); if Suffix then @@ -474,9 +459,9 @@ package body Uname is Buffer : Bounded_String; begin Append (Buffer, N); - return Buffer.Length > 2 -and then Buffer.Chars (Buffer.Length - 1) = '%' -and then Buffer.Chars (Buffer.Length) = 'b'; + pragma Assert +(Buffer.Length > 2 and then Buffer.Chars (Buffer.Length - 1) = '%'); + return Buffer.Chars (Buffer.Length) = 'b'; end Is_Body_Name; --- @@ -535,10 +520,7 @@ package body Uname is System : constant String := "system"; begin - if Name = Ada -or else Name = Inter
[gcc r15-603] ada: Update docs for Resolve_Null_Array_Aggregate
https://gcc.gnu.org/g:a666066298f29bc08379aac75e65d1edb3eb415f commit r15-603-ga666066298f29bc08379aac75e65d1edb3eb415f Author: Ronan Desplanques Date: Thu Mar 7 10:24:49 2024 +0100 ada: Update docs for Resolve_Null_Array_Aggregate The documentation comments for Sem_Aggr.Resolve_Null_Array_Aggregate suggested that this subprogram created a subtype, which it didn't. This patch replaces those comments with ones that better match the behavior. gcc/ada/ * sem_aggr.adb (Resolve_Null_Array_Aggregate): Update documentation comments. Diff: --- gcc/ada/sem_aggr.adb | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 508c86bc5de7..64e7db79ecc9 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -409,11 +409,10 @@ package body Sem_Aggr is -- string as an aggregate, prior to resolution. function Resolve_Null_Array_Aggregate (N : Node_Id) return Boolean; - -- For the Ada 2022 construct, build a subtype with a null range for each - -- dimension, using the bounds from the context subtype (if the subtype - -- is constrained). If the subtype is unconstrained, then the bounds - -- are determined in much the same way as the bounds for a null string - -- literal with no applicable index constraint. + -- The recursive method used to construct an aggregate's bounds in + -- Resolve_Array_Aggregate cannot work for null array aggregates. This + -- function constructs an appropriate list of ranges and stores its first + -- element in Aggregate_Bounds (N). - -- Delta aggregate processing -- @@ -4540,7 +4539,8 @@ package body Sem_Aggr is Set_Parent (Constr, N); - -- Create a constrained subtype with null dimensions + -- Populate the list with null ranges. The relevant RM clauses are + -- RM 4.3.3 (26.1) and RM 4.3.3 (26). Index := First_Index (Typ); while Present (Index) loop
[gcc r15-602] ada: Fix containers' Reference_Preserving_Key functions' memory leaks
https://gcc.gnu.org/g:ecf17346ff112ccf58cd2920a23fa756b068e1bc commit r15-602-gecf17346ff112ccf58cd2920a23fa756b068e1bc Author: Steve Baird Date: Wed Mar 6 14:27:44 2024 -0800 ada: Fix containers' Reference_Preserving_Key functions' memory leaks Fix memory leaks in containers' Reference_Preserving_Key functions Make the same change in each of 3 Ada.Containers child units: Ordered_Sets, Indefinite_Ordered_Sets, and Bounded_Ordered_Sets. The function Reference_Preserving_Key evaluates an allocator of type Key_Access whose storage was not being reclaimed. Update the Finalize procedure for type Reference_Control_Type to free that storage. But this change introduces a possible erroneous double-free situation if an object is copied (because the original and the copy will each be finalized at some point). So also introduce an Adjust procedure which allocates a copy of the allocated object. Another possible solution to this problem (which is not being implemented yet) is based on implementing AI22-0082. Also include a fix for a bug in Sem_Util.Has_Some_Controlled_Component that was discovered while working on this. gcc/ada/ * sem_util.adb (Has_Some_Controlled_Component): Fix a bug which causes (in some cases involving a Disable_Controlled aspect specification) Needs_Finalization to return different answers for one type depending on whether the function is called before or after the type is frozen. * libgnat/a-coorse.ads: Type Control_Reference_Type gets an Adjust procedure. * libgnat/a-cborse.ads: Likewise. * libgnat/a-ciorse.ads: Likewise * libgnat/a-coorse.adb: (Finalize): Reclaim allocated Key_Type object. (Adjust): New procedure; prevent sharing of non-null Key_Access values by allocating a copy. * libgnat/a-cborse.adb: Likewise. * libgnat/a-ciorse.adb: Likewise. Diff: --- gcc/ada/libgnat/a-cborse.adb | 17 + gcc/ada/libgnat/a-cborse.ads | 3 +++ gcc/ada/libgnat/a-ciorse.adb | 16 +++- gcc/ada/libgnat/a-ciorse.ads | 3 +++ gcc/ada/libgnat/a-coorse.adb | 16 +++- gcc/ada/libgnat/a-coorse.ads | 3 +++ gcc/ada/sem_util.adb | 6 +- 7 files changed, 61 insertions(+), 3 deletions(-) diff --git a/gcc/ada/libgnat/a-cborse.adb b/gcc/ada/libgnat/a-cborse.adb index b649c5eb6e79..9d2a02163426 100644 --- a/gcc/ada/libgnat/a-cborse.adb +++ b/gcc/ada/libgnat/a-cborse.adb @@ -40,6 +40,8 @@ with Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations; pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations); +with Ada.Unchecked_Deallocation; + with System; use type System.Address; with System.Put_Images; @@ -775,6 +777,18 @@ is Is_Less_Key_Node=> Is_Less_Key_Node, Is_Greater_Key_Node => Is_Greater_Key_Node); + + -- Adjust -- + + + procedure Adjust (Control : in out Reference_Control_Type) is + begin + Impl.Reference_Control_Type (Control).Adjust; + if Control.Old_Key /= null then +Control.Old_Key := new Key_Type'(Control.Old_Key.all); + end if; + end Adjust; + - -- Ceiling -- - @@ -872,6 +886,8 @@ is -- procedure Finalize (Control : in out Reference_Control_Type) is + procedure Deallocate is + new Ada.Unchecked_Deallocation (Key_Type, Key_Access); begin if Control.Container /= null then Impl.Reference_Control_Type (Control).Finalize; @@ -883,6 +899,7 @@ is end if; Control.Container := null; +Deallocate (Control.Old_Key); end if; end Finalize; diff --git a/gcc/ada/libgnat/a-cborse.ads b/gcc/ada/libgnat/a-cborse.ads index 2366d1adcc28..650f4a40384b 100644 --- a/gcc/ada/libgnat/a-cborse.ads +++ b/gcc/ada/libgnat/a-cborse.ads @@ -324,6 +324,9 @@ is Old_Key : Key_Access; end record; + overriding procedure Adjust (Control : in out Reference_Control_Type); + pragma Inline (Adjust); + overriding procedure Finalize (Control : in out Reference_Control_Type); pragma Inline (Finalize); diff --git a/gcc/ada/libgnat/a-ciorse.adb b/gcc/ada/libgnat/a-ciorse.adb index d90fb882b433..fe91345cdd43 100644 --- a/gcc/ada/libgnat/a-ciorse.adb +++ b/gcc/ada/libgnat/a-ciorse.adb @@ -807,6 +807,18 @@ is Is_Less_Key_Node=> Is_Less_Key_Node, Is_Greater_Key_Node => Is_Greater_Key_Node); + + -- Adjust -- + + + procedure Adjust (Control : in out Reference_Control_Type) is + begin + Impl.Reference_Control_Type (Control).Adjust; + if Control.Old_Key /= null th
[gcc r15-604] ada: gnatbind: subprogram spec no longer exists
https://gcc.gnu.org/g:d2a118197c767ccbd3905c14ff2ebe82bd0fe9ed commit r15-604-gd2a118197c767ccbd3905c14ff2ebe82bd0fe9ed Author: Bob Duff Date: Fri Mar 8 09:32:51 2024 -0500 ada: gnatbind: subprogram spec no longer exists If a subprogram spec S is present while compiling something that says "with S;", but the spec is absent while compiling the body of S, then gnatbind fails to detect the mismatch. The spec and body of S might have different parameter and result types. This patch fixes gnatbind to detect this case and give an error. gcc/ada/ * bcheck.adb (Check_Consistency_Of_Sdep): Split out new procedure. Add check for special case of subprogram spec that no longer exists. (Check_Consistency): Call Check_Consistency_Of_Sdep, except when Reified_Child_Spec is True. No need for "goto Continue" or "exit Sdep_Loop". * ali.ads (Subunit_Name, Unit_Name): Change the type to Unit_Name_Type. Add a comment pointing to the ALI file documentation, because it's in a somewhat-surprising place. * ali.adb (Scan_ALI): Subunit_Name and Unit_Name are now Unit_Name_Type. Remove comment explaining why Name_Find is used; Name_Find is the usual case. Do not remove the "%s" or "%b" from the Unit_Name. We need to be able to distinguish specs and bodies. This is also necessary to obey the invariant of Unit_Name_Type. * binde.adb (Write_Closure): Subunit_Name is now Unit_Name_Type. * clean.adb (Clean_Executables): Likewise. Diff: --- gcc/ada/ali.adb| 9 +-- gcc/ada/ali.ads| 10 +-- gcc/ada/bcheck.adb | 216 - gcc/ada/binde.adb | 2 +- gcc/ada/clean.adb | 2 +- 5 files changed, 141 insertions(+), 98 deletions(-) diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb index 6bf48c04afeb..69a91bce5ab9 100644 --- a/gcc/ada/ali.adb +++ b/gcc/ada/ali.adb @@ -3287,8 +3287,8 @@ package body ALI is -- Acquire (sub)unit and reference file name entries -Sdep.Table (Sdep.Last).Subunit_Name := No_Name; -Sdep.Table (Sdep.Last).Unit_Name:= No_Name; +Sdep.Table (Sdep.Last).Subunit_Name := No_Unit_Name; +Sdep.Table (Sdep.Last).Unit_Name:= No_Unit_Name; Sdep.Table (Sdep.Last).Rfile:= Sdep.Table (Sdep.Last).Sfile; Sdep.Table (Sdep.Last).Start_Line := 1; @@ -3304,16 +3304,13 @@ package body ALI is Add_Char_To_Name_Buffer (Getc); end loop; - -- Set the (sub)unit name. Note that we use Name_Find rather - -- than Name_Enter here as the subunit name may already - -- have been put in the name table by the Project Manager. + -- Set the (sub)unit name. if Name_Len <= 2 or else Name_Buffer (Name_Len - 1) /= '%' then Sdep.Table (Sdep.Last).Subunit_Name := Name_Find; else - Name_Len := Name_Len - 2; Sdep.Table (Sdep.Last).Unit_Name := Name_Find; end if; diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads index 67b8fcd1b803..1f4522686818 100644 --- a/gcc/ada/ali.ads +++ b/gcc/ada/ali.ads @@ -25,7 +25,7 @@ -- This package defines the internal data structures used for representation -- of Ada Library Information (ALI) acquired from the ALI files generated by --- the front end. +-- the front end. The format of the ALI files is documented in Lib.Writ. with Casing; use Casing; with Gnatvsn; use Gnatvsn; @@ -882,11 +882,11 @@ package ALI is -- Set True for dummy entries that correspond to missing files or files -- where no dependency relationship exists. - Subunit_Name : Name_Id; - -- Name_Id for subunit name if present, else No_Name + Subunit_Name : Unit_Name_Type; + -- Subunit name if present, else No_Unit_Name - Unit_Name : Name_Id; - -- Name_Id for the unit name if not a subunit (No_Name for a subunit) + Unit_Name : Unit_Name_Type; + -- Unit name if not a subunit (No_Unit_Name for a subunit) Rfile : File_Name_Type; -- Reference file name. Same as Sfile unless a Source_Reference pragma diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb index dd2ece80d01c..56a417cc5176 100644 --- a/gcc/ada/bcheck.adb +++ b/gcc/ada/bcheck.adb @@ -36,6 +36,7 @@ with Osint; with Output; use Output; with Rident; use Rident; with Types;use Types; +with Uname; package body Bcheck is @@ -68,6 +69,12 @@ package body Bcheck is -- Used to compare two unit names for No_Dependence checks. U1 is in -- standard unit name format, and U2 is in literal form with periods. + procedure Che
[gcc r15-607] ada: Fix others error message location
https://gcc.gnu.org/g:34ac60eb88e489991b420e82b98a039a31df262f commit r15-607-g34ac60eb88e489991b420e82b98a039a31df262f Author: Ronan Desplanques Date: Fri Mar 8 14:42:59 2024 +0100 ada: Fix others error message location Before this patch, the compiler pointed at the wrong component association when reporting an illegal occurrence of "others" in an aggregate. This patch fixes this by keeping track of which choice contains the occurrence of "others" when resolving array aggregates. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Fix location of error message. Diff: --- gcc/ada/sem_aggr.adb | 43 +++ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 64e7db79ecc9..ee9beb04c9ad 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1335,7 +1335,7 @@ package body Sem_Aggr is Index_Base_High : constant Node_Id := Type_High_Bound (Index_Base); -- Ditto for the base type - Others_Present : Boolean := False; + Others_N : Node_Id := Empty; Nb_Choices : Nat := 0; -- Contains the overall number of named choices in this sub-aggregate @@ -1870,7 +1870,7 @@ package body Sem_Aggr is while Present (Choice) loop if Nkind (Choice) = N_Others_Choice then - Others_Present := True; + Others_N := Choice; else Analyze (Choice); @@ -2189,7 +2189,7 @@ package body Sem_Aggr is Delete_Choice := False; while Present (Choice) loop if Nkind (Choice) = N_Others_Choice then - Others_Present := True; + Others_N := Choice; if Choice /= First (Choice_List (Assoc)) or else Present (Next (Choice)) @@ -2289,7 +2289,7 @@ package body Sem_Aggr is if Present (Expressions (N)) and then (Nb_Choices > 1 - or else (Nb_Choices = 1 and then not Others_Present)) + or else (Nb_Choices = 1 and then No (Others_N))) then Error_Msg_N ("cannot mix named and positional associations in array aggregate", @@ -2299,16 +2299,11 @@ package body Sem_Aggr is -- Test for the validity of an others choice if present - if Others_Present and then not Others_Allowed then - declare -Others_N : constant Node_Id := - First (Choice_List (First (Component_Associations (N; - begin -Error_Msg_N ("OTHERS choice not allowed here", Others_N); -Error_Msg_N ("\qualify the aggregate with a constrained subtype " - & "to provide bounds for it", Others_N); -return Failure; - end; + if Present (Others_N) and then not Others_Allowed then + Error_Msg_N ("OTHERS choice not allowed here", Others_N); + Error_Msg_N ("\qualify the aggregate with a constrained subtype " + & "to provide bounds for it", Others_N); + return Failure; end if; -- Protect against cascaded errors @@ -2320,7 +2315,7 @@ package body Sem_Aggr is -- STEP 2: Process named components if No (Expressions (N)) then - if Others_Present then + if Present (Others_N) then Case_Table_Size := Nb_Choices - 1; else Case_Table_Size := Nb_Choices; @@ -2709,7 +2704,7 @@ package body Sem_Aggr is if Lo_Val <= Hi_Val or else (Lo_Val > Hi_Val + 1 - and then not Others_Present) + and then No (Others_N)) then Missing_Or_Duplicates := True; exit; @@ -2796,7 +2791,7 @@ package body Sem_Aggr is -- Loop through entries in table to find missing indexes. -- Not needed if others, since missing impossible. - if not Others_Present then + if No (Others_N) then for J in 2 .. Nb_Discrete_Choices loop Lo_Val := Expr_Value (Table (J).Lo); Hi_Val := Table (J - 1).Highest; @@ -2862,7 +2857,7 @@ package body Sem_Aggr is -- If Others is present, then bounds of aggregate come from the -- index constraint (not the choices in the aggregate itself). -if Others_Present then +if Present (Others_N) then Get_Index_Bounds (Index_Constr, Aggr_Low, Aggr_High); -- Abandon processing if either bound is already signalled as @@ -3043,7 +3038,7 @@ package body Sem_Aggr is Next (Expr); end loop; - if Others_Present then + i
[gcc r15-606] ada: Expose utility routine for processing of Depends contracts in SPARK
https://gcc.gnu.org/g:d77c12eb33c7a0a461f6928a8fb303378aaf2e2f commit r15-606-gd77c12eb33c7a0a461f6928a8fb303378aaf2e2f Author: Piotr Trojanek Date: Fri Mar 8 17:02:16 2024 +0100 ada: Expose utility routine for processing of Depends contracts in SPARK Routine Is_Unconstrained_Or_Tagged_Item is now used both in the GNAT frontend (for checking legality of Depends clauses) and in the GNATprove backend (for representing implicit inputs in flow graphs). gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Move to Sem_Util, so it can be used from GNATprove. * sem_util.ads (Is_Unconstrained_Or_Tagged_Item): Move from Sem_Prag; spec. * sem_util.adb (Is_Unconstrained_Or_Tagged_Item): Move from Sem_Prag; body. Diff: --- gcc/ada/sem_prag.adb | 29 - gcc/ada/sem_util.adb | 23 +++ gcc/ada/sem_util.ads | 5 + 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 02aad4d1caa2..f27e40edcbbf 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -280,12 +280,6 @@ package body Sem_Prag is -- Determine whether dependency clause Clause is surrounded by extra -- parentheses. If this is the case, issue an error message. - function Is_Unconstrained_Or_Tagged_Item (Item : Entity_Id) return Boolean; - -- Subsidiary to Collect_Subprogram_Inputs_Outputs and the analysis of - -- pragma Depends. Determine whether the type of dependency item Item is - -- tagged, unconstrained array, unconstrained private or unconstrained - -- record. - procedure Record_Possible_Body_Reference (State_Id : Entity_Id; Ref : Node_Id); @@ -32959,29 +32953,6 @@ package body Sem_Prag is and then List_Containing (N) = Private_Declarations (Parent (N)); end Is_Private_SPARK_Mode; - - - -- Is_Unconstrained_Or_Tagged_Item -- - - - - function Is_Unconstrained_Or_Tagged_Item - (Item : Entity_Id) return Boolean - is - Typ : constant Entity_Id := Etype (Item); - begin - if Is_Tagged_Type (Typ) then - return True; - - elsif Is_Array_Type (Typ) -or else Is_Record_Type (Typ) -or else Is_Private_Type (Typ) - then - return not Is_Constrained (Typ); - - else - return False; - end if; - end Is_Unconstrained_Or_Tagged_Item; - - -- Is_Valid_Assertion_Kind -- - diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index dd9f868b696f..be777d26e465 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -20709,6 +20709,29 @@ package body Sem_Util is return T = Universal_Integer or else T = Universal_Real; end Is_Universal_Numeric_Type; + - + -- Is_Unconstrained_Or_Tagged_Item -- + - + + function Is_Unconstrained_Or_Tagged_Item + (Item : Entity_Id) return Boolean + is + Typ : constant Entity_Id := Etype (Item); + begin + if Is_Tagged_Type (Typ) then + return True; + + elsif Is_Array_Type (Typ) +or else Is_Record_Type (Typ) +or else Is_Private_Type (Typ) + then + return not Is_Constrained (Typ); + + else + return False; + end if; + end Is_Unconstrained_Or_Tagged_Item; + -- -- Is_User_Defined_Equality -- -- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 99c60ddf708c..4fef89663805 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -2397,6 +2397,11 @@ package Sem_Util is pragma Inline (Is_Universal_Numeric_Type); -- True if T is Universal_Integer or Universal_Real + function Is_Unconstrained_Or_Tagged_Item (Item : Entity_Id) return Boolean; + -- Subsidiary to Collect_Subprogram_Inputs_Outputs and the analysis of + -- pragma Depends. Determine whether the type of dependency item Item is + -- tagged, unconstrained array or unconstrained record. + function Is_User_Defined_Equality (Id : Entity_Id) return Boolean; -- Determine whether an entity denotes a user-defined equality
[gcc r15-609] ada: Disable Equivalent_Array_Aggregate optimization if predicates involved
https://gcc.gnu.org/g:591ddf34a1e759560d89627eefae1d0e13b61ee8 commit r15-609-g591ddf34a1e759560d89627eefae1d0e13b61ee8 Author: Steve Baird Date: Fri Mar 8 16:17:41 2024 -0800 ada: Disable Equivalent_Array_Aggregate optimization if predicates involved In most paths, the function Build_Equivalent_Record_Aggregate was already testing Has_Predicates for a given component type and conditionally returning an Empty result. This is also needed in the case of a scalar component type. Without it, we can build corrupt trees that fail use-before-definition detection checks in gigi. gcc/ada/ * exp_ch3.adb (Build_Equivalent_Record_Aggregate): Add Has_Predicates test for a scalar component to match what is already done for other kinds of components. Diff: --- gcc/ada/exp_ch3.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 5764b22b8002..f6314dff285f 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1950,6 +1950,7 @@ package body Exp_Ch3 is or else not Compile_Time_Known_Value (Type_Low_Bound (Comp_Type)) or else not Compile_Time_Known_Value (Type_High_Bound (Comp_Type)) + or else Has_Predicates (Etype (Comp)) then Initialization_Warning (T); return Empty;
[gcc r15-610] ada: Do not query the modification time of a special file.
https://gcc.gnu.org/g:615c29a8c5d47a28887087d3ff49b9df7f74fe9e commit r15-610-g615c29a8c5d47a28887087d3ff49b9df7f74fe9e Author: Steve Baird Date: Fri Mar 8 15:48:32 2024 -0800 ada: Do not query the modification time of a special file. In Ada.Directories, the function Modification_Time raises Name_Error if it is called for a special file. So don't do that in Start_Search_Internal. gcc/ada/ * libgnat/a-direct.adb (Start_Search_Internal): Do not call Modification_Time for a special file; declare a Calendar.Time constant No_Time and use that instead. Diff: --- gcc/ada/libgnat/a-direct.adb | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ada/libgnat/a-direct.adb b/gcc/ada/libgnat/a-direct.adb index 32e020c48c37..adff12277e89 100644 --- a/gcc/ada/libgnat/a-direct.adb +++ b/gcc/ada/libgnat/a-direct.adb @@ -29,7 +29,7 @@ -- -- -- -with Ada.Calendar; use Ada.Calendar; +with Ada.Calendar.Formatting;use Ada.Calendar; with Ada.Characters.Handling;use Ada.Characters.Handling; with Ada.Containers.Vectors; with Ada.Directories.Validity; use Ada.Directories.Validity; @@ -1392,6 +1392,17 @@ package body Ada.Directories is end record; Res : Result := (Found => False); + + -- This declaration of No_Time copied from GNAT.Calendar + -- because adding a "with GNAT.Calendar;" to this unit + -- results in problems. + + No_Time : constant Ada.Calendar.Time := +Ada.Calendar.Formatting.Time_Of + (Ada.Calendar.Year_Number'First, + Ada.Calendar.Month_Number'First, + Ada.Calendar.Day_Number'First, + Time_Zone => 0); begin -- Get the file attributes for the directory item @@ -1452,7 +1463,10 @@ package body Ada.Directories is Full_Name => To_Unbounded_String (Path), Attr_Error_Code => 0, Kind => Res.Kind, - Modification_Time => Modification_Time (Path), + Modification_Time => + (if Res.Kind = Special_File + then No_Time + else Modification_Time (Path)), Size => Res.Size)); end if; end if;
[gcc r15-612] ada: Factor out duplicated code in bodies of System.Task_Primitives.Operations
https://gcc.gnu.org/g:3a5c4f926676bada86b7862ec0257ac5170b7976 commit r15-612-g3a5c4f926676bada86b7862ec0257ac5170b7976 Author: Eric Botcazou Date: Mon Mar 4 12:44:11 2024 +0100 ada: Factor out duplicated code in bodies of System.Task_Primitives.Operations The duplication is present in some POSIX-like implementations (POSIX and RTEMS) while it has already been eliminated in others (Linux, QNX). The latter implementations are also slightly modified for consistency's sake. No functional changes. gcc/ada/ * libgnarl/s-taprop__dummy.adb (Initialize_Lock): Fix formatting. * libgnarl/s-taprop__linux.adb (RTS_Lock_Ptr): Delete. (Init_Mutex): Rename into... (Initialize_Lock): ...this. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. (Initialize_TCB): Likewise. * libgnarl/s-taprop__posix.adb (Initialize_Lock): New procedure factored out from the other two homonyms. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. * libgnarl/s-taprop__qnx.adb (RTS_Lock_Ptr): Delete. (Init_Mutex): Rename into... (Initialize_Lock): ...this. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. (Initialize_TCB): Likewise. * libgnarl/s-taprop__rtems.adb (Initialize_Lock): New procedure factored out from the other two homonyms. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. Diff: --- gcc/ada/libgnarl/s-taprop__dummy.adb | 4 ++- gcc/ada/libgnarl/s-taprop__linux.adb | 47 +-- gcc/ada/libgnarl/s-taprop__posix.adb | 61 gcc/ada/libgnarl/s-taprop__qnx.adb | 46 +-- gcc/ada/libgnarl/s-taprop__rtems.adb | 61 5 files changed, 90 insertions(+), 129 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb index 90c4cd4cf72f..829d595694c3 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb @@ -239,7 +239,9 @@ package body System.Task_Primitives.Operations is end Initialize_Lock; procedure Initialize_Lock - (L : not null access RTS_Lock; Level : Lock_Level) is + (L : not null access RTS_Lock; + Level : Lock_Level) + is begin null; end Initialize_Lock; diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb index d6a29b5e1581..74717cb2d2b1 100644 --- a/gcc/ada/libgnarl/s-taprop__linux.adb +++ b/gcc/ada/libgnarl/s-taprop__linux.adb @@ -248,10 +248,10 @@ package body System.Task_Primitives.Operations is -- as in "sudo /sbin/setcap cap_sys_nice=ep exe_file". If it doesn't have -- permission, then a request for Ceiling_Locking is ignored. - type RTS_Lock_Ptr is not null access all RTS_Lock; - - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int; - -- Initialize the mutex L. If Ceiling_Support is True, then set the ceiling + function Initialize_Lock + (L: not null access RTS_Lock; + Prio : Any_Priority) return C.int; + -- Initialize the lock L. If Ceiling_Support is True, then set the ceiling -- to Prio. Returns 0 for success, or ENOMEM for out-of-memory. --- @@ -340,11 +340,20 @@ package body System.Task_Primitives.Operations is function Self return Task_Id renames Specific.Self; - - -- Init_Mutex -- - + - + -- Initialize_Lock -- + - - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is + -- Note: mutexes and cond_variables needed per-task basis are initialized + -- in Initialize_TCB and the Storage_Error is handled. Other mutexes (such + -- as RTS_Lock, Memory_Lock...) used in RTS is initialized before any + -- status change of RTS. Therefore raising Storage_Error in the following + -- routines should be able to be handled safely. + + function Initialize_Lock + (L: not null access RTS_Lock; + Prio : Any_Priority) return C.int + is Mutex_Attr : aliased pthread_mutexattr_t; Result, Result_2 : C.int; @@ -377,17 +386,7 @@ package body System.Task_Primitives.Operations is Result_2 := pthread_mutexattr_destroy (Mutex_Attr'Access); pragma Assert (Result_2 = 0); return Result; -- of pthread_mutex_init, not pthread_mutexattr_destroy - end Init_Mutex; - - - - -- Initialize_Lock -- - - - - -- Note: mutexes and cond_variables needed per-task basis are initialized - -- in Initialize_TCB and the Storage_Er
[gcc r15-608] ada: Clarify code for aggregate warnings
https://gcc.gnu.org/g:d87d0f331523684af0c975afa95232e9bf7070f6 commit r15-608-gd87d0f331523684af0c975afa95232e9bf7070f6 Author: Ronan Desplanques Date: Mon Mar 11 09:55:55 2024 +0100 ada: Clarify code for aggregate warnings This patch improves comments in code that emits warnings about particular situations involving aggregates. It also removes a conjunct in a condition that's useless because always true in the context of the test. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Improve comments and condition. Diff: --- gcc/ada/sem_aggr.adb | 52 +--- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index ee9beb04c9ad..14c68b5eaf3b 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2873,9 +2873,9 @@ package body Sem_Aggr is -- No others clause present else - -- Special processing if others allowed and not present. This - -- means that the bounds of the aggregate come from the index - -- constraint (and the length must match). + -- Special processing if others allowed and not present. In + -- this case, the bounds of the aggregate come from the + -- choices (RM 4.3.3 (27)). if Others_Allowed then Get_Index_Bounds (Index_Constr, Aggr_Low, Aggr_High); @@ -2890,30 +2890,28 @@ package body Sem_Aggr is return False; end if; - -- If others allowed, and no others present, then the array - -- should cover all index values. If it does not, we will - -- get a length check warning, but there is two cases where - -- an additional warning is useful: - - -- If we have no positional components, and the length is - -- wrong (which we can tell by others being allowed with - -- missing components), and the index type is an enumeration - -- type, then issue appropriate warnings about these missing - -- components. They are only warnings, since the aggregate - -- is fine, it's just the wrong length. We skip this check - -- for standard character types (since there are no literals - -- and it is too much trouble to concoct them), and also if - -- any of the bounds have values that are not known at - -- compile time. - - -- Another case warranting a warning is when the length - -- is right, but as above we have an index type that is - -- an enumeration, and the bounds do not match. This is a - -- case where dubious sliding is allowed and we generate a - -- warning that the bounds do not match. - - if No (Expressions (N)) -and then Nkind (Index) = N_Range + -- If there is an applicable index constraint and others is + -- not present, then sliding is allowed and only a length + -- check will be performed. However, additional warnings are + -- useful if the index type is an enumeration type, as + -- sliding is dubious in this case. We emit two kinds of + -- warnings: + -- + --1. If the length is wrong then there are missing + -- components; we issue appropriate warnings about + -- these missing components. They are only warnings, + -- since the aggregate is fine, it's just the wrong + -- length. We skip this check for standard character + -- types (since there are no literals and it is too + -- much trouble to concoct them), and also if any of + -- the bounds have values that are not known at compile + -- time. + -- + --2. If the length is right but the bounds do not match, + -- we issue a warning, as we consider sliding dubious + -- when the index type is an enumeration type. + + if Nkind (Index) = N_Range and then Is_Enumeration_Type (Etype (Index)) and then not Is_Standard_Character_Type (Etype (Index)) and then Compile_Time_Known_Value (Aggr_Low)
[gcc r15-611] ada: Fix for validity checking and conditional evaluation of 'Old
https://gcc.gnu.org/g:75de817d88aade7fc5e8b4bebe3f179f1c5b6a87 commit r15-611-g75de817d88aade7fc5e8b4bebe3f179f1c5b6a87 Author: Piotr Trojanek Date: Mon Mar 11 23:02:50 2024 +0100 ada: Fix for validity checking and conditional evaluation of 'Old Detection of expression that are "known on entry" (as defined in Ada 2022 RM 6.1.1(20/5)) was confused by validity checks when used from within expansion of attribute 'Old. gcc/ada/ * sem_util.adb (Is_Known_On_Entry): Handle constants introduced by validity checks. Diff: --- gcc/ada/sem_util.adb | 8 1 file changed, 8 insertions(+) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index be777d26e465..d512d462b443 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -30791,6 +30791,14 @@ package body Sem_Util is return False; end if; + -- Handle constants introduced by side-effect + -- removal, e.g. by validity checks. + + if not Comes_From_Source (Obj) then + return +Is_Known_On_Entry (Expression (Parent (Obj))); + end if; + -- return False if not "all views are constant". if Is_Immutably_Limited_Type (Obj_Typ) or Needs_Finalization (Obj_Typ)
[gcc r15-614] ada: Document secondary usage of Materialize_Entity flag
https://gcc.gnu.org/g:d7dbf6c7ae69ff4d8e26b8dc7ee14104f5a9843e commit r15-614-gd7dbf6c7ae69ff4d8e26b8dc7ee14104f5a9843e Author: Eric Botcazou Date: Tue Mar 12 18:57:08 2024 +0100 ada: Document secondary usage of Materialize_Entity flag The flag is also used by the semantic analyzer. gcc/ada/ * einfo.ads (Materialize_Entity): Document secondary usage. Diff: --- gcc/ada/einfo.ads | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 71c560d52727..e5110f516708 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3584,10 +3584,11 @@ package Einfo is -- tasks implementing such interface. --Materialize_Entity --- Defined in all entities. Set only for renamed obects which should be +-- Defined in all entities. Set mostly for renamed objects that should be -- materialized for debugging purposes. This means that a memory location -- containing the renamed address should be allocated. This is needed so --- that the debugger can find the entity. +-- that the debugger can find the entity. Also set on types built in the +-- case of unanalyzed packages referenced through a limited_with clause. --May_Inherit_Delayed_Rep_Aspects -- Defined in all entities for types and subtypes. Set if the type is
[gcc r15-613] ada: Bug in computing local restrictions inherited from enclosing scopes.
https://gcc.gnu.org/g:7b5b67dc1960b4b2f72c003e747b34049a5e04a7 commit r15-613-g7b5b67dc1960b4b2f72c003e747b34049a5e04a7 Author: Steve Baird Date: Mon Mar 11 17:45:58 2024 -0700 ada: Bug in computing local restrictions inherited from enclosing scopes. In the function Local_Restrict.Active_Restriction, we traverse enclosing scopes looking for a relevant Local_Restrictions aspect specification. Fix a bug in this traversal. gcc/ada/ * local_restrict.adb (Active_Restriction): When traversing scopes, do not skip over a subprogram body. Diff: --- gcc/ada/local_restrict.adb | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/gcc/ada/local_restrict.adb b/gcc/ada/local_restrict.adb index 6e91c8a2e2a2..3be940499283 100644 --- a/gcc/ada/local_restrict.adb +++ b/gcc/ada/local_restrict.adb @@ -90,22 +90,28 @@ package body Local_Restrict is return Result; end if; - Scop := Enclosing_Declaration (Scop); - if Present (Scop) then -Scop := Parent (Scop); + declare +Saved_Scope : constant Node_Id := Scop; + begin +Scop := Enclosing_Declaration (Scop); if Present (Scop) then - -- For a subprogram associated with a type, we don't care - -- where the type was frozen; continue from the type. - - if Nkind (Scop) = N_Freeze_Entity then - Scop := Scope (Entity (Scop)); - elsif Nkind (Parent (Scop)) = N_Freeze_Entity then - Scop := Scope (Entity (Parent (Scop))); - else - Scop := Find_Enclosing_Scope (Scop); + Scop := Parent (Scop); + if Present (Scop) then + -- For a subprogram associated with a type, we don't care + -- where the type was frozen; continue from the type. + + if Nkind (Scop) = N_Freeze_Entity then + Scop := Scope (Entity (Scop)); + elsif Nkind (Parent (Scop)) = N_Freeze_Entity then + Scop := Scope (Entity (Parent (Scop))); + elsif Present (Scope (Saved_Scope)) then + Scop := Scope (Saved_Scope); + else + Scop := Find_Enclosing_Scope (Scop); + end if; end if; end if; - end if; + end; end loop; return Empty;
[gcc r15-616] ada: Further adjustments coming from aliasing considerations
https://gcc.gnu.org/g:9ff83f013eb1ea2eac11c17cc3be2024e96101a5 commit r15-616-g9ff83f013eb1ea2eac11c17cc3be2024e96101a5 Author: Eric Botcazou Date: Thu Mar 14 12:58:29 2024 +0100 ada: Further adjustments coming from aliasing considerations They are needed on 32-bit platforms because of different calling conventions and again in the units implementing AltiVec and Streams support. gcc/ada/ * libgnat/g-alvevi.ads: Add pragma Universal_Aliasing for all the view types. * libgnat/s-stratt.ads: Likewise for Fat_Pointer type. Diff: --- gcc/ada/libgnat/g-alvevi.ads | 11 +++ gcc/ada/libgnat/s-stratt.ads | 3 +++ 2 files changed, 14 insertions(+) diff --git a/gcc/ada/libgnat/g-alvevi.ads b/gcc/ada/libgnat/g-alvevi.ads index b2beac7284c7..b0f58790adf8 100644 --- a/gcc/ada/libgnat/g-alvevi.ads +++ b/gcc/ada/libgnat/g-alvevi.ads @@ -58,6 +58,7 @@ package GNAT.Altivec.Vector_Views is type VUC_View is record Values : Varray_unsigned_char; end record; + pragma Universal_Aliasing (VUC_View); type Varray_signed_char is array (Vchar_Range) of signed_char; for Varray_signed_char'Alignment use VECTOR_ALIGNMENT; @@ -65,6 +66,7 @@ package GNAT.Altivec.Vector_Views is type VSC_View is record Values : Varray_signed_char; end record; + pragma Universal_Aliasing (VSC_View); type Varray_bool_char is array (Vchar_Range) of bool_char; for Varray_bool_char'Alignment use VECTOR_ALIGNMENT; @@ -72,6 +74,7 @@ package GNAT.Altivec.Vector_Views is type VBC_View is record Values : Varray_bool_char; end record; + pragma Universal_Aliasing (VBC_View); -- -- short components -- @@ -85,6 +88,7 @@ package GNAT.Altivec.Vector_Views is type VUS_View is record Values : Varray_unsigned_short; end record; + pragma Universal_Aliasing (VUS_View); type Varray_signed_short is array (Vshort_Range) of signed_short; for Varray_signed_short'Alignment use VECTOR_ALIGNMENT; @@ -92,6 +96,7 @@ package GNAT.Altivec.Vector_Views is type VSS_View is record Values : Varray_signed_short; end record; + pragma Universal_Aliasing (VSS_View); type Varray_bool_short is array (Vshort_Range) of bool_short; for Varray_bool_short'Alignment use VECTOR_ALIGNMENT; @@ -99,6 +104,7 @@ package GNAT.Altivec.Vector_Views is type VBS_View is record Values : Varray_bool_short; end record; + pragma Universal_Aliasing (VBS_View); -- int components -- @@ -112,6 +118,7 @@ package GNAT.Altivec.Vector_Views is type VUI_View is record Values : Varray_unsigned_int; end record; + pragma Universal_Aliasing (VUI_View); type Varray_signed_int is array (Vint_Range) of signed_int; for Varray_signed_int'Alignment use VECTOR_ALIGNMENT; @@ -119,6 +126,7 @@ package GNAT.Altivec.Vector_Views is type VSI_View is record Values : Varray_signed_int; end record; + pragma Universal_Aliasing (VSI_View); type Varray_bool_int is array (Vint_Range) of bool_int; for Varray_bool_int'Alignment use VECTOR_ALIGNMENT; @@ -126,6 +134,7 @@ package GNAT.Altivec.Vector_Views is type VBI_View is record Values : Varray_bool_int; end record; + pragma Universal_Aliasing (VBI_View); -- -- float components -- @@ -139,6 +148,7 @@ package GNAT.Altivec.Vector_Views is type VF_View is record Values : Varray_float; end record; + pragma Universal_Aliasing (VF_View); -- -- pixel components -- @@ -152,5 +162,6 @@ package GNAT.Altivec.Vector_Views is type VP_View is record Values : Varray_pixel; end record; + pragma Universal_Aliasing (VP_View); end GNAT.Altivec.Vector_Views; diff --git a/gcc/ada/libgnat/s-stratt.ads b/gcc/ada/libgnat/s-stratt.ads index 1d4c82d17abd..eee19f4bdced 100644 --- a/gcc/ada/libgnat/s-stratt.ads +++ b/gcc/ada/libgnat/s-stratt.ads @@ -74,6 +74,9 @@ package System.Stream_Attributes is P2 : System.Address; end record; + pragma Universal_Aliasing (Fat_Pointer); + -- This avoids a copy for the aforementioned unchecked conversions + -- Treatment of enumeration types --
[gcc r15-615] ada: Replace spinlocks with fully-fledged locks in finalization collections
https://gcc.gnu.org/g:c8e5d90c4a0b736c2c4c5be3e8a3e9744e602d9d commit r15-615-gc8e5d90c4a0b736c2c4c5be3e8a3e9744e602d9d Author: Eric Botcazou Date: Tue Mar 5 23:30:51 2024 +0100 ada: Replace spinlocks with fully-fledged locks in finalization collections This replaces spinlocks with fully-fledged locks in finalization collections because the former are deemed problematic with tasks that can be preempted. Because of the requirement to avoid dragging the tasking runtime when it is not necessary, the implementation goes through the usual soft links, with an additional hurdle that space must be reserved for the lock in any case since it is part of the ABI. This entails the introduction of the System.OS_Locks unit in the non-tasking runtime and the modification of the tasking runtime to also use this unit. This in turn requires a small adjustment: because of the presence of pre- and post-conditions in Interfaces.C and of the limitations of the RTSfind mechanism, the System.Finalization_Primitives unit must be preloaded, as what is done for the Ada.Strings.Text_Buffers unit. This effectively reverts the implementation to using the global task lock on bare board platforms. gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-oslock$(objext). (LIBGNAT_TARGET_PAIRS): Use s-oslock__dummy.ads by default. Set specific s-oslock.ads source file for all the platforms. * exp_ch7.ads (Preload_Finalization_Collection): New procedure. * exp_ch7.adb (Allows_Finalization_Collection): Return False if System.Finalization_Primitives has not been preloaded. (Preload_Finalization_Collection): New procedure. * opt.ads (Interface_Seen): New boolean variable. * s-oscons-tmplt.c: Use "N" string for pragma Style_Checks. * scng.adb (Scan): Set Interface_Seen upon seeing "interface". * sem_ch10.adb: Add clause for Exp_Ch7. (Analyze_Compilation_Unit): Call Preload_Finalization_Collection after the context of the unit is analyzed. * libgnarl/a-rttiev.adb: Add with clause for System.OS_Locks and alphabetize others. (Event_Queue_Lock): Adjust qualified name of subtype. * libgnarl/s-osinte__aix.ads: Add with clause for System.OS_Locks and change pthread_mutex_t into a local subtype. * libgnarl/s-osinte__android.ads: Likewise. * libgnarl/s-osinte__darwin.ads: Likewise. * libgnarl/s-osinte__dragonfly.ads: Likewise. * libgnarl/s-osinte__freebsd.ads: Likewise. * libgnarl/s-osinte__gnu.ads: Likewise. * libgnarl/s-osinte__hpux-dce.ads: Likewise. * libgnarl/s-osinte__hpux.ads: Add Likewise. * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. * libgnarl/s-osinte__linux.ads: Likewise. * libgnarl/s-osinte__lynxos178e.ads: Likewise. * libgnarl/s-osinte__qnx.ads: Likewise. * libgnarl/s-osinte__rtems.ads: Likewise. * libgnarl/s-osinte__mingw.ads: Add with clause for System.OS_Locks and change CRITICAL_SECTION into a local subtype. Add declarations for imported procedures dealing with CRITICAL_SECTION. * libgnarl/s-osinte__solaris.ads: Add with clause for System.OS_Locks and change mutex_t into a local subtype. * libgnarl/s-osinte__vxworks.ads: Add missing blank line. * libgnarl/s-taprop.ads: Alphabetize clauses and package renamings. Use qualified name for RTS_Lock throughout. * libgnarl/s-taprop__dummy.adb: Add use clause for System.OS_Locks and alphabetize others. * libgnarl/s-taprop__hpux-dce.adb: Likewise. * libgnarl/s-taprop__linux.adb: Likewise. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__rtems.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Likewise. * libgnarl/s-taprop__vxworks.adb: Likewise. * libgnarl/s-taprop__mingw.adb: Likewise. Remove declarations for imported procedures dealing with CRITICAL_SECTION. * libgnarl/s-tarest.adb: Add with clause for System.OS_Locks and alphabetize others. (Global_Task_Lock): Adjust qualified name of subtype. * libgnarl/s-tasini.adb: Add clause for System.OS_Locks. (Initialize_RTS_Lock): New procedure. (Finalize_RTS_Lock): Likewise. (Acquire_RTS_Lock): Likewise. (Release_RTS_Lock): Likewise. (Init_RTS): Add compile-time assertions for RTS_Lock types. Set the soft links for the RTS lock manipulation routines. * libgnarl/s-taspri__dummy.ads: Add with
[gcc r15-617] ada: Restore dependency on System.OS_Interface in System.Task_Primitives
https://gcc.gnu.org/g:22928da141a8bbee9994fbae00c595877ed060ad commit r15-617-g22928da141a8bbee9994fbae00c595877ed060ad Author: Eric Botcazou Date: Thu Mar 14 19:48:59 2024 +0100 ada: Restore dependency on System.OS_Interface in System.Task_Primitives The dependency is relied upon by the binder to drag the tasking runtime. gcc/ada/ * libgnarl/s-taspri__mingw.ads: Add clause for System.OS_Interface. (Private_Data): Change type of Thread component. Diff: --- gcc/ada/libgnarl/s-taspri__mingw.ads | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/libgnarl/s-taspri__mingw.ads b/gcc/ada/libgnarl/s-taspri__mingw.ads index a51f752d8056..6eae97d4af65 100644 --- a/gcc/ada/libgnarl/s-taspri__mingw.ads +++ b/gcc/ada/libgnarl/s-taspri__mingw.ads @@ -31,6 +31,7 @@ -- This is a NT (native) version of this package +with System.OS_Interface; with System.OS_Locks; with System.Win32; @@ -87,7 +88,7 @@ private end record; type Private_Data is limited record - Thread : aliased Win32.HANDLE; + Thread : aliased System.OS_Interface.Thread_Id; pragma Atomic (Thread); -- Thread field may be updated by two different threads of control. -- (See, Enter_Task and Create_Task in s-taprop.adb).
[gcc r15-618] ada: Improve test for unprocessed preprocessor directives
https://gcc.gnu.org/g:15b5a95d36a3c8cc35189aa951bdcdbf59ad4160 commit r15-618-g15b5a95d36a3c8cc35189aa951bdcdbf59ad4160 Author: Steve Baird Date: Wed Mar 13 17:46:56 2024 -0700 ada: Improve test for unprocessed preprocessor directives Preprocessor directives are case insensitive and may have spaces or tabs between the '#' and the keyword. When checking for the error case of unprocessed preprocessor directives, take these rules into account. gcc/ada/ * scng.adb (scan): When checking for an unprocessed preprocessor directive, take into account the preprocessor's rules about case insensitivity and about white space between the '#' and the keyword. Diff: --- gcc/ada/scng.adb | 183 --- 1 file changed, 122 insertions(+), 61 deletions(-) diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 9b1d00e34521..8b2829ffbbfc 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -40,6 +40,7 @@ with Widechar; use Widechar; pragma Warnings (Off); -- This package is used also by gnatcoll +with System.Case_Util; with System.CRC32; with System.UTF_32; use System.UTF_32; with System.WCh_Con; use System.WCh_Con; @@ -2250,86 +2251,146 @@ package body Scng is when Special_Preprocessor_Character => --- If Set_Special_Character has been called for this character, --- set Scans.Special_Character and return a Special token. +declare + function Matches_After_Skipping_White_Space + (S : String) return Boolean; + + -- Return True iff after skipping past white space the + -- next Source characters match the given string. + + + -- Matches_After_Skipping_White_Space -- + + + function Matches_After_Skipping_White_Space + (S : String) return Boolean + is + function To_Lower_Case_String (Buff : Text_Buffer) +return String; + -- Convert a text buffer to a lower-case string. + + -- + -- To_Lower_Case_String -- + -- + + function To_Lower_Case_String (Buff : Text_Buffer) +return String + is + subtype One_Based is Text_Buffer (1 .. Buff'Length); + Result : String := String (One_Based (Buff)); + begin + -- The System.Case_Util.To_Lower function (the overload + -- that takes a string parameter) cannot be called + -- here due to bootstrapping problems. That function + -- was added too recently. + + System.Case_Util.To_Lower (Result); + return Result; + end To_Lower_Case_String; + + pragma Assert (Source (Scan_Ptr) = '#'); + Local_Scan_Ptr : Source_Ptr := Scan_Ptr + 1; + + -- Start of processing for Matches_After_Skipping_White_Space -if Special_Characters (Source (Scan_Ptr)) then - Token_Ptr := Scan_Ptr; - Token := Tok_Special; - Special_Character := Source (Scan_Ptr); - Scan_Ptr := Scan_Ptr + 1; - return; + begin + while Local_Scan_Ptr in Source'Range +and then Source (Local_Scan_Ptr) in ' ' | HT + loop + Local_Scan_Ptr := Local_Scan_Ptr + 1; + end loop; --- Check for something looking like a preprocessor directive + return Local_Scan_Ptr in Source'Range +and then Local_Scan_Ptr + (S'Length - 1) in Source'Range +and then S = To_Lower_Case_String ( + Source (Local_Scan_Ptr .. + Local_Scan_Ptr + (S'Length - 1))); + end Matches_After_Skipping_White_Space; -elsif Source (Scan_Ptr) = '#' - and then (Source (Scan_Ptr + 1 .. Scan_Ptr + 2) = "if" - or else -Source (Scan_Ptr + 1 .. Scan_Ptr + 5) = "elsif" - or else -Source (Scan_Ptr + 1 .. Scan_Ptr + 4) = "else" - or else -Source (Scan_Ptr + 1 .. Scan_Ptr + 3) = "end") -then - Error_Msg_S - ("preprocessor directive ignored, preprocessor not active"); +begin + -- If Set_Special_Character has been called for this character, + -- set Scans.S
[gcc r15-588] ada: Small cleanup in aggregate expansion code
https://gcc.gnu.org/g:1da18c25593fceed40233cd2cd49409ea817372a commit r15-588-g1da18c25593fceed40233cd2cd49409ea817372a Author: Ronan Desplanques Date: Fri Mar 1 10:31:12 2024 +0100 ada: Small cleanup in aggregate expansion code This patch moves a statement outside of a loop because it didn't need to be inside that loop. The behavior of the program is not affected. gcc/ada/ * exp_aggr.adb (Flatten): Small cleanup. Diff: --- gcc/ada/exp_aggr.adb | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 5d2b334722a2..cff04fc1b79c 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4626,6 +4626,14 @@ package body Exp_Aggr is Component_Loop : while Present (Elmt) loop Expr := Expression (Elmt); + -- If the expression involves a construct that generates a + -- loop, we must generate individual assignments and no + -- flattening is possible. + + if Nkind (Expr) = N_Quantified_Expression then + return False; + end if; + -- In the case of a multidimensional array, check that the -- aggregate can be recursively flattened. @@ -4642,14 +4650,6 @@ package body Exp_Aggr is if Nkind (Choice) = N_Others_Choice then Rep_Count := 0; - -- If the expression involves a construct that generates - -- a loop, we must generate individual assignments and - -- no flattening is possible. - - if Nkind (Expr) = N_Quantified_Expression then -return False; - end if; - for J in Vals'Range loop if No (Vals (J)) then Vals (J) := New_Copy_Tree (Expr);
[gcc r15-620] ada: Remove outdated workaround in aggregate expansion
https://gcc.gnu.org/g:167462f1977e7ed52a0d0aec8508b45bfe78c54b commit r15-620-g167462f1977e7ed52a0d0aec8508b45bfe78c54b Author: Ronan Desplanques Date: Mon Mar 18 09:58:00 2024 +0100 ada: Remove outdated workaround in aggregate expansion Before this patch, the compiler refrained from rewriting aggregates into purely positional form in some cases of one-component aggregates. As explained in comments, this was because the back end could not handle positional aggregates in those situations. As the back end seems to have grown more capable, this patch removes the workaround. It also extends the comments describing a warning that is emitted in the same configuration with aggregates. gcc/ada/ * exp_aggr.adb (Aggr_Size_OK): Remove workaround and extend comment. Diff: --- gcc/ada/exp_aggr.adb | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 9c5944a917d0..892f47ceb050 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -711,9 +711,10 @@ package body Exp_Aggr is return True; end if; - -- One-component aggregates are suspicious, and if the context type - -- is an object declaration with nonstatic bounds it will trip gcc; - -- such an aggregate must be expanded into a single assignment. + -- One-component named aggregates where the index constraint is not + -- known at compile time are suspicious as the user might have + -- intended to write a subtype name but wrote the name of an object + -- instead. We emit a warning if we're in such a case. if Hiv = Lov and then Nkind (Parent (N)) = N_Object_Declaration then declare @@ -741,8 +742,6 @@ package body Exp_Aggr is Error_Msg_N ("\maybe subtype name was meant??", Indx); end if; end if; - - return False; end if; end; end if;
[gcc r15-621] ada: Improve deriving initial sizes for container aggregates
https://gcc.gnu.org/g:9bd0b709ddb70589436c326142b1566f49f5e979 commit r15-621-g9bd0b709ddb70589436c326142b1566f49f5e979 Author: Viljar Indus Date: Wed Mar 13 11:24:59 2024 +0200 ada: Improve deriving initial sizes for container aggregates Deriving the initial size of container aggregates is necessary for deriving the correct capacity for bounded containers. Add support for deriving the correct initial size when the container aggregate is iterating over an array object. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Derive the size for iterable aggregates in the case of one-dimensional array objects. Diff: --- gcc/ada/exp_aggr.adb | 83 ++-- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 892f47ceb050..2476675604cc 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6693,9 +6693,9 @@ package body Exp_Aggr is -- If one or more of the associations is one of the iterated -- forms, and is either an association with nonstatic bounds --- or is an iterator over an iterable object, then treat the --- whole container aggregate as having a nonstatic number of --- elements. +-- or is an iterator over an iterable object where the size +-- cannot be derived, then treat the whole container aggregate as +-- having a nonstatic number of elements. declare Has_Nonstatic_Length : Boolean := False; @@ -6725,37 +6725,43 @@ package body Exp_Aggr is Comp := First (Component_Associations (N)); while Present (Comp) loop - Choice := First (Choice_List (Comp)); + if Present (Choice_List (Comp)) then + Choice := First (Choice_List (Comp)); - while Present (Choice) loop - Analyze (Choice); + while Present (Choice) loop + Analyze (Choice); - if Nkind (Choice) = N_Range then - Lo := Low_Bound (Choice); - Hi := High_Bound (Choice); - Add_Range_Size; + if Nkind (Choice) = N_Range then +Lo := Low_Bound (Choice); +Hi := High_Bound (Choice); +Add_Range_Size; - elsif Is_Entity_Name (Choice) -and then Is_Type (Entity (Choice)) - then - Lo := Type_Low_Bound (Entity (Choice)); - Hi := Type_High_Bound (Entity (Choice)); - Add_Range_Size; + elsif Is_Entity_Name (Choice) + and then Is_Type (Entity (Choice)) + then +Lo := Type_Low_Bound (Entity (Choice)); +Hi := Type_High_Bound (Entity (Choice)); +Add_Range_Size; - Rewrite (Choice, - Make_Range (Loc, - New_Copy_Tree (Lo), - New_Copy_Tree (Hi))); +Rewrite (Choice, + Make_Range (Loc, +New_Copy_Tree (Lo), +New_Copy_Tree (Hi))); - else - -- Single choice (syntax excludes a subtype - -- indication). + else +-- Single choice (syntax excludes a subtype +-- indication). - Siz := Siz + 1; - end if; +Siz := Siz + 1; + end if; - Next (Choice); - end loop; + Next (Choice); + end loop; + + elsif Nkind (Comp) = N_Iterated_Component_Association then + + Siz := Siz + Build_Siz_Exp (Comp); + end if; Next (Comp); end loop; end if; @@ -6770,6 +6776,7 @@ package body Exp_Aggr is function Build_Siz_Exp (Comp : Node_Id) return Int is Lo, Hi : Node_Id; Temp_Siz_Exp : Node_Id; + It : Node_Id; begin if Nkind (Comp) = N_Range then @@ -6835,8 +6842,28 @@ package body Exp_Aggr is end if; elsif Nkind (Comp) = N_Iterated_Component_Association then -return Build_Siz_Exp (First (Discrete_Choices (Comp))); +if Present (Iterator_Specification (Comp)) then + + -- If the static size of the iterable object is known, + -- attempt to return it. + + It := Name (Iterator_Specification (Comp)); + Preanal
[gcc r15-592] ada: Fix probable copy/paste error
https://gcc.gnu.org/g:7dbd854509277059581e94167bbadf9d71cda0dc commit r15-592-g7dbd854509277059581e94167bbadf9d71cda0dc Author: Marc Poulhiès Date: Fri Mar 1 15:30:55 2024 +0100 ada: Fix probable copy/paste error gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Fix copy/paste. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Diff: --- gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst | 7 +++ gcc/ada/gnat_rm.texi | 7 +++ gcc/ada/gnat_ugn.texi | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst index f8700b1be4e3..728d63a8e924 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst @@ -81,10 +81,9 @@ Attribute Atomic_Always_Lock_Free = .. index:: Atomic_Always_Lock_Free -The prefix of the ``Atomic_Always_Lock_Free`` attribute is a type. -The result is a Boolean value which is True if the type has discriminants, -and False otherwise. The result indicate whether atomic operations are -supported by the target for the given type. +The prefix of the ``Atomic_Always_Lock_Free`` attribute is a type. The +result indicates whether atomic operations are supported by the target +for the given type. Attribute Bit = diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 6da3f3131d54..8dcdd6ca14c9 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -10373,10 +10373,9 @@ either be omitted, or explicitly given as @code{No_Output_Operands}. @geindex Atomic_Always_Lock_Free -The prefix of the @code{Atomic_Always_Lock_Free} attribute is a type. -The result is a Boolean value which is True if the type has discriminants, -and False otherwise. The result indicate whether atomic operations are -supported by the target for the given type. +The prefix of the @code{Atomic_Always_Lock_Free} attribute is a type. The +result indicates whether atomic operations are supported by the target +for the given type. @node Attribute Bit,Attribute Bit_Position,Attribute Atomic_Always_Lock_Free,Implementation Defined Attributes @anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{178} diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 997086c67bdb..7bad8b4e161b 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , Apr 15, 2024 +GNAT User's Guide for Native Platforms , Apr 16, 2024 AdaCore @@ -29580,8 +29580,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d1}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye
[gcc r15-594] ada: Allow private items with unknown discriminants as Depends inputs
https://gcc.gnu.org/g:4b5eeb74a20028e493b520887cc9fd97d6fc0f3d commit r15-594-g4b5eeb74a20028e493b520887cc9fd97d6fc0f3d Author: Piotr Trojanek Date: Tue Mar 5 13:03:18 2024 +0100 ada: Allow private items with unknown discriminants as Depends inputs Objects of private types with unknown discriminants are now allowed as inputs in the Depends contracts. gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Allow objects of private types with unknown discriminants. Diff: --- gcc/ada/sem_prag.adb | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 9dc22e3edc17..0302cdb00ba5 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -283,7 +283,8 @@ package body Sem_Prag is function Is_Unconstrained_Or_Tagged_Item (Item : Entity_Id) return Boolean; -- Subsidiary to Collect_Subprogram_Inputs_Outputs and the analysis of -- pragma Depends. Determine whether the type of dependency item Item is - -- tagged, unconstrained array or unconstrained record. + -- tagged, unconstrained array, unconstrained private or unconstrained + -- record. procedure Record_Possible_Body_Reference (State_Id : Entity_Id; @@ -32977,7 +32978,8 @@ package body Sem_Prag is return Has_Discriminants (Typ) and then not Is_Constrained (Typ); elsif Is_Private_Type (Typ) then - return Has_Discriminants (Typ); + return Has_Discriminants (Typ) + or else Has_Unknown_Discriminants (Typ); else return False;
[gcc r15-595] ada: Simplify code for private types with unknown discriminants
https://gcc.gnu.org/g:8e4069566e5ce4f2d936635187fd90c300e475e9 commit r15-595-g8e4069566e5ce4f2d936635187fd90c300e475e9 Author: Piotr Trojanek Date: Tue Mar 5 13:06:18 2024 +0100 ada: Simplify code for private types with unknown discriminants Private type entities have Is_Constrained set when they have no discriminants and no unknown discriminants; it is now set slightly later, but simpler (this change could only affect Process_Discriminants, but this flag should not be needed there). Also, we now reuse this flag to detect private types with discriminants. Code cleanup; behavior is unaffected. gcc/ada/ * sem_ch7.adb (New_Private_Type): Simplify setting of Is_Constrained flag. * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Simplify detection of private types with no discriminant. Diff: --- gcc/ada/sem_ch7.adb | 7 +++ gcc/ada/sem_prag.adb | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 746462244529..a70d72c94c1e 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2746,10 +2746,6 @@ package body Sem_Ch7 is Set_Is_First_Subtype (Id); Reinit_Size_Align (Id); - Set_Is_Constrained (Id, -No (Discriminant_Specifications (N)) - and then not Unknown_Discriminants_Present (N)); - -- Set tagged flag before processing discriminants, to catch illegal -- usage. @@ -2765,6 +2761,9 @@ package body Sem_Ch7 is elsif Unknown_Discriminants_Present (N) then Set_Has_Unknown_Discriminants (Id); + + else + Set_Is_Constrained (Id); end if; Set_Private_Dependents (Id, New_Elmt_List); diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 0302cdb00ba5..e57f42d9a54d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -32978,8 +32978,7 @@ package body Sem_Prag is return Has_Discriminants (Typ) and then not Is_Constrained (Typ); elsif Is_Private_Type (Typ) then - return Has_Discriminants (Typ) - or else Has_Unknown_Discriminants (Typ); + return not Is_Constrained (Typ); else return False;
[gcc r15-605] ada: Couple of adjustments coming from aliasing considerations
https://gcc.gnu.org/g:485d595d22c7800eb214034c9b58211ab232dbbf commit r15-605-g485d595d22c7800eb214034c9b58211ab232dbbf Author: Eric Botcazou Date: Sun Mar 10 15:51:21 2024 +0100 ada: Couple of adjustments coming from aliasing considerations The first adjustment is to the expansion of implementation types for array types with peculiar index types, for which the aliased property set on the component of the original type must be copied; the implicit base type also needs to be properly marked if the implementation type is constrained. The second adjustment is to selected types in the runtime, which need to be marked with pragma Universal_Aliasing because of their special usage. gcc/ada/ * exp_pakd.adb (Create_Packed_Array_Impl_Type): For non-bit-packed array types, propagate the aliased property of the component. (Install_PAT): Set fields on the implicit base type of an array. * libgnat/a-stream.ads (private part): Add pragma Universal_Aliasing for Stream_Element. * libgnat/g-alleve.ads: Add pragma Universal_Aliasing for all the vector types. * libgnat/g-alleve__hard.ads: Likewise. Diff: --- gcc/ada/exp_pakd.adb | 12 +++-- gcc/ada/libgnat/a-stream.ads | 3 +++ gcc/ada/libgnat/g-alleve.ads | 54 +- gcc/ada/libgnat/g-alleve__hard.ads | 11 4 files changed, 71 insertions(+), 9 deletions(-) diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index 3f26c3527fa4..59dfe5df8df4 100644 --- a/gcc/ada/exp_pakd.adb +++ b/gcc/ada/exp_pakd.adb @@ -598,6 +598,14 @@ package body Exp_Pakd is Set_Associated_Node_For_Itype (PAT, Typ); Set_Original_Array_Type (PAT, Typ); + -- In the case of a constrained array type, also set fields on the + -- implicit base type built during the analysis of its declaration. + + if Ekind (PAT) = E_Array_Subtype then +Set_Is_Packed_Array_Impl_Type (Etype (PAT), True); +Set_Original_Array_Type (Etype (PAT), Base_Type (Typ)); + end if; + -- Propagate representation aspects Set_Is_Atomic (PAT, Is_Atomic(Typ)); @@ -818,7 +826,7 @@ package body Exp_Pakd is Subtype_Marks => Indexes, Component_Definition => Make_Component_Definition (Loc, - Aliased_Present=> False, + Aliased_Present=> Has_Aliased_Components (Typ), Subtype_Indication => New_Occurrence_Of (Ctyp, Loc))); @@ -828,7 +836,7 @@ package body Exp_Pakd is Discrete_Subtype_Definitions => Indexes, Component_Definition => Make_Component_Definition (Loc, -Aliased_Present=> False, +Aliased_Present=> Has_Aliased_Components (Typ), Subtype_Indication => New_Occurrence_Of (Ctyp, Loc))); end if; diff --git a/gcc/ada/libgnat/a-stream.ads b/gcc/ada/libgnat/a-stream.ads index 0a0cabce3f2b..dcb5a9aa81ce 100644 --- a/gcc/ada/libgnat/a-stream.ads +++ b/gcc/ada/libgnat/a-stream.ads @@ -84,4 +84,7 @@ private for Stream_Element_Array'Read use Read_SEA; for Stream_Element_Array'Write use Write_SEA; + pragma Universal_Aliasing (Stream_Element); + -- This type is used to stream any other type + end Ada.Streams; diff --git a/gcc/ada/libgnat/g-alleve.ads b/gcc/ada/libgnat/g-alleve.ads index 0f3ec36d0f1b..4e22a3e63876 100644 --- a/gcc/ada/libgnat/g-alleve.ads +++ b/gcc/ada/libgnat/g-alleve.ads @@ -313,22 +313,62 @@ private --- -- We simply use the natural array definitions corresponding to each - -- user-level vector type. + -- user-level vector type. We need to put pragma Universal_Aliasing + -- on these types because the common operations are implemented by + -- means of Unchecked_Conversion betwwen different representations. - type LL_VUI is new VUI_View; - type LL_VSI is new VSI_View; - type LL_VBI is new VBI_View; + -- + -- char Core Components -- + -- + + type LL_VUC is new VUC_View; + pragma Universal_Aliasing (LL_VUC); + + type LL_VSC is new VSC_View; + pragma Universal_Aliasing (LL_VSC); + + type LL_VBC is new VBC_View; + pragma Universal_Aliasing (LL_VBC); + + --- + -- short Core Components -- + --- type LL_VUS is new VUS_View; + pragma Universal_Aliasing (LL_VUS); + type LL_VSS is new VSS_View; + pragma Universal_Aliasing (LL_VSS); + type LL_VBS is new VBS_View; + pragma Universal_Aliasing (LL_VBS); - type LL_VUC is
[gcc r15-619] ada: Start the initialization of the tasking runtime earlier
https://gcc.gnu.org/g:fc477a3f361dd5e72512e4ad42ef204af7c4c3e5 commit r15-619-gfc477a3f361dd5e72512e4ad42ef204af7c4c3e5 Author: Eric Botcazou Date: Fri Mar 15 16:46:16 2024 +0100 ada: Start the initialization of the tasking runtime earlier This installs the tasking versions of the RTS_Lock manipulation routines very early, before the elaboration of all the Ada units of the program, including those of the runtime, because this elaboration may require the initialization of RTS_Lock objects. gcc/ada/ * bindgen.adb (Gen_Adainit): Generate declaration and call to the imported procedure __gnat_tasking_runtime_initialize if need be. * libgnat/s-soflin.ads (Locking Soft-Links): Add commentary. * libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): New procedure exported as __gnat_tasking_runtime_initialize. Initialize RTS_Lock manipulation routines here instead of... (Init_RTS): ...here. Diff: --- gcc/ada/bindgen.adb | 18 -- gcc/ada/libgnarl/s-tasini.adb | 30 +- gcc/ada/libgnat/s-soflin.ads | 4 +++- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index fc834e3a9b6b..f15f96495df2 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -819,8 +819,7 @@ package body Bindgen is WBI (" pragma Import (C, XDR_Stream, ""__gl_xdr_stream"");"); end if; - -- Import entry point for elaboration time signal handler - -- installation, and indication of if it's been called previously. + -- Import entry point for initialization of the runtime WBI (""); WBI (" procedure Runtime_Initialize " & @@ -828,6 +827,15 @@ package body Bindgen is WBI (" pragma Import (C, Runtime_Initialize, " & """__gnat_runtime_initialize"");"); + -- Import entry point for initialization of the tasking runtime + + if With_GNARL then +WBI (""); +WBI (" procedure Tasking_Runtime_Initialize;"); +WBI (" pragma Import (C, Tasking_Runtime_Initialize, " & + """__gnat_tasking_runtime_initialize"");"); + end if; + -- Import handlers attach procedure for sequential elaboration policy if System_Interrupts_Used @@ -1090,6 +1098,12 @@ package body Bindgen is -- Generate call to Runtime_Initialize WBI (" Runtime_Initialize (1);"); + + -- Generate call to Tasking_Runtime_Initialize + + if With_GNARL then +WBI (" Tasking_Runtime_Initialize;"); + end if; end if; -- Generate call to set Initialize_Scalar values if active diff --git a/gcc/ada/libgnarl/s-tasini.adb b/gcc/ada/libgnarl/s-tasini.adb index 22294145bed7..794183f5356a 100644 --- a/gcc/ada/libgnarl/s-tasini.adb +++ b/gcc/ada/libgnarl/s-tasini.adb @@ -102,10 +102,6 @@ package body System.Tasking.Initialization is procedure Release_RTS_Lock (Addr : Address); -- Release the RTS lock at Addr - - -- Local Subprograms -- - - -- Tasking Initialization -- @@ -116,6 +112,15 @@ package body System.Tasking.Initialization is -- of initializing global locks, and installing tasking versions of certain -- operations used by the compiler. Init_RTS is called during elaboration. + procedure Tasking_Runtime_Initialize; + pragma Export (Ada, Tasking_Runtime_Initialize, + "__gnat_tasking_runtime_initialize"); + -- This procedure starts the initialization of the GNARL. It installs the + -- tasking versions of the RTS_Lock manipulation routines. It is called + -- very early before the elaboration of all the Ada units of the program, + -- including those of the runtime, because this elaboration may require + -- the initialization of RTS_Lock objects. + -- -- Change_Base_Priority -- -- @@ -414,11 +419,6 @@ package body System.Tasking.Initialization is SSL.Task_Name := Task_Name'Access; SSL.Get_Current_Excep := Get_Current_Excep'Access; - SSL.Initialize_RTS_Lock := Initialize_RTS_Lock'Access; - SSL.Finalize_RTS_Lock := Finalize_RTS_Lock'Access; - SSL.Acquire_RTS_Lock:= Acquire_RTS_Lock'Access; - SSL.Release_RTS_Lock:= Release_RTS_Lock'Access; - -- Initialize the tasking soft links (if not done yet) that are common -- to the full and the restricted run times. @@ -430,6 +430,18 @@ package body System.Tasking.Initialization is Undefer_Abort (Environment_Task); end Init_RTS; + + -- Tasking_Runtime_Initialize -- +
[gcc r15-622] Add missing check for const_pool in the escaped solutions
https://gcc.gnu.org/g:b420e0b920613c42f63252aa2478a8315dc37a13 commit r15-622-gb420e0b920613c42f63252aa2478a8315dc37a13 Author: Richard Biener Date: Fri May 17 09:31:52 2024 +0200 Add missing check for const_pool in the escaped solutions The ptr-vs-ptr compare folding using points-to info was missing a check for const_pool being included in the escaped solution. The following fixes that, fixing the observed execute FAIL of experimental/functional/searchers.cc * tree-ssa-alias.h (pt_solution_includes_const_pool): Declare. * tree-ssa-alias.cc (ptrs_compare_unequal): Use pt_solution_includes_const_pool. * tree-ssa-structalias.cc (pt_solution_includes_const_pool): New. * gcc.dg/torture/20240517-1.c: New testcase. Diff: --- gcc/testsuite/gcc.dg/torture/20240517-1.c | 26 ++ gcc/tree-ssa-alias.cc | 3 ++- gcc/tree-ssa-alias.h | 1 + gcc/tree-ssa-structalias.cc | 11 +++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/torture/20240517-1.c b/gcc/testsuite/gcc.dg/torture/20240517-1.c new file mode 100644 index ..ab83d3ca6fba --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20240517-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-additional-options "-fmerge-all-constants" } */ + +char *p; + +char * __attribute__((noipa)) +foo () { return p+1; } + +volatile int z; + +int main() +{ + /* ESCAPED = CONST_POOL */ + p = "Hello"; + /* PT = ESCAPED */ + char *x = foo (); + char *y; + /* y PT = CONST_POOL */ + if (z) +y = "Baz"; + else +y = "Hello" + 1; + if (y != x) +__builtin_abort (); + return 0; +} diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index 6d31fc836917..9f5f69bcfad2 100644 --- a/gcc/tree-ssa-alias.cc +++ b/gcc/tree-ssa-alias.cc @@ -501,7 +501,8 @@ ptrs_compare_unequal (tree ptr1, tree ptr2) || pi2->pt.vars_contains_interposable) return false; if ((!pi1->pt.null || !pi2->pt.null) - && (!pi1->pt.const_pool || !pi2->pt.const_pool)) + && (!pt_solution_includes_const_pool (&pi1->pt) + || !pt_solution_includes_const_pool (&pi2->pt))) return !pt_solutions_intersect (&pi1->pt, &pi2->pt); } } diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h index e29dff583750..5cd64e722955 100644 --- a/gcc/tree-ssa-alias.h +++ b/gcc/tree-ssa-alias.h @@ -178,6 +178,7 @@ extern bool pt_solution_empty_p (const pt_solution *); extern bool pt_solution_singleton_or_null_p (struct pt_solution *, unsigned *); extern bool pt_solution_includes_global (struct pt_solution *, bool); extern bool pt_solution_includes (struct pt_solution *, const_tree); +extern bool pt_solution_includes_const_pool (struct pt_solution *); extern bool pt_solutions_intersect (struct pt_solution *, struct pt_solution *); extern void pt_solution_reset (struct pt_solution *); extern void pt_solution_set (struct pt_solution *, bitmap, bool); diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 0c6085b17662..61fb3610a172 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -7080,6 +7080,17 @@ pt_solution_includes (struct pt_solution *pt, const_tree decl) return res; } +/* Return true if the points-to solution *PT contains a reference to a + constant pool entry. */ + +bool +pt_solution_includes_const_pool (struct pt_solution *pt) +{ + return (pt->const_pool + || (pt->escaped && (!cfun || cfun->gimple_df->escaped.const_pool)) + || (pt->ipa_escaped && ipa_escaped_pt.const_pool)); +} + /* Return true if both points-to solutions PT1 and PT2 have a non-empty intersection. */
[gcc r15-624] Remove spurious line
https://gcc.gnu.org/g:4da8be4f46b5dad4f5f610fc142538054446f44b commit r15-624-g4da8be4f46b5dad4f5f610fc142538054446f44b Author: Eric Botcazou Date: Wed May 8 11:20:40 2024 +0200 Remove spurious line Diff: --- gcc/ada/ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2095166460ec..f0ec83e56d39 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1139,7 +1139,6 @@ 2024-05-06 Eric Botcazou * fe.h: Remove unused declarations and add 'extern' to others. - no-issue-check 2024-05-06 Piotr Trojanek
[gcc r15-625] Small fix to implementation of -fdump-ada-spec
https://gcc.gnu.org/g:6a0a46c57999d1f805f6c604a8868ae588a104f2 commit r15-625-g6a0a46c57999d1f805f6c604a8868ae588a104f2 Author: Eric Botcazou Date: Fri May 17 11:44:30 2024 +0200 Small fix to implementation of -fdump-ada-spec gcc/c-family/ * c-ada-spec.cc (bitfield_used): Move around. (packed_layout): Likewise. (dump_ada_array_type): Do not put "aliased" for a packed layout. Diff: --- gcc/c-family/c-ada-spec.cc | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc index e56ef10f443a..46fee30b6b90 100644 --- a/gcc/c-family/c-ada-spec.cc +++ b/gcc/c-family/c-ada-spec.cc @@ -699,6 +699,8 @@ compare_comment (const void *lp, const void *rp) static tree *to_dump = NULL; static int to_dump_count = 0; +static bool bitfield_used = false; +static bool packed_layout = false; /* Collect a list of declarations from T relevant to SOURCE_FILE to be dumped by a subsequent call to dump_ada_nodes. */ @@ -1825,7 +1827,7 @@ dump_ada_array_type (pretty_printer *buffer, tree node, int spc) pp_string (buffer, " of "); - if (TREE_CODE (tmp) != POINTER_TYPE) + if (TREE_CODE (tmp) != POINTER_TYPE && !packed_layout) pp_string (buffer, "aliased "); if (TYPE_NAME (tmp) @@ -2083,9 +2085,6 @@ is_float128 (tree node) || id_equal (name, "_Float128x"); } -static bool bitfield_used = false; -static bool packed_layout = false; - /* Recursively dump in BUFFER Ada declarations corresponding to NODE of type TYPE. SPC is the indentation level. LIMITED_ACCESS indicates whether NODE can be referenced via a "limited with" clause. NAME_ONLY indicates whether
[gcc r15-623] Add widening expansion of MULT_HIGHPART_EXPR for integral modes
https://gcc.gnu.org/g:f53f8a859631bef97adba1522a8049a8fce57c1b commit r15-623-gf53f8a859631bef97adba1522a8049a8fce57c1b Author: Eric Botcazou Date: Wed May 8 10:07:56 2024 +0200 Add widening expansion of MULT_HIGHPART_EXPR for integral modes For integral modes the expansion of MULT_HIGHPART_EXPR requires the presence of an {s,u}mul_highpart optab whereas, for vector modes, widening expansion is supported. This adds a widening expansion for integral modes too, which is in fact already implemented in expmed_mult_highpart_optab. gcc/ * expmed.h (expmed_mult_highpart_optab): Declare. * expmed.cc (expmed_mult_highpart_optab): Remove static keyword. Do not assume that OP1 is a constant integer. Fix pasto. (expmed_mult_highpart): Pass OP1 narrowed to MODE in all the calls to expmed_mult_highpart_optab. * optabs-query.cc (can_mult_highpart_p): Use 2 for integer widening and shift subsequent values accordingly. * optabs.cc (expand_mult_highpart): Call expmed_mult_highpart_optab when can_mult_highpart_p returns 2 and adjust to above change. Diff: --- gcc/expmed.cc | 54 + gcc/expmed.h| 2 ++ gcc/optabs-query.cc | 24 gcc/optabs.cc | 7 +-- 4 files changed, 52 insertions(+), 35 deletions(-) diff --git a/gcc/expmed.cc b/gcc/expmed.cc index 248940fe4147..50d22762cae0 100644 --- a/gcc/expmed.cc +++ b/gcc/expmed.cc @@ -2748,8 +2748,7 @@ static rtx expand_mult_const (machine_mode, rtx, HOST_WIDE_INT, rtx, static unsigned HOST_WIDE_INT invert_mod2n (unsigned HOST_WIDE_INT, int); static rtx extract_high_half (scalar_int_mode, rtx); static rtx expmed_mult_highpart (scalar_int_mode, rtx, rtx, rtx, int, int); -static rtx expmed_mult_highpart_optab (scalar_int_mode, rtx, rtx, rtx, - int, int); + /* Compute and return the best algorithm for multiplying by T. The algorithm must cost less than cost_limit If retval.cost >= COST_LIMIT, no algorithm was found and all @@ -3856,30 +3855,25 @@ extract_high_half (scalar_int_mode mode, rtx op) return convert_modes (mode, wider_mode, op, 0); } -/* Like expmed_mult_highpart, but only consider using a multiplication - optab. OP1 is an rtx for the constant operand. */ +/* Like expmed_mult_highpart, but only consider using multiplication optab. */ -static rtx +rtx expmed_mult_highpart_optab (scalar_int_mode mode, rtx op0, rtx op1, rtx target, int unsignedp, int max_cost) { - rtx narrow_op1 = gen_int_mode (INTVAL (op1), mode); + const scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); + const bool speed = optimize_insn_for_speed_p (); + const int size = GET_MODE_BITSIZE (mode); optab moptab; rtx tem; - int size; - bool speed = optimize_insn_for_speed_p (); - - scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); - - size = GET_MODE_BITSIZE (mode); /* Firstly, try using a multiplication insn that only generates the needed high part of the product, and in the sign flavor of unsignedp. */ if (mul_highpart_cost (speed, mode) < max_cost) { moptab = unsignedp ? umul_highpart_optab : smul_highpart_optab; - tem = expand_binop (mode, moptab, op0, narrow_op1, target, - unsignedp, OPTAB_DIRECT); + tem = expand_binop (mode, moptab, op0, op1, target, unsignedp, + OPTAB_DIRECT); if (tem) return tem; } @@ -3892,12 +3886,12 @@ expmed_mult_highpart_optab (scalar_int_mode mode, rtx op0, rtx op1, + 4 * add_cost (speed, mode) < max_cost)) { moptab = unsignedp ? smul_highpart_optab : umul_highpart_optab; - tem = expand_binop (mode, moptab, op0, narrow_op1, target, - unsignedp, OPTAB_DIRECT); + tem = expand_binop (mode, moptab, op0, op1, target, !unsignedp, + OPTAB_DIRECT); if (tem) /* We used the wrong signedness. Adjust the result. */ - return expand_mult_highpart_adjust (mode, tem, op0, narrow_op1, - tem, unsignedp); + return expand_mult_highpart_adjust (mode, tem, op0, op1, tem, + unsignedp); } /* Try widening multiplication. */ @@ -3905,8 +3899,8 @@ expmed_mult_highpart_optab (scalar_int_mode mode, rtx op0, rtx op1, if (convert_optab_handler (moptab, wider_mode, mode) != CODE_FOR_nothing && mul_widen_cost (speed, wider_mode) < max_cost) { - tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0, - unsignedp, OPTAB_WIDEN); + tem = expand_binop (wider_mode, moptab, op0, op1, NULL_RTX, unsignedp, + OPTAB_WIDEN); if (tem) return extr
[gcc/aoliva/heads/testme] (668 commits) [testsuite] xfail pr79004 on longdouble64; drop long_double
The branch 'aoliva/heads/testme' was updated to point to: 7c0885519050... [testsuite] xfail pr79004 on longdouble64; drop long_double It previously pointed to: ec1d688d102c... adjust iteration count for ppc costmodel 76b Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): --- ec1d688... adjust iteration count for ppc costmodel 76b df13301... [testsuite] require sqrt_insn effective target where needed 22b9a80... xfail fetestexcept test - ppc always uses fcmpu b40c8c9... ppc: testsuite: pr79004 needs -mlong-double-128 1275905... ppc: testsuite: vec-mul requires vsx runtime 4c42bea... make -freg-struct-return visibly a negative alias of -fpcc- 7ef6054... add explicit ABI and align options to pr88233.c 760577d... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra 7d97712... decay vect tests from run to link for pr95401 9cb06df... Request check for hw support in ppc run tests with -maltive 5b0e0d4... disable ldist for test, to restore vectorizing-candidate lo 6996207... [testsuite] [ppc64] expect error on vxworks too 0cbe329... [testsuite] [arm] add effective target and options for pacb Summary of changes (added commits): --- 7c08855... [testsuite] xfail pr79004 on longdouble64; drop long_double db37e04... [testsuite] cope with rtems implicit -ftls-model=local-exec b7483de... make -freg-struct-return visibly a negative alias of -fpcc- (*) d477d68... RISC-V: Cleanup some temporally files [NFC] (*) 0b2c333... Update gcc sv.po (*) 556e777... RISC-V: Enable vectorizable early exit testsuite (*) 6c1de78... RISC-V: Implement vectorizable early exit with vcond_mask_l (*) 96d5325... Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF (*) f3e5f4c... tree-optimization/13962 - handle ptr-ptr compares in ptrs_c (*) a9251ab... wrong code with points-to and volatile (*) 57f8a2f... Vect: Support loop len in vectorizable early exit (*) d4dee34... Vect: Support new IFN SAT_ADD for unsigned vector int (*) 52b0536... Internal-fn: Support new IFN SAT_ADD for unsigned scalar in (*) da73261... Revert "Revert: "Enable prange support."" (*) b8e3574... Cleanup prange sanity checks. (*) f6bed6d... Use a boolean type when folding conditionals in simplify_us (*) b8b82bb... RISC-V: testsuite: Drop march-string in cmpmemsi/cpymemsi t (*) 1e0ae1f... tree-optimization/79958 - make DSE track multiple paths (*) bff5328... ada: Remove obsolete reference in comment (*) f72988a... ada: Reset scope of top level object declaration during unn (*) 584ade0... ada: Redundant validity checks (*) 9ec20f1... ada: Exception on Indefinite_Vector aggregate with loop_par (*) 568c795... ada: Implement new experimental attribute 'Super (*) 33ae453... ada: Fix reference to RM clause in comment (*) 5c9205a... ada: Fix missing length checks with case expressions (*) ea64884... ada: Fix standalone Windows builds of adaint.c (*) c3b570b... ada: Avoid checking parameters of protected procedures (*) c485a15... ada: Ignore ghost nodes in call graph information for dispa (*) a802cb3... ada: Fix reason code for length check (*) 8e22376... ada: Propagate Program_Error from failed finalization of co (*) 55d11e8... ada: Improve recovery from illegal occurrence of 'Old in if (*) f5c7870... ada: No need to follow New_Occurrence_Of with Set_Etype (*) 7d2a5db... ada: Fix detection of if_expressions that are known on entr (*) fa832b4... ada: Fix comments about Get_Ranged_Checks (*) 8560a06... ada: Minor performance improvement for dynamically-allocate (*) 513f6b8... ada: Fixup one more pattern of broken scope information (*) bc35098... ada: Fix typo in CUDA error message (*) 4806875... ada: Fix latent alignment issue for dynamically-allocated c (*) b98e256... ada: Fix resolving tagged operations in array aggregates (*) 81a5815... ada: Fix bogus error on function returning noncontrolling r (*) 7c487eb... ada: Fix casing of CUDA in error messages (*) f039057... ada: Fix crash with -gnatdJ and -gnatw_q (*) a58b6be... ada: Follow up fixes for Put_Image/streaming regressions (*) 50a... ada: Implement per-finalization-collection spinlocks (*) 91c6302... ada: Formal_Derived_Type'Size is not static (*) e730d52... ada: Fix bug in maintaining dimension info (*) 8b73cb9... ada: Remove Aspect_Specifications field from N_Procedure_Sp (*) 0607818... ada: Reuse existing expression when rewriting aspects to pr (*) 492f896... ada: Cleanup reporting locations for Ada 2022 and GNAT exte (*) 1d992c4... ada: Fix alphabetic ordering of aspect identifiers (*) 61751ee... ada: Fix ordering of code for pragma Preelaborable_Initiali (*) 3549a58... ada: Fix casing in error messages (*) fd3a9ee... ada: Fix docs and comments about pragmas for Boolean-valued (*) e656656... diagnostics: use unicode art for interprocedural depth (*)
[gcc(refs/users/aoliva/heads/testme)] [testsuite] cope with rtems implicit -ftls-model=local-exec
https://gcc.gnu.org/g:db37e042c4b3ab0fc594c207a4ebe34ed84350d7 commit db37e042c4b3ab0fc594c207a4ebe34ed84350d7 Author: Alexandre Oliva Date: Fri May 17 02:02:08 2024 -0300 [testsuite] cope with rtems implicit -ftls-model=local-exec gcc/config/rtems.h's OS_CC1_SPEC changes the -ftls-model default to local-exec, which breaks some tests that compile with PIC and thus expect dynamic TLS access models. I assume the default overriding even with PIC is intended, so I'm adjusting the testcases. For those in gcc.dg/tls, I adjusted the ipa dump expectations, so that they check for tls-local- only, which covers both -dynamic and -exec. For those in g{cc,++}.target/aarch64/sve, I've added a -ftls-local overrider, so that the expected opcodes for dynamic TLS are generated. for gcc/testsuite/ChangeLog * gcc.dg/tls/vis-attr-hidden.c: Match tls-local- for both -dynamic and -exec. Note rtems's default. * gcc.dg/tls/vis-flag-hidden.c: Likewise. * gcc.dg/tls/vis-pragma-hidden.c: Likewise. * gcc.target/aarch64/sve/tls_1.c: Override -ftls-model default on rtems. * gcc.target/aarch64/sve/tls_preserve_2.c: Likewise. * gcc.target/aarch64/sve/tls_preserve_3.c: Likewise. * g++.target/aarch64/sve/tls_2.C: Likewise. Diff: --- gcc/testsuite/g++.target/aarch64/sve/tls_2.C | 1 + gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c| 3 ++- gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c| 3 ++- gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c | 3 ++- gcc/testsuite/gcc.target/aarch64/sve/tls_1.c | 1 + gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c | 1 + gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_3.c | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/g++.target/aarch64/sve/tls_2.C b/gcc/testsuite/g++.target/aarch64/sve/tls_2.C index a1a2c85e5910..23004d9984d5 100644 --- a/gcc/testsuite/g++.target/aarch64/sve/tls_2.C +++ b/gcc/testsuite/g++.target/aarch64/sve/tls_2.C @@ -2,6 +2,7 @@ /* { dg-require-effective-target tls } */ /* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */ /* { dg-require-effective-target fpic } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ #include diff --git a/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c index 0d43fc565b09..007d382fa9a0 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c @@ -9,4 +9,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c index a15df092d4d0..baf248dc3bab 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c @@ -9,4 +9,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c index 1be97644243a..50cd010924cf 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c @@ -13,4 +13,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c b/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c index 43c52bc2b906..71f354dfe1b4 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c @@ -1,5 +1,6 @@ /* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */ /* { dg-require-effective-target fpic } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ typedef unsigned int v8si __attribute__((vector_size(32))); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c index 20e939fbb85b..1f477ba8c259 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c @@ -2,6 +2,7 @@ /* { dg-options "-O3 -fpic -msve-vector-bits=256 -fno-schedule-insns" } */ /* { dg-require-effective-target fpic } */ /* { dg-
[gcc(refs/users/aoliva/heads/testme)] [testsuite] xfail pr79004 on longdouble64; drop long_double_64bit
https://gcc.gnu.org/g:7c08855190502bca6a1e59577ffe304677f126ed commit 7c08855190502bca6a1e59577ffe304677f126ed Author: Alexandre Oliva Date: Fri May 17 06:40:10 2024 -0300 [testsuite] xfail pr79004 on longdouble64; drop long_double_64bit Diff: --- gcc/testsuite/gcc.target/powerpc/pr79004.c | 14 +- gcc/testsuite/lib/target-supports.exp | 43 -- 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/pr79004.c b/gcc/testsuite/gcc.target/powerpc/pr79004.c index caf1f6c1eefe..2cb8bf4bc14b 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr79004.c +++ b/gcc/testsuite/gcc.target/powerpc/pr79004.c @@ -100,10 +100,12 @@ void to_uns_short_store_n (TYPE a, unsigned short *p, long n) { p[n] = (unsigned void to_uns_int_store_n (TYPE a, unsigned int *p, long n) { p[n] = (unsigned int)a; } void to_uns_long_store_n (TYPE a, unsigned long *p, long n) { p[n] = (unsigned long)a; } -/* { dg-final { scan-assembler-not {\mbl __} } } */ -/* { dg-final { scan-assembler {\mxscvdpqp\M} } } */ -/* { dg-final { scan-assembler {\mxscvqpdp\M} } } */ -/* { dg-final { scan-assembler {\mxscvqpdpo\M} } } */ +/* On targets with 64-bit long double, some opcodes to deal with __float128 are + disabled, see PR target/105359. */ +/* { dg-final { scan-assembler-not {\mbl __} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvdpqp\M} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvqpdp\M} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvqpdpo\M} { xfail longdouble64 } } } */ /* { dg-final { scan-assembler {\mxscvqpsdz\M} } } */ /* { dg-final { scan-assembler {\mxscvqpswz\M} } } */ /* { dg-final { scan-assembler {\mxscvsdqp\M} } } */ @@ -111,7 +113,7 @@ void to_uns_long_store_n (TYPE a, unsigned long *p, long n) { p[n] = (unsigned l /* { dg-final { scan-assembler {\mlxsd\M} } } */ /* { dg-final { scan-assembler {\mlxsiwax\M} } } */ /* { dg-final { scan-assembler {\mlxsiwzx\M} } } */ -/* { dg-final { scan-assembler {\mlxssp\M} } } */ +/* { dg-final { scan-assembler {\mlxssp\M} { xfail longdouble64 } } } */ /* { dg-final { scan-assembler {\mstxsd\M} } } */ /* { dg-final { scan-assembler {\mstxsiwx\M} } } */ -/* { dg-final { scan-assembler {\mstxssp\M}} } */ +/* { dg-final { scan-assembler {\mstxssp\M}{ xfail longdouble64 } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ec9baa4f32a3..dc7d4f2b5f39 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2930,49 +2930,6 @@ proc add_options_for_long_double_ieee128 { flags } { return "$flags" } -# Check if GCC and GLIBC supports explicitly specifying that the long double -# format uses the IEEE 64-bit. Under little endian PowerPC Linux, you need -# GLIBC 2.32 or later to be able to use a different long double format for -# running a program than the system default. - -proc check_effective_target_long_double_64bit { } { -return [check_runtime_nocache long_double_64bit { - #include - #include - /* use volatile to prevent optimization. */ - volatile double a = 3.0; - volatile long double one = 1.0L; - volatile long double two = 2.0L; - volatile long double b; - char buffer[20]; - int main() - { - double a2; - long double b2; - if (sizeof (long double) != 8) - return 1; - b = one + two; - /* eliminate removing volatile cast warning. */ - a2 = a; - b2 = b; - if (memcmp (&a2, &b2, 16) != 0) - return 1; - sprintf (buffer, "%lg", b); - return strcmp (buffer, "3") != 0; - } -} [add_options_for_ppc_long_double_override_64bit ""]] -} - -# Return the appropriate options to specify that long double uses the IEEE -# 64-bit format on PowerPC. - -proc add_options_for_long_double_64bit { flags } { -if { [istarget powerpc*-*-*] } { - return "$flags -mlong-double-64" -} -return "$flags" -} - # Return 1 if the target supports executing VSX instructions, 0 # otherwise. Cache the result.
[gcc/aoliva/heads/testbase] (666 commits) make -freg-struct-return visibly a negative alias of -fpcc-
The branch 'aoliva/heads/testbase' was updated to point to: b7483de99536... make -freg-struct-return visibly a negative alias of -fpcc- It previously pointed to: f17d31e709af... Fortran: Detect 'no implicit type' error in right place [PR Diff: Summary of changes (added commits): --- b7483de... make -freg-struct-return visibly a negative alias of -fpcc- (*) d477d68... RISC-V: Cleanup some temporally files [NFC] (*) 0b2c333... Update gcc sv.po (*) 556e777... RISC-V: Enable vectorizable early exit testsuite (*) 6c1de78... RISC-V: Implement vectorizable early exit with vcond_mask_l (*) 96d5325... Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF (*) f3e5f4c... tree-optimization/13962 - handle ptr-ptr compares in ptrs_c (*) a9251ab... wrong code with points-to and volatile (*) 57f8a2f... Vect: Support loop len in vectorizable early exit (*) d4dee34... Vect: Support new IFN SAT_ADD for unsigned vector int (*) 52b0536... Internal-fn: Support new IFN SAT_ADD for unsigned scalar in (*) da73261... Revert "Revert: "Enable prange support."" (*) b8e3574... Cleanup prange sanity checks. (*) f6bed6d... Use a boolean type when folding conditionals in simplify_us (*) b8b82bb... RISC-V: testsuite: Drop march-string in cmpmemsi/cpymemsi t (*) 1e0ae1f... tree-optimization/79958 - make DSE track multiple paths (*) bff5328... ada: Remove obsolete reference in comment (*) f72988a... ada: Reset scope of top level object declaration during unn (*) 584ade0... ada: Redundant validity checks (*) 9ec20f1... ada: Exception on Indefinite_Vector aggregate with loop_par (*) 568c795... ada: Implement new experimental attribute 'Super (*) 33ae453... ada: Fix reference to RM clause in comment (*) 5c9205a... ada: Fix missing length checks with case expressions (*) ea64884... ada: Fix standalone Windows builds of adaint.c (*) c3b570b... ada: Avoid checking parameters of protected procedures (*) c485a15... ada: Ignore ghost nodes in call graph information for dispa (*) a802cb3... ada: Fix reason code for length check (*) 8e22376... ada: Propagate Program_Error from failed finalization of co (*) 55d11e8... ada: Improve recovery from illegal occurrence of 'Old in if (*) f5c7870... ada: No need to follow New_Occurrence_Of with Set_Etype (*) 7d2a5db... ada: Fix detection of if_expressions that are known on entr (*) fa832b4... ada: Fix comments about Get_Ranged_Checks (*) 8560a06... ada: Minor performance improvement for dynamically-allocate (*) 513f6b8... ada: Fixup one more pattern of broken scope information (*) bc35098... ada: Fix typo in CUDA error message (*) 4806875... ada: Fix latent alignment issue for dynamically-allocated c (*) b98e256... ada: Fix resolving tagged operations in array aggregates (*) 81a5815... ada: Fix bogus error on function returning noncontrolling r (*) 7c487eb... ada: Fix casing of CUDA in error messages (*) f039057... ada: Fix crash with -gnatdJ and -gnatw_q (*) a58b6be... ada: Follow up fixes for Put_Image/streaming regressions (*) 50a... ada: Implement per-finalization-collection spinlocks (*) 91c6302... ada: Formal_Derived_Type'Size is not static (*) e730d52... ada: Fix bug in maintaining dimension info (*) 8b73cb9... ada: Remove Aspect_Specifications field from N_Procedure_Sp (*) 0607818... ada: Reuse existing expression when rewriting aspects to pr (*) 492f896... ada: Cleanup reporting locations for Ada 2022 and GNAT exte (*) 1d992c4... ada: Fix alphabetic ordering of aspect identifiers (*) 61751ee... ada: Fix ordering of code for pragma Preelaborable_Initiali (*) 3549a58... ada: Fix casing in error messages (*) fd3a9ee... ada: Fix docs and comments about pragmas for Boolean-valued (*) e656656... diagnostics: use unicode art for interprocedural depth (*) 0b7ebe5... diagnostics: add warning emoji to events with VERB_danger (*) 3cd2674... diagnostics: simplify output of purely intraprocedural exec (*) a7be993... diagnostics: handle SGR codes in line_label::m_display_widt (*) 38dd4e2... RISC-V: Add Zvfbfwma extension to the -march= option (*) 090714e... Set d.one_operand_p to true when TARGET_SSSE3 in ix86_expan (*) 0cc0956... Optimize ashift >> 7 to vpcmpgtb for vector int8. (*) 25456c0... Daily bump. (*) d7e6fe0... Add missing hunk in recent change. (*) 1779e22... analyzer: fix ICE seen with -fsanitize=undefined [PR114899] (*) 1fbbae1... [v2,2/2] RISC-V: strcmp expansion: Use adjust_address() for (*) 4bf1aa1... [v2,1/2] RISC-V: Add cmpmemsi expansion (*) 1a05332... c++: ICE with reference NSDMI [PR114854] (*) 0b3eac4... c++: DR 569, DR 1693: fun with semicolons [PR113760] (*) 6ad7ca1... c++: Optimize in maybe_clone_body aliases even when not at_ (*) 0b93a0a... combine: Fix up simplify_compare_const [PR115092] (*) 7fdbefc... openmp: Diagnose using grainsize+num_tasks clauses together (*) 99b1daa... tree-optimization/114589 - r
[gcc r15-626] middle-end/115110 - Fix view_converted_memref_p
https://gcc.gnu.org/g:a5b3721c06646bf5b9b50a22964e8e2bd4d03f5f commit r15-626-ga5b3721c06646bf5b9b50a22964e8e2bd4d03f5f Author: Richard Biener Date: Fri May 17 11:02:29 2024 +0200 middle-end/115110 - Fix view_converted_memref_p view_converted_memref_p was checking the reference type against the pointer type of the offset operand rather than its pointed-to type which leads to all refs being subject to view-convert treatment in get_alias_set causing numerous testsuite fails but with its new uses from r15-512-g9b7cad5884f21c is also a wrong-code issue. PR middle-end/115110 * tree-ssa-alias.cc (view_converted_memref_p): Fix. Diff: --- gcc/tree-ssa-alias.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index 9f5f69bcfad2..d64d6d02f4a8 100644 --- a/gcc/tree-ssa-alias.cc +++ b/gcc/tree-ssa-alias.cc @@ -2077,8 +2077,9 @@ view_converted_memref_p (tree base) { if (TREE_CODE (base) != MEM_REF && TREE_CODE (base) != TARGET_MEM_REF) return false; - return same_type_for_tbaa (TREE_TYPE (base), -TREE_TYPE (TREE_OPERAND (base, 1))) != 1; + return (same_type_for_tbaa (TREE_TYPE (base), + TREE_TYPE (TREE_TYPE (TREE_OPERAND (base, 1 + != 1); } /* Return true if an indirect reference based on *PTR1 constrained
[gcc r14-10214] tree-optimization/114998 - use-after-free with loop distribution
https://gcc.gnu.org/g:1e9ae50d4d160f6d557fc4cbbe95c4a36897c09f commit r14-10214-g1e9ae50d4d160f6d557fc4cbbe95c4a36897c09f Author: Richard Biener Date: Fri May 10 14:19:49 2024 +0200 tree-optimization/114998 - use-after-free with loop distribution When loop distribution releases a PHI node of the original IL it can end up clobbering memory that's re-used when it upon releasing its RDG resets all stmt UIDs back to -1, even those that got released. The fix is to avoid resetting UIDs based on stmts in the RDG but instead reset only those still present in the loop. PR tree-optimization/114998 * tree-loop-distribution.cc (free_rdg): Take loop argument. Reset UIDs of stmts still in the IL rather than all stmts referenced from the RDG. (loop_distribution::build_rdg): Pass loop to free_rdg. (loop_distribution::distribute_loop): Likewise. (loop_distribution::transform_reduction_loop): Likewise. * gcc.dg/torture/pr114998.c: New testcase. (cherry picked from commit 34d15a4d630a0d54eddb99bdab086c506e10dac5) Diff: --- gcc/testsuite/gcc.dg/torture/pr114998.c | 35 + gcc/tree-loop-distribution.cc | 24 -- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/gcc.dg/torture/pr114998.c b/gcc/testsuite/gcc.dg/torture/pr114998.c new file mode 100644 index ..81fc1e077cb9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr114998.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fno-tree-dce -ftree-loop-distribution" } */ + +short a, d; +int b, c, f, g, h, i, j[2], o; +__attribute__((const)) int s(char r); +int main() { + int l, m, k, n; + if (b) { +char p; +for (; p >= 0; p--) { + int e[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0}; + if (j[p]) { +int q[1]; +i = o; +o = q[h]; +if (g) + n = d; +m = 4; +for (; m; m--) { + if (l) +k |= c; + if (a) +break; +} + } + s(n); + f |= b; +} + } + return 0; +} diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc index 95203fefa188..45932bae5e7f 100644 --- a/gcc/tree-loop-distribution.cc +++ b/gcc/tree-loop-distribution.cc @@ -778,7 +778,7 @@ loop_distribution::stmts_from_loop (class loop *loop, vec *stmts) /* Free the reduced dependence graph RDG. */ static void -free_rdg (struct graph *rdg) +free_rdg (struct graph *rdg, loop_p loop) { int i; @@ -792,13 +792,25 @@ free_rdg (struct graph *rdg) if (v->data) { - gimple_set_uid (RDGV_STMT (v), -1); (RDGV_DATAREFS (v)).release (); free (v->data); } } free_graph (rdg); + + /* Reset UIDs of stmts still in the loop. */ + basic_block *bbs = get_loop_body (loop); + for (unsigned i = 0; i < loop->num_nodes; ++i) +{ + basic_block bb = bbs[i]; + gimple_stmt_iterator gsi; + for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + gimple_set_uid (gsi_stmt (gsi), -1); + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + gimple_set_uid (gsi_stmt (gsi), -1); +} + free (bbs); } struct graph * @@ -812,7 +824,7 @@ loop_distribution::build_rdg (class loop *loop, control_dependences *cd) rdg = new_graph (stmts.length ()); if (!create_rdg_vertices (rdg, stmts, loop)) { - free_rdg (rdg); + free_rdg (rdg, loop); return NULL; } stmts.release (); @@ -3062,7 +3074,7 @@ loop_distribution::distribute_loop (class loop *loop, "Loop %d not distributed: too many memory references.\n", loop->num); - free_rdg (rdg); + free_rdg (rdg, loop); loop_nest.release (); free_data_refs (datarefs_vec); delete ddrs_table; @@ -3259,7 +3271,7 @@ loop_distribution::distribute_loop (class loop *loop, FOR_EACH_VEC_ELT (partitions, i, partition) partition_free (partition); - free_rdg (rdg); + free_rdg (rdg, loop); return nbp - *nb_calls; } @@ -3665,7 +3677,7 @@ loop_distribution::transform_reduction_loop (loop_p loop) auto_bitmap partition_stmts; bitmap_set_range (partition_stmts, 0, rdg->n_vertices); find_single_drs (loop, rdg, partition_stmts, &store_dr, &load_dr); - free_rdg (rdg); + free_rdg (rdg, loop); /* Bail out if there is no single load. */ if (load_dr == NULL)
[gcc r12-10453] debug/112718 - reset all type units with -ffat-lto-objects
https://gcc.gnu.org/g:1f41e8eef3da1d76c18fe1a93846054c53dc5a47 commit r12-10453-g1f41e8eef3da1d76c18fe1a93846054c53dc5a47 Author: Richard Biener Date: Mon Jan 22 15:42:59 2024 +0100 debug/112718 - reset all type units with -ffat-lto-objects When mixing -flto, -ffat-lto-objects and -fdebug-type-section we fail to reset all type units after early output resulting in an ICE when attempting to add then duplicate sibling attributes. PR debug/112718 * dwarf2out.cc (dwarf2out_finish): Reset all type units for the fat part of an LTO compile. * gcc.dg/debug/pr112718.c: New testcase. (cherry picked from commit 7218f5050cb7163edae331f54ca163248ab48bfa) Diff: --- gcc/dwarf2out.cc | 12 gcc/testsuite/gcc.dg/debug/pr112718.c | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index d14ec0261b6b..cfe87cba4c4c 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -32162,24 +32162,12 @@ dwarf2out_finish (const char *filename) reset_dies (comp_unit_die ()); for (limbo_die_node *node = cu_die_list; node; node = node->next) reset_dies (node->die); - - hash_table comdat_type_table (100); for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next) { - comdat_type_node **slot - = comdat_type_table.find_slot (ctnode, INSERT); - - /* Don't reset types twice. */ - if (*slot != HTAB_EMPTY_ENTRY) - continue; - /* Remove the pointer to the line table. */ remove_AT (ctnode->root_die, DW_AT_stmt_list); - if (debug_info_level >= DINFO_LEVEL_TERSE) reset_dies (ctnode->root_die); - - *slot = ctnode; } /* Reset die CU symbol so we don't output it twice. */ diff --git a/gcc/testsuite/gcc.dg/debug/pr112718.c b/gcc/testsuite/gcc.dg/debug/pr112718.c new file mode 100644 index ..ff80ca5a2981 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr112718.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lto } */ +/* { dg-options "-g -fdebug-types-section -flto -ffat-lto-objects" } */ + +struct { + int h; + unsigned char data[20 + 24 * 6]; +} _EC_X9_62_PRIME_192V2; +struct { + int h; + unsigned char data[20 + 24 * 6]; +} _EC_X9_62_PRIME_192V3;
[gcc r12-10452] tree-optimization/112793 - SLP of constant/external code-generated twice
https://gcc.gnu.org/g:9bad5cf9ae446b367f666176537eb76e94cc4448 commit r12-10452-g9bad5cf9ae446b367f666176537eb76e94cc4448 Author: Richard Biener Date: Wed Dec 13 14:23:31 2023 +0100 tree-optimization/112793 - SLP of constant/external code-generated twice The following makes the attempt at code-generating a constant/external SLP node twice well-formed as that can happen when partitioning BB vectorization attempts where we keep constants/externals unpartitioned. PR tree-optimization/112793 * tree-vect-slp.cc (vect_schedule_slp_node): Already code-generated constant/external nodes are OK. * g++.dg/vect/pr112793.cc: New testcase. (cherry picked from commit d782ec8362eadc3169286eb1e39c631effd02323) Diff: --- gcc/testsuite/g++.dg/vect/pr112793.cc | 32 gcc/tree-vect-slp.cc | 16 +--- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/g++.dg/vect/pr112793.cc b/gcc/testsuite/g++.dg/vect/pr112793.cc new file mode 100644 index ..258d7c1b1119 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr112793.cc @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-require-effective-target c++11 } +// { dg-additional-options "-march=znver2" { target x86_64-*-* i?86-*-* } } + +typedef double T; +T c, s; +T a[16]; +struct Matrix4 { + Matrix4(){} + Matrix4(T e, T f, T i, T j) { +r[1] = r[4] = e; +r[5] = f; +r[8] = i; +r[9] = j; + } + Matrix4 operator*(Matrix4 a) { +return Matrix4( + r[0] * a.r[4] + r[4] + r[15] + r[6], + r[1] * a.r[4] + 1 + 2 + 3, r[0] * r[8] + 1 + 2 + 3, + r[1] * r[8] + r[1] + r[14] + r[2] * r[3]); + } + T r[16] = {}; +}; +Matrix4 t1, t2; +Matrix4 tt; +Matrix4 getRotAltAzToEquatorial() +{ + t2.r[4] = 0; + t1.r[1] = -s; + t1.r[8] = 0; + return t1 * t2; +} diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 26c989cbff9a..54e6a9e4224f 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -7240,12 +7240,6 @@ vect_schedule_slp_node (vec_info *vinfo, int i; slp_tree child; - /* For existing vectors there's nothing to do. */ - if (SLP_TREE_VEC_DEFS (node).exists ()) -return; - - gcc_assert (SLP_TREE_VEC_STMTS (node).is_empty ()); - /* Vectorize externals and constants. */ if (SLP_TREE_DEF_TYPE (node) == vect_constant_def || SLP_TREE_DEF_TYPE (node) == vect_external_def) @@ -7256,10 +7250,18 @@ vect_schedule_slp_node (vec_info *vinfo, if (!SLP_TREE_VECTYPE (node)) return; - vect_create_constant_vectors (vinfo, node); + /* There are two reasons vector defs might already exist. The first +is that we are vectorizing an existing vector def. The second is +when performing BB vectorization shared constant/external nodes +are not split apart during partitioning so during the code-gen +DFS walk we can end up visiting them twice. */ + if (! SLP_TREE_VEC_DEFS (node).exists ()) + vect_create_constant_vectors (vinfo, node); return; } + gcc_assert (SLP_TREE_VEC_DEFS (node).is_empty ()); + stmt_vec_info stmt_info = SLP_TREE_REPRESENTATIVE (node); gcc_assert (SLP_TREE_NUMBER_OF_VEC_STMTS (node) != 0);
[gcc r12-10455] tree-optimization/112495 - alias versioning and address spaces
https://gcc.gnu.org/g:dbb5273996259b04350a1e3d35e633c51fc9310f commit r12-10455-gdbb5273996259b04350a1e3d35e633c51fc9310f Author: Richard Biener Date: Mon Nov 13 10:20:37 2023 +0100 tree-optimization/112495 - alias versioning and address spaces We are not correctly handling differing address spaces in dependence analysis runtime alias check generation so refuse to do that. PR tree-optimization/112495 * tree-data-ref.cc (runtime_alias_check_p): Reject checks between different address spaces. * gcc.target/i386/pr112495.c: New testcase. (cherry picked from commit 0f593c0521caab8cfac53514b1a5e7d0d0dd1932) Diff: --- gcc/testsuite/gcc.target/i386/pr112495.c | 12 gcc/tree-data-ref.cc | 7 +++ 2 files changed, 19 insertions(+) diff --git a/gcc/testsuite/gcc.target/i386/pr112495.c b/gcc/testsuite/gcc.target/i386/pr112495.c new file mode 100644 index ..21afbaa6945d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr112495.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +typedef struct { int v; } T1; +typedef struct { T1 v[32]; } T2; + +T1 s; +T1 f1() { return s; } + +void f2(__seg_gs T2 *p, int n) { + for (int i = 0; i < n; ++i) p->v[i] = f1(); +} diff --git a/gcc/tree-data-ref.cc b/gcc/tree-data-ref.cc index 397792c3584c..0df4a3525f4c 100644 --- a/gcc/tree-data-ref.cc +++ b/gcc/tree-data-ref.cc @@ -1632,6 +1632,13 @@ runtime_alias_check_p (ddr_p ddr, class loop *loop, bool speed_p) "runtime alias check not supported for" " outer loop.\n"); + /* FORNOW: We don't support handling different address spaces. */ + if (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (DR_BASE_ADDRESS (DDR_A (ddr) + != TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (DR_BASE_ADDRESS (DDR_B (ddr)) +return opt_result::failure_at (DR_STMT (DDR_A (ddr)), + "runtime alias check between different " + "address spaces not supported.\n"); + return opt_result::success (); }
[gcc r12-10457] tree-optimization/111039 - abnormals and bit test merging
https://gcc.gnu.org/g:47e6bff94d980e2fcb6bcb42df04d3b73bd67da7 commit r12-10457-g47e6bff94d980e2fcb6bcb42df04d3b73bd67da7 Author: Richard Biener Date: Thu Aug 17 13:10:14 2023 +0200 tree-optimization/111039 - abnormals and bit test merging The following guards the bit test merging code in if-combine against the appearance of SSA names used in abnormal PHIs. PR tree-optimization/111039 * tree-ssa-ifcombine.cc (ifcombine_ifandif): Check for SSA_NAME_OCCURS_IN_ABNORMAL_PHI. * gcc.dg/pr111039.c: New testcase. (cherry picked from commit 482551a79a3d3f107f6239679ee74655cfe8707e) Diff: --- gcc/testsuite/gcc.dg/pr111039.c | 15 +++ gcc/tree-ssa-ifcombine.cc | 7 +++ 2 files changed, 22 insertions(+) diff --git a/gcc/testsuite/gcc.dg/pr111039.c b/gcc/testsuite/gcc.dg/pr111039.c new file mode 100644 index ..bec9983b35f8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr111039.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +int _setjmp (); +void abcd (); +void abcde (); +void compiler_corruption_function(int flags) +{ + int nowait = flags & 1048576, isexpand = flags & 8388608; + abcd(); + _setjmp(flags); + if (nowait && isexpand) +flags &= 0; + abcde(); +} diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc index ce9bbebf9480..b139328af224 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.cc @@ -415,6 +415,9 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv, { tree t, t2; + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name1)) + return false; + /* Do it. */ gsi = gsi_for_stmt (inner_cond); t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (name1), @@ -465,6 +468,10 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv, gimple_stmt_iterator gsi; tree t; + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name1) + || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name2)) + return false; + /* Find the common name which is bit-tested. */ if (name1 == name2) ;
[gcc r15-627] [prange] Avoid looking at type() for undefined ranges
https://gcc.gnu.org/g:bc6e336cb7c85094ddc77757be97c3d8588f35ca commit r15-627-gbc6e336cb7c85094ddc77757be97c3d8588f35ca Author: Aldy Hernandez Date: Fri May 17 10:30:03 2024 +0200 [prange] Avoid looking at type() for undefined ranges Undefined ranges have no type. This patch fixes the thinko. gcc/ChangeLog: PR middle-end/115128 * ipa-cp.cc (ipa_value_range_from_jfunc): Check for undefined_p before looking at type. (propagate_vr_across_jump_function): Same. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr115128.c: New test. Diff: --- gcc/ipa-cp.cc| 4 gcc/testsuite/gcc.dg/tree-ssa/pr115128.c | 31 +++ 2 files changed, 35 insertions(+) diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 09cab7618226..408166b8044b 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -1744,6 +1744,8 @@ ipa_value_range_from_jfunc (vrange &vr, pointer type to hold the result instead of a boolean type. Avoid trapping in the sanity check in fold_range until this is fixed. */ + || srcvr.undefined_p () + || op_vr.undefined_p () || !handler.operand_check_p (vr_type, srcvr.type (), op_vr.type ()) || !handler.fold_range (op_res, vr_type, srcvr, op_vr)) op_res.set_varying (vr_type); @@ -2556,6 +2558,8 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc, pointer type to hold the result instead of a boolean type. Avoid trapping in the sanity check in fold_range until this is fixed. */ + || src_lats->m_value_range.m_vr.undefined_p () + || op_vr.undefined_p () || !handler.operand_check_p (operand_type, src_lats->m_value_range.m_vr.type (), op_vr.type ()) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c new file mode 100644 index ..14bd4dbd6e51 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -w" } */ + +long XXH3_len_4to8_64b_len, XXH3_len_0to16_64b___trans_tmp_3, XXH3_mix2Accs_acc, +XXH3_64bits_internal___trans_tmp_8; +typedef unsigned long XXH3_hashLong64_f(); +void *XXH3_64bits_internal_input; +int XXH3_64bits_internal___trans_tmp_1; +void XXH3_mul128_fold64(); +static void XXH3_mergeAccs(unsigned long) { + for (;;) +XXH3_mul128_fold64(XXH3_mix2Accs_acc); +} +static __attribute__((noinline)) unsigned long +XXH3_hashLong_64b_default(void *, unsigned long len) { + XXH3_mergeAccs(len * 7); +} +__attribute__((always_inline)) long +XXH3_64bits_internal(unsigned long len, XXH3_hashLong64_f f_hashLong) { + if (len <= 16) { +long keyed = +XXH3_64bits_internal___trans_tmp_1 ^ XXH3_len_0to16_64b___trans_tmp_3; +XXH3_mul128_fold64(keyed, XXH3_len_4to8_64b_len); +return XXH3_64bits_internal___trans_tmp_8; + } + f_hashLong(XXH3_64bits_internal_input, len); +} +static void XXH_INLINE_XXH3_64bits(unsigned long len) { + XXH3_64bits_internal(len, XXH3_hashLong_64b_default); +} +void __cmplog_rtn_hook() { XXH_INLINE_XXH3_64bits(sizeof(long)); }
[gcc r12-10454] tree-optimization/112505 - bit-precision induction vectorization
https://gcc.gnu.org/g:4a71557fbebe3fb4031d1c2adc4f89c89a8c6c62 commit r12-10454-g4a71557fbebe3fb4031d1c2adc4f89c89a8c6c62 Author: Richard Biener Date: Thu Jan 11 14:00:33 2024 +0100 tree-optimization/112505 - bit-precision induction vectorization Vectorization of bit-precision inductions isn't implemented but we don't check this, instead we ICE during transform. PR tree-optimization/112505 * tree-vect-loop.cc (vectorizable_induction): Reject bit-precision induction. * gcc.dg/vect/pr112505.c: New testcase. (cherry picked from commit ec345df53556ec581590347f71c3d9ff3cdbca76) Diff: --- gcc/testsuite/gcc.dg/vect/pr112505.c | 14 ++ gcc/tree-vect-loop.cc| 9 + 2 files changed, 23 insertions(+) diff --git a/gcc/testsuite/gcc.dg/vect/pr112505.c b/gcc/testsuite/gcc.dg/vect/pr112505.c new file mode 100644 index ..56546c1095aa --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr112505.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O3" } */ + +short int w9; +struct T { + short a : 14; + int b; +}; +struct T v; +void zc() +{ + for(int i = 0; i < 4; i ++) +w9 *= v.b ? v.a-- < 0 : 0; +} diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 86ee9e449e19..fd0e5a70a962 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -8211,6 +8211,15 @@ vectorizable_induction (loop_vec_info loop_vinfo, step_expr = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (stmt_info); gcc_assert (step_expr != NULL_TREE); + if (INTEGRAL_TYPE_P (TREE_TYPE (step_expr)) + && !type_has_mode_precision_p (TREE_TYPE (step_expr))) +{ + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, +"bit-precision induction vectorization not " +"supported.\n"); + return false; +} tree step_vectype = get_same_sized_vectype (TREE_TYPE (step_expr), vectype); /* Check for backend support of PLUS/MINUS_EXPR. */
[gcc r12-10458] middle-end/110176 - wrong zext (bool) <= (int) 4294967295u folding
https://gcc.gnu.org/g:65e5547e5468ce404d0f9ebd646a1d63abf3a772 commit r12-10458-g65e5547e5468ce404d0f9ebd646a1d63abf3a772 Author: Richard Biener Date: Wed Jan 31 14:40:24 2024 +0100 middle-end/110176 - wrong zext (bool) <= (int) 4294967295u folding The following fixes a wrong pattern that didn't match the behavior of the original fold_widened_comparison in that get_unwidened returned a constant always in the wider type. But here we're using (int) 4294967295u without the conversion applied. Fixed by doing as earlier in the pattern - matching constants only if the conversion was actually applied. PR middle-end/110176 * match.pd (zext (bool) <= (int) 4294967295u): Make sure to match INTEGER_CST only without outstanding conversion. * gcc.dg/torture/pr110176.c: New testcase. (cherry picked from commit 22dbfbe8767ff4c1d93e39f68ec7c2d5b1358beb) Diff: --- gcc/match.pd| 12 - gcc/testsuite/gcc.dg/torture/pr110176.c | 46 + 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index 0938d56fa45f..45ed34205106 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -5379,19 +5379,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) >= TYPE_PRECISION (TREE_TYPE (@10))) && (TYPE_UNSIGNED (TREE_TYPE (@00)) == TYPE_UNSIGNED (TREE_TYPE (@10 - || (TREE_CODE (@10) == INTEGER_CST + || (TREE_CODE (@1) == INTEGER_CST && INTEGRAL_TYPE_P (TREE_TYPE (@00)) - && int_fits_type_p (@10, TREE_TYPE (@00) + && int_fits_type_p (@1, TREE_TYPE (@00) (cmp @00 (convert @10)) - (if (TREE_CODE (@10) == INTEGER_CST + (if (TREE_CODE (@1) == INTEGER_CST && INTEGRAL_TYPE_P (TREE_TYPE (@00)) - && !int_fits_type_p (@10, TREE_TYPE (@00))) + && !int_fits_type_p (@1, TREE_TYPE (@00))) (with { tree min = lower_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00)); tree max = upper_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00)); - bool above = integer_nonzerop (const_binop (LT_EXPR, type, max, @10)); - bool below = integer_nonzerop (const_binop (LT_EXPR, type, @10, min)); + bool above = integer_nonzerop (const_binop (LT_EXPR, type, max, @1)); + bool below = integer_nonzerop (const_binop (LT_EXPR, type, @1, min)); } (if (above || below) (if (cmp == EQ_EXPR || cmp == NE_EXPR) diff --git a/gcc/testsuite/gcc.dg/torture/pr110176.c b/gcc/testsuite/gcc.dg/torture/pr110176.c new file mode 100644 index ..e41e3a0c3a7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr110176.c @@ -0,0 +1,46 @@ +/* { dg-do run } */ + +int f(_Bool t) +{ +int tt = t; +unsigned x = -1; +int xx = x; +return xx <= tt; +} + +int a, b; +void c() {} +__attribute__((noipa)) +void h() {__builtin_abort();} +int d() { + unsigned f[1]; + int i; + if (a) +goto h; + f[0] = -1; + while (1) { +c(); +for (; a < 1; a++) { + if (0) { + j: +continue; + } + i = f[0]; + if (a) +break; + b = i >= (b == 0); +} +if (!b) { + if (0) { + h: +goto j; + } + return 0; +} +h(); + } +} +int main() { + d(); + return 0; +}
[gcc r12-10456] tree-optimization/112281 - loop distribution and zero dependence distances
https://gcc.gnu.org/g:5db4b5449df8f59a61438f8db1836dbc9b53f02e commit r12-10456-g5db4b5449df8f59a61438f8db1836dbc9b53f02e Author: Richard Biener Date: Mon Nov 20 13:39:52 2023 +0100 tree-optimization/112281 - loop distribution and zero dependence distances The following fixes an omission in dependence testing for loop distribution. When the overall dependence distance is not zero but the dependence direction in the innermost common loop is = there is a conflict between the partitions and we have to merge them. PR tree-optimization/112281 * tree-loop-distribution.cc (loop_distribution::pg_add_dependence_edges): For = in the innermost common loop record a partition conflict. * gcc.dg/torture/pr112281-1.c: New testcase. * gcc.dg/torture/pr112281-2.c: Likewise. (cherry picked from commit 3b34902417259031823bff7f853f615a60464bbd) Diff: --- gcc/testsuite/gcc.dg/torture/pr112281-1.c | 18 ++ gcc/testsuite/gcc.dg/torture/pr112281-2.c | 18 ++ gcc/tree-loop-distribution.cc | 18 ++ 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/gcc.dg/torture/pr112281-1.c b/gcc/testsuite/gcc.dg/torture/pr112281-1.c new file mode 100644 index ..711f5663195c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr112281-1.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-additional-options "-ftree-loop-distribution" } */ + +struct { + int : 8; + int a; +} b, d[4] = {{0}, {0}, {0}, {5}}; +int c, e; +int main() { + for (c = 2; c; c--) +for (e = 0; e < 2; e++) { + d[c] = b = d[c + 1]; + d[c + 1].a = 0; +} + if (b.a != 0) +__builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr112281-2.c b/gcc/testsuite/gcc.dg/torture/pr112281-2.c new file mode 100644 index ..d7671e3322b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr112281-2.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-additional-options "-ftree-loop-distribution" } */ + +struct { + int : 8; + int a; +} b, d[4] = {{5}, {0}, {0}, {0}}; +int c, e; +int main() { + for (c = 0; c < 2; c++) +for (e = 0; e < 2; e++) { + d[c + 1] = b = d[c]; + d[c].a = 0; +} + if (b.a != 0) +__builtin_abort(); + return 0; +} diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc index 606eb05e64a5..1b7d2a1ea7d2 100644 --- a/gcc/tree-loop-distribution.cc +++ b/gcc/tree-loop-distribution.cc @@ -2117,9 +2117,6 @@ loop_distribution::pg_add_dependence_edges (struct graph *rdg, int dir, } else if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE) { - if (DDR_REVERSED_P (ddr)) - this_dir = -this_dir; - /* Known dependences can still be unordered througout the iteration space, see gcc.dg/tree-ssa/ldist-16.c and gcc.dg/tree-ssa/pr94969.c. */ @@ -2132,7 +2129,20 @@ loop_distribution::pg_add_dependence_edges (struct graph *rdg, int dir, /* Else as the distance vector is lexicographic positive swap the dependence direction. */ else - this_dir = -this_dir; + { + if (DDR_REVERSED_P (ddr)) + this_dir = -this_dir; + this_dir = -this_dir; + + /* When then dependence distance of the innermost common +loop of the DRs is zero we have a conflict. */ + auto l1 = gimple_bb (DR_STMT (dr1))->loop_father; + auto l2 = gimple_bb (DR_STMT (dr2))->loop_father; + int idx = index_in_loop_nest (find_common_loop (l1, l2)->num, + DDR_LOOP_NEST (ddr)); + if (DDR_DIST_VECT (ddr, 0)[idx] == 0) + this_dir = 2; + } } else this_dir = 0;
[gcc r15-628] tree-into-ssa: speed up sorting in prune_unused_phi_nodes [PR114480]
https://gcc.gnu.org/g:4b9e68a6f3b22800a7f12b58ef6b25e3b339bb3c commit r15-628-g4b9e68a6f3b22800a7f12b58ef6b25e3b339bb3c Author: Alexander Monakov Date: Wed May 15 16:23:17 2024 +0300 tree-into-ssa: speed up sorting in prune_unused_phi_nodes [PR114480] In PR 114480 we are hitting a case where tree-into-ssa scales quadratically due to prune_unused_phi_nodes doing O(N log N) work for N basic blocks, for each variable individually. Sorting the 'defs' array is especially costly. It is possible to assist gcc_qsort by laying out dfs_out entries in the reverse order in the 'defs' array, starting from its tail. This is not always a win (in fact it flips most of 7-element qsorts in this testcase from 9 comparisons (best case) to 15 (worst case)), but overall it helps on the testcase and on libstdc++ build. On the testcase we go from 1.28e9 comparator invocations to 1.05e9, on libstdc++ from 2.91e6 to 2.84e6. gcc/ChangeLog: PR c++/114480 * tree-into-ssa.cc (prune_unused_phi_nodes): Add dfs_out entries to the 'defs' array in the reverse order. Diff: --- gcc/tree-into-ssa.cc | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc index 3732c269ca3d..5b367c358125 100644 --- a/gcc/tree-into-ssa.cc +++ b/gcc/tree-into-ssa.cc @@ -805,21 +805,22 @@ prune_unused_phi_nodes (bitmap phis, bitmap kills, bitmap uses) locate the nearest dominating def in logarithmic time by binary search.*/ bitmap_ior (to_remove, kills, phis); n_defs = bitmap_count_bits (to_remove); - defs = XNEWVEC (struct dom_dfsnum, 2 * n_defs + 1); + adef = 2 * n_defs + 1; + defs = XNEWVEC (struct dom_dfsnum, adef); defs[0].bb_index = 1; defs[0].dfs_num = 0; - adef = 1; + struct dom_dfsnum *head = defs + 1, *tail = defs + adef; EXECUTE_IF_SET_IN_BITMAP (to_remove, 0, i, bi) { def_bb = BASIC_BLOCK_FOR_FN (cfun, i); - defs[adef].bb_index = i; - defs[adef].dfs_num = bb_dom_dfs_in (CDI_DOMINATORS, def_bb); - defs[adef + 1].bb_index = i; - defs[adef + 1].dfs_num = bb_dom_dfs_out (CDI_DOMINATORS, def_bb); - adef += 2; + head->bb_index = i; + head->dfs_num = bb_dom_dfs_in (CDI_DOMINATORS, def_bb); + head++, tail--; + tail->bb_index = i; + tail->dfs_num = bb_dom_dfs_out (CDI_DOMINATORS, def_bb); } + gcc_checking_assert (head == tail); BITMAP_FREE (to_remove); - gcc_assert (adef == 2 * n_defs + 1); qsort (defs, adef, sizeof (struct dom_dfsnum), cmp_dfsnum); gcc_assert (defs[0].bb_index == 1);
[gcc r15-629] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator [PR115119]
https://gcc.gnu.org/g:c9e05b03c18e898be604ab90401476e9c473cc52 commit r15-629-gc9e05b03c18e898be604ab90401476e9c473cc52 Author: Jonathan Wakely Date: Thu May 16 17:15:55 2024 +0100 libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator [PR115119] libstdc++-v3/ChangeLog: PR libstdc++/115119 * include/bits/unicode.h (_Iterator::operator++(int)): Fix typo in increment expression. * testsuite/ext/unicode/grapheme_view.cc: Check post-increment on view's iterator. Diff: --- libstdc++-v3/include/bits/unicode.h | 6 -- libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc | 11 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index 46238143fb61..a14a17c5dfcf 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -34,10 +34,12 @@ #include #include // bit_width #include // __detail::__from_chars_alnum_to_val_table +#include #include #include #include -#include +#include // iterator_t, sentinel_t, input_range, etc. +#include // view_interface namespace std _GLIBCXX_VISIBILITY(default) { @@ -802,7 +804,7 @@ inline namespace __v15_1_0 operator++(int) { auto __tmp = *this; - ++this; + ++*this; return __tmp; } diff --git a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc index ac1e8c50b059..a3bb36e14b8e 100644 --- a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc +++ b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc @@ -83,10 +83,21 @@ test_breaks() VERIFY( iter == gv.end() ); } +constexpr void +test_pr115119() +{ + // PR 115119 Typo in _Grapheme_cluster_view::_Iterator::operator++(int) + uc::_Grapheme_cluster_view gv(" "sv); + auto it = std::ranges::begin(gv); + it++; + VERIFY( it == std::ranges::end(gv) ); +} + int main() { auto run_tests = []{ test_breaks(); +test_pr115119(); return true; };
[gcc r15-630] c++: aggregate CTAD w/ paren init and bases [PR115114]
https://gcc.gnu.org/g:5aaf47cb1987bbc5508c4b9b7dad5ea7d69af2c2 commit r15-630-g5aaf47cb1987bbc5508c4b9b7dad5ea7d69af2c2 Author: Patrick Palka Date: Fri May 17 09:02:52 2024 -0400 c++: aggregate CTAD w/ paren init and bases [PR115114] During aggregate CTAD with paren init, we're accidentally overlooking base classes since TYPE_FIELDS of a template type doesn't contain corresponding base fields. So we need to consider them separately. PR c++/115114 gcc/cp/ChangeLog: * pt.cc (maybe_aggr_guide): Consider bases in the paren init case. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-aggr15.C: New test. Reviewed-by: Jason Merrill Diff: --- gcc/cp/pt.cc | 7 +++ .../g++.dg/cpp2a/class-deduction-aggr15.C | 23 ++ 2 files changed, 30 insertions(+) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 32640f8e946d..e77c48e463e2 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -30200,6 +30200,13 @@ maybe_aggr_guide (tree tmpl, tree init, vec *args) else if (TREE_CODE (init) == TREE_LIST) { int len = list_length (init); + for (tree binfo : BINFO_BASE_BINFOS (TYPE_BINFO (template_type))) + { + if (!len) + break; + parms = tree_cons (NULL_TREE, BINFO_TYPE (binfo), parms); + --len; + } for (tree field = TYPE_FIELDS (template_type); len; --len, field = DECL_CHAIN (field)) diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr15.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr15.C new file mode 100644 index ..16dc0f52b64c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr15.C @@ -0,0 +1,23 @@ +// PR c++/115114 +// { dg-do compile { target c++20 } } + +struct X {} x; +struct Y {} y; + +template +struct A : T { + U m; +}; + +using ty1 = decltype(A{x, 42}); // OK +using ty1 = decltype(A(x, 42)); // OK, used to fail +using ty1 = A; + +template +struct B : T, V { + U m = 42; +}; + +using ty2 = decltype(B{x, y}); // OK +using ty2 = decltype(B(x, y)); // OK, used to fail +using ty2 = B;
[gcc r14-10215] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator [PR115119]
https://gcc.gnu.org/g:e909d360dfaeafa9f45eda2461a1bedffac99ac2 commit r14-10215-ge909d360dfaeafa9f45eda2461a1bedffac99ac2 Author: Jonathan Wakely Date: Thu May 16 17:15:55 2024 +0100 libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator [PR115119] libstdc++-v3/ChangeLog: PR libstdc++/115119 * include/bits/unicode.h (_Iterator::operator++(int)): Fix typo in increment expression. * testsuite/ext/unicode/grapheme_view.cc: Check post-increment on view's iterator. (cherry picked from commit c9e05b03c18e898be604ab90401476e9c473cc52) Diff: --- libstdc++-v3/include/bits/unicode.h | 6 -- libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc | 11 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index 46238143fb61..a14a17c5dfcf 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -34,10 +34,12 @@ #include #include // bit_width #include // __detail::__from_chars_alnum_to_val_table +#include #include #include #include -#include +#include // iterator_t, sentinel_t, input_range, etc. +#include // view_interface namespace std _GLIBCXX_VISIBILITY(default) { @@ -802,7 +804,7 @@ inline namespace __v15_1_0 operator++(int) { auto __tmp = *this; - ++this; + ++*this; return __tmp; } diff --git a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc index ac1e8c50b059..a3bb36e14b8e 100644 --- a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc +++ b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc @@ -83,10 +83,21 @@ test_breaks() VERIFY( iter == gv.end() ); } +constexpr void +test_pr115119() +{ + // PR 115119 Typo in _Grapheme_cluster_view::_Iterator::operator++(int) + uc::_Grapheme_cluster_view gv(" "sv); + auto it = std::ranges::begin(gv); + it++; + VERIFY( it == std::ranges::end(gv) ); +} + int main() { auto run_tests = []{ test_breaks(); +test_pr115119(); return true; };
[gcc r15-631] libstdc++: detect DLLs on windows with
https://gcc.gnu.org/g:d4635b504c73b653b815d2c2543c86c91b00e373 commit r15-631-gd4635b504c73b653b815d2c2543c86c91b00e373 Author: Björn Schäpers Date: Fri May 17 11:45:28 2024 +0100 libstdc++: detect DLLs on windows with libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_BACKTACE): Add check for tlhelp32.h, matching libbacktrace. * config.h.in: Regenerate. * configure: Regenerate. Signed-off-by: Björn Schäpers Diff: --- libstdc++-v3/acinclude.m4 | 5 + libstdc++-v3/config.h.in | 3 +++ libstdc++-v3/configure| 16 3 files changed, 24 insertions(+) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 51a08bcc8b1d..e04aae25360d 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5481,6 +5481,11 @@ AC_DEFUN([GLIBCXX_ENABLE_BACKTRACE], [ BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1" fi AC_CHECK_HEADERS(windows.h) + AC_CHECK_HEADERS(tlhelp32.h, [], [], + [#ifdef HAVE_WINDOWS_H + # include + #endif + ]) # Check for the fcntl function. if test -n "${with_target_subdir}"; then diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 906e0143099e..486ba4507499 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -490,6 +490,9 @@ /* Define to 1 if you have the `timespec_get' function. */ #undef HAVE_TIMESPEC_GET +/* Define to 1 if you have the header file. */ +#undef HAVE_TLHELP32_H + /* Define to 1 if the target supports thread-local storage. */ #undef HAVE_TLS diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 21abaeb07788..5179cc507f12 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -53865,6 +53865,22 @@ _ACEOF fi +done + + for ac_header in tlhelp32.h +do : + ac_fn_c_check_header_compile "$LINENO" "tlhelp32.h" "ac_cv_header_tlhelp32_h" "#ifdef HAVE_WINDOWS_H + # include + #endif + +" +if test "x$ac_cv_header_tlhelp32_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TLHELP32_H 1 +_ACEOF + +fi + done
[gcc r15-632] [prange] Drop range to VARYING if the bitmask intersection made it so [PR115131]
https://gcc.gnu.org/g:1accf4454a2ab57c4d681d1f6db332c46c61c058 commit r15-632-g1accf4454a2ab57c4d681d1f6db332c46c61c058 Author: Aldy Hernandez Date: Fri May 17 13:44:08 2024 +0200 [prange] Drop range to VARYING if the bitmask intersection made it so [PR115131] If the intersection of the bitmasks made the range span the entire domain, normalize the range to VARYING. gcc/ChangeLog: PR middle-end/115131 * value-range.cc (prange::intersect): Set VARYING if intersection of bitmasks made the range span the entire domain. (range_tests_misc): New test. Diff: --- gcc/value-range.cc | 21 + 1 file changed, 21 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 334ffb70fbc2..b38d6159a856 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -589,6 +589,11 @@ prange::intersect (const vrange &v) irange_bitmask new_bitmask = get_bitmask_from_range (m_type, m_min, m_max); m_bitmask.intersect (new_bitmask); m_bitmask.intersect (r.m_bitmask); + if (varying_compatible_p ()) +{ + set_varying (type ()); + return true; +} if (flag_checking) verify_range (); @@ -2889,6 +2894,22 @@ range_tests_misc () p0.invert (); ASSERT_TRUE (p0 == p1); + // The intersection of: + //[0, +INF] MASK 0xff..00 VALUE 0xf8 + //[0, +INF] MASK 0xff..00 VALUE 0x00 + // is [0, +INF] MASK 0xff..ff VALUE 0x00, which is VARYING. + // Test that we normalized to VARYING. + unsigned prec = TYPE_PRECISION (voidp); + p0.set_varying (voidp); + wide_int mask = wi::mask (8, true, prec); + wide_int value = wi::uhwi (0xf8, prec); + irange_bitmask bm (wi::uhwi (0xf8, prec), mask); + p0.update_bitmask (bm); + p1.set_varying (voidp); + bm = irange_bitmask (wi::zero (prec), mask); + p1.update_bitmask (bm); + p0.intersect (p1); + // [10,20] U [15, 30] => [10, 30]. r0 = range_int (10, 20); r1 = range_int (15, 30);
[gcc r15-633] Fortran: Fix select type regression due to r14-9489 [PR114874]
https://gcc.gnu.org/g:5f5074fe7aaf9524defb265299a985eecba7f914 commit r15-633-g5f5074fe7aaf9524defb265299a985eecba7f914 Author: Paul Thomas Date: Fri May 17 15:19:26 2024 +0100 Fortran: Fix select type regression due to r14-9489 [PR114874] 2024-05-17 Paul Thomas gcc/fortran PR fortran/114874 * gfortran.h: Add 'assoc_name_inferred' to gfc_namespace. * match.cc (gfc_match_select_type): Set 'assoc_name_inferred' in select type namespace if the selector has inferred type. * primary.cc (gfc_match_varspec): If a select type temporary is apparently scalar and a left parenthesis has been detected, check the current namespace has 'assoc_name_inferred' set. If so, set inferred_type. * resolve.cc (resolve_variable): If the namespace of a select type temporary is marked with 'assoc_name_inferred' call gfc_fixup_inferred_type_refs to ensure references are OK. (gfc_fixup_inferred_type_refs): Catch invalid array refs.. gcc/testsuite/ PR fortran/114874 * gfortran.dg/pr114874_1.f90: New test for valid code. * gfortran.dg/pr114874_2.f90: New test for invalid code. Diff: --- gcc/fortran/gfortran.h | 4 +++ gcc/fortran/match.cc | 21 + gcc/fortran/primary.cc | 10 +++--- gcc/fortran/resolve.cc | 17 +++--- gcc/testsuite/gfortran.dg/pr114874_1.f90 | 32 +++ gcc/testsuite/gfortran.dg/pr114874_2.f90 | 53 6 files changed, 128 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a7a0fdba3dd3..de1a7cd09352 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2242,6 +2242,10 @@ typedef struct gfc_namespace /* Set when resolve_types has been called for this namespace. */ unsigned types_resolved:1; + /* Set if the associate_name in a select type statement is an + inferred type. */ + unsigned assoc_name_inferred:1; + /* Set to 1 if code has been generated for this namespace. */ unsigned translated:1; diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index 4539c9bb1344..1851a8f94a54 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -6721,6 +6721,27 @@ gfc_match_select_type (void) goto cleanup; } + /* Select type namespaces are not filled until resolution. Therefore, the + namespace must be marked as having an inferred type associate name if + either expr1 is an inferred type variable or expr2 is. In the latter + case, as well as the symbol being marked as inferred type, it might be + that it has not been detected to be so. In this case the target has + unknown type. Once the namespace is marked, the fixups in resolution can + be triggered. */ + if (!expr2 + && expr1->symtree->n.sym->assoc + && expr1->symtree->n.sym->assoc->inferred_type) +gfc_current_ns->assoc_name_inferred = 1; + else if (expr2 && expr2->expr_type == EXPR_VARIABLE + && expr2->symtree->n.sym->assoc) +{ + if (expr2->symtree->n.sym->assoc->inferred_type) + gfc_current_ns->assoc_name_inferred = 1; + else if (expr2->symtree->n.sym->assoc->target + && expr2->symtree->n.sym->assoc->target->ts.type == BT_UNKNOWN) + gfc_current_ns->assoc_name_inferred = 1; +} + new_st.op = EXEC_SELECT_TYPE; new_st.expr1 = expr1; new_st.expr2 = expr2; diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index 8e7833769a8f..76f6bcb8a789 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2113,13 +2113,13 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, inferred_type = IS_INFERRED_TYPE (primary); - /* SELECT TYPE and SELECT RANK temporaries within an ASSOCIATE block, whose - selector has not been parsed, can generate errors with array and component - refs.. Use 'inferred_type' as a flag to suppress these errors. */ + /* SELECT TYPE temporaries within an ASSOCIATE block, whose selector has not + been parsed, can generate errors with array refs.. The SELECT TYPE + namespace is marked with 'assoc_name_inferred'. During resolution, this is + detected and gfc_fixup_inferred_type_refs is called. */ if (!inferred_type - && (gfc_peek_ascii_char () == '(' && !sym->attr.dimension) - && !sym->attr.codimension && sym->attr.select_type_temporary + && sym->ns->assoc_name_inferred && !sym->attr.select_rank_temporary) inferred_type = true; diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 4368627041ed..d7a0856fcca1 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -5888,6 +5888,9 @@ resolve_variable (gfc_expr *e) if (e->expr_type == EXPR_CONSTANT) return true; } + el
[gcc r14-10216] Fortran: Fix select type regression due to r14-9489 [PR114874]
https://gcc.gnu.org/g:c887341432bb71cf5540d54955ad7265b0aaca77 commit r14-10216-gc887341432bb71cf5540d54955ad7265b0aaca77 Author: Paul Thomas Date: Fri May 17 15:19:26 2024 +0100 Fortran: Fix select type regression due to r14-9489 [PR114874] 2024-05-17 Paul Thomas gcc/fortran PR fortran/114874 * gfortran.h: Add 'assoc_name_inferred' to gfc_namespace. * match.cc (gfc_match_select_type): Set 'assoc_name_inferred' in select type namespace if the selector has inferred type. * primary.cc (gfc_match_varspec): If a select type temporary is apparently scalar and a left parenthesis has been detected, check the current namespace has 'assoc_name_inferred' set. If so, set inferred_type. * resolve.cc (resolve_variable): If the namespace of a select type temporary is marked with 'assoc_name_inferred' call gfc_fixup_inferred_type_refs to ensure references are OK. (gfc_fixup_inferred_type_refs): Catch invalid array refs.. gcc/testsuite/ PR fortran/114874 * gfortran.dg/pr114874_1.f90: New test for valid code. * gfortran.dg/pr114874_2.f90: New test for invalid code. (cherry picked from commit 5f5074fe7aaf9524defb265299a985eecba7f914) Diff: --- gcc/fortran/gfortran.h | 4 +++ gcc/fortran/match.cc | 21 + gcc/fortran/primary.cc | 10 +++--- gcc/fortran/resolve.cc | 17 +++--- gcc/testsuite/gfortran.dg/pr114874_1.f90 | 32 +++ gcc/testsuite/gfortran.dg/pr114874_2.f90 | 53 6 files changed, 128 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 58505446bac5..de3d9e25911b 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2241,6 +2241,10 @@ typedef struct gfc_namespace /* Set when resolve_types has been called for this namespace. */ unsigned types_resolved:1; + /* Set if the associate_name in a select type statement is an + inferred type. */ + unsigned assoc_name_inferred:1; + /* Set to 1 if code has been generated for this namespace. */ unsigned translated:1; diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index 4539c9bb1344..1851a8f94a54 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -6721,6 +6721,27 @@ gfc_match_select_type (void) goto cleanup; } + /* Select type namespaces are not filled until resolution. Therefore, the + namespace must be marked as having an inferred type associate name if + either expr1 is an inferred type variable or expr2 is. In the latter + case, as well as the symbol being marked as inferred type, it might be + that it has not been detected to be so. In this case the target has + unknown type. Once the namespace is marked, the fixups in resolution can + be triggered. */ + if (!expr2 + && expr1->symtree->n.sym->assoc + && expr1->symtree->n.sym->assoc->inferred_type) +gfc_current_ns->assoc_name_inferred = 1; + else if (expr2 && expr2->expr_type == EXPR_VARIABLE + && expr2->symtree->n.sym->assoc) +{ + if (expr2->symtree->n.sym->assoc->inferred_type) + gfc_current_ns->assoc_name_inferred = 1; + else if (expr2->symtree->n.sym->assoc->target + && expr2->symtree->n.sym->assoc->target->ts.type == BT_UNKNOWN) + gfc_current_ns->assoc_name_inferred = 1; +} + new_st.op = EXEC_SELECT_TYPE; new_st.expr1 = expr1; new_st.expr2 = expr2; diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index 606e84432be6..c4821030ebb5 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2113,13 +2113,13 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, inferred_type = IS_INFERRED_TYPE (primary); - /* SELECT TYPE and SELECT RANK temporaries within an ASSOCIATE block, whose - selector has not been parsed, can generate errors with array and component - refs.. Use 'inferred_type' as a flag to suppress these errors. */ + /* SELECT TYPE temporaries within an ASSOCIATE block, whose selector has not + been parsed, can generate errors with array refs.. The SELECT TYPE + namespace is marked with 'assoc_name_inferred'. During resolution, this is + detected and gfc_fixup_inferred_type_refs is called. */ if (!inferred_type - && (gfc_peek_ascii_char () == '(' && !sym->attr.dimension) - && !sym->attr.codimension && sym->attr.select_type_temporary + && sym->ns->assoc_name_inferred && !sym->attr.select_rank_temporary) inferred_type = true; diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 4368627041ed..d7a0856fcca1 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -5888,6 +5888,9 @@ resolve_variable (gfc_expr
[gcc r15-634] i386: Rename sat_plusminus expanders to standard names [PR112600]
https://gcc.gnu.org/g:b59de4113262f2bee14147eb17eb3592f03d9556 commit r15-634-gb59de4113262f2bee14147eb17eb3592f03d9556 Author: Uros Bizjak Date: Fri May 17 09:55:49 2024 +0200 i386: Rename sat_plusminus expanders to standard names [PR112600] Rename _3 expander to a standard ssadd, usadd, sssub and ussub name to enable corresponding optab expansion. Also add named expander for MMX modes. PR middle-end/112600 gcc/ChangeLog: * config/i386/mmx.md (3): New expander. * config/i386/sse.md (_3): Rename expander to 3. (3): Update for rename. * config/i386/i386-builtin.def: Update for rename. gcc/testsuite/ChangeLog: * gcc.target/i386/pr112600-1a.c: New test. * gcc.target/i386/pr112600-1b.c: New test. Diff: --- gcc/config/i386/i386-builtin.def| 80 ++--- gcc/config/i386/mmx.md | 7 +++ gcc/config/i386/sse.md | 4 +- gcc/testsuite/gcc.target/i386/pr112600-1a.c | 15 ++ gcc/testsuite/gcc.target/i386/pr112600-1b.c | 15 ++ 5 files changed, 79 insertions(+), 42 deletions(-) diff --git a/gcc/config/i386/i386-builtin.def b/gcc/config/i386/i386-builtin.def index ab73e20121aa..927a79bb825b 100644 --- a/gcc/config/i386/i386-builtin.def +++ b/gcc/config/i386/i386-builtin.def @@ -800,14 +800,14 @@ BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_subv8hi3, "__builtin_ia32_psubw128", IX BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_subv4si3, "__builtin_ia32_psubd128", IX86_BUILTIN_PSUBD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI) BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_subv2di3, "__builtin_ia32_psubq128", IX86_BUILTIN_PSUBQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) -BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI) +BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_mulv8hi3, "__builtin_ia32_pmullw128", IX86_BUILTIN_PMULLW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_smulv8hi3_highpart, "__builtin_ia32_pmulhw128", IX86_BUILTIN_PMULHW128, UNKNOWN,(int) V8HI_FTYPE_V8HI_V8HI) @@ -1193,10 +1193,10 @@ BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_addv32qi3, "__builtin_ia32_paddb256", I BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_addv16hi3, "__builtin_ia32_paddw256", IX86_BUILTIN_PADDW256, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI) BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_addv8si3, "__builtin_ia32_paddd256", IX86_BUILTIN_PADDD256, UNKNOWN, (int) V8SI_FTYPE_V8SI_V8SI) BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_addv4di3, "__builtin_ia32_paddq256", I
[gcc r15-635] MAINTAINERS: Add myself to write after approval
https://gcc.gnu.org/g:6daed961542a9d5e83f9b94a3ee91f918f4268a5 commit r15-635-g6daed961542a9d5e83f9b94a3ee91f918f4268a5 Author: Levy Hsu Date: Sat May 18 02:20:18 2024 +0800 MAINTAINERS: Add myself to write after approval ChangeLog: * MAINTAINERS: Add myself. Diff: --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8bb435dd54ea..8e0add6bef86 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -467,6 +467,7 @@ Matthew Hiller Kazu Hirata Manfred Hollstein Cong Hou +Levy Hsu Lin Hu Falk Hueffner Andrew John Hughes
[gcc r15-636] diagnostics, analyzer: add CFG edge visualization to path-printing
https://gcc.gnu.org/g:770657d02c986c8724214dba51f21bb3c299ebae commit r15-636-g770657d02c986c8724214dba51f21bb3c299ebae Author: David Malcolm Date: Fri May 17 14:51:47 2024 -0400 diagnostics, analyzer: add CFG edge visualization to path-printing This patch adds some ability for links between labelled ranges when quoting the user's source code, and uses this to add links between events when printing diagnostic_paths, chopping them up further into event ranges that can be printed together. It adds links to the various "from..." - "...to" events in the analyzer. For example, previously we emitted this for c-c++-common/analyzer/infinite-loop-linked-list.c's while_loop_missing_next': infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop] 30 | while (n) | ^ 'while_loop_missing_next': events 1-5 30 | while (n) | ^ | | | (1) infinite loop here | (2) when 'n' is non-NULL: always following 'true' branch... | (5) ...to here 31 | { 32 | sum += n->val; | ~ | | | | | (3) ...to here | (4) looping back... whereas with the patch we now emit: infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop] 30 | while (n) | ^ 'while_loop_missing_next': events 1-3 30 | while (n) | ^ | | | (1) infinite loop here | (2) when 'n' is non-NULL: always following 'true' branch... ->-+ | | | | |++ 31 ||{ 32 || sum += n->val; || ~~ || | |+->(3) ...to here 'while_loop_missing_next': event 4 32 | sum += n->val; | ^ | | | (4) looping back... ->-+ | | 'while_loop_missing_next': event 5 | | |+-+ 30 || while (n) || ^ || | |+>(5) ...to here which I believe is easier to understand. The patch also implements the use of unicode characters and colorization for the lines (not shown in the above example). There is a new option -fno-diagnostics-show-event-links for getting back the old behavior (added to -fdiagnostics-plain-output). gcc/analyzer/ChangeLog: * checker-event.h (checker_event::connect_to_next_event_p): Implement new diagnostic_event::connect_to_next_event_p vfunc. (start_cfg_edge_event::connect_to_next_event_p): Likewise. (start_consolidated_cfg_edges_event::connect_to_next_event_p): Likewise. * infinite-loop.cc (class looping_back_event): New subclass. (infinite_loop_diagnostic::add_final_event): Use it. gcc/ChangeLog: * common.opt (fdiagnostics-show-event-links): New option. * diagnostic-label-effects.h: New file. * diagnostic-path.h (diagnostic_event::connect_to_next_event_p): New pure virtual function. (simple_diagnostic_event::connect_to_next_event_p): Implement it. (simple_diagnostic_event::connect_to_next_event): New. (simple_diagnostic_event::m_connected_to_next_event): New field. (simple_diagnostic_path::connect_to_next_event): New decl. * diagnostic-show-locus.cc: Include "text-art/theme.h" and "diagnostic-label-effects.h". (colorizer::set_cfg_edge): New. (layout::m_fallback_theme): New field. (layout::m_theme): New field. (layout::m_effect_info): New field. (layout::m_link_lhs_state): New enum and field. (layout::m_link_rhs_column): New field. (layout_range::has_in_edge): New. (layout_range::has_out_edge): New. (layout::layout): Add "effect_info" optional param. Initialize m_theme, m_link_lhs_state, and m_link_rhs_column. (layout::maybe_add_location_range): Remove stray "FIXME" from leading comment. (layout::print_source_line): Replace space after margin with a call to print_leftmost_column. (layout::print_leftmost_column): New. (layout::start_annotatio
[gcc r15-637] Use DW_TAG_module for Ada
https://gcc.gnu.org/g:9b6acf5357818ce7ff234c504ed79078a06d0e0f commit r15-637-g9b6acf5357818ce7ff234c504ed79078a06d0e0f Author: Tom Tromey Date: Thu Apr 18 09:08:23 2024 -0600 Use DW_TAG_module for Ada DWARF is not especially clear on the distinction between DW_TAG_namespace and DW_TAG_module, but I think that DW_TAG_module is more appropriate for Ada. This patch changes the compiler to do this. Note that the Ada compiler does not yet create NAMESPACE_DECLs. gcc * dwarf2out.cc (gen_namespace_die): Use DW_TAG_module for Ada. Diff: --- gcc/dwarf2out.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 70b7f5f42cd7..5b064ffd78ad 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -27003,7 +27003,7 @@ gen_namespace_die (tree decl, dw_die_ref context_die) { /* Output a real namespace or module. */ context_die = setup_namespace_context (decl, comp_unit_die ()); - namespace_die = new_die (is_fortran () || is_dlang () + namespace_die = new_die (is_fortran () || is_dlang () || is_ada () ? DW_TAG_module : DW_TAG_namespace, context_die, decl); /* For Fortran modules defined in different CU don't add src coords. */
[gcc r15-638] internal-fn: Do not force vcond_mask operands to reg.
https://gcc.gnu.org/g:7ca35f2e430081d6ec91e910002f92d9713350fa commit r15-638-g7ca35f2e430081d6ec91e910002f92d9713350fa Author: Robin Dapp Date: Fri May 10 12:44:44 2024 +0200 internal-fn: Do not force vcond_mask operands to reg. In order to directly use constants this patch removes force_regs in the vcond_mask expander. gcc/ChangeLog: PR middle-end/113474 * internal-fn.cc (expand_vec_cond_mask_optab_fn): Remove force_regs. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr113474.c: New test. Diff: --- gcc/internal-fn.cc| 3 --- gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c | 13 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc index 73045ca8c8c1..9c09026793fa 100644 --- a/gcc/internal-fn.cc +++ b/gcc/internal-fn.cc @@ -3165,9 +3165,6 @@ expand_vec_cond_mask_optab_fn (internal_fn, gcall *stmt, convert_optab optab) rtx_op1 = expand_normal (op1); rtx_op2 = expand_normal (op2); - mask = force_reg (mask_mode, mask); - rtx_op1 = force_reg (mode, rtx_op1); - rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE); create_output_operand (&ops[0], target, mode); create_input_operand (&ops[1], rtx_op1, mode); diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c new file mode 100644 index ..0364bf9f5e38 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target riscv_v } } */ +/* { dg-additional-options "-std=c99" } */ + +void +foo (int n, int **a) +{ + int b; + for (b = 0; b < n; b++) +for (long e = 8; e > 0; e--) + a[b][e] = a[b][e] == 15; +} + +/* { dg-final { scan-assembler "vmerge.vim" } } */
[gcc r15-639] RISC-V: Add initial cost handling for segment loads/stores.
https://gcc.gnu.org/g:e0b9c8ad7098fb08a25a61fe17d4274dd73e5145 commit r15-639-ge0b9c8ad7098fb08a25a61fe17d4274dd73e5145 Author: Robin Dapp Date: Mon Feb 26 13:09:15 2024 +0100 RISC-V: Add initial cost handling for segment loads/stores. This patch makes segment loads and stores more expensive. It adds segment_permute_2 as well as 3 to 8 cost fields to the common vector costs and adds handling to adjust_stmt_cost. gcc/ChangeLog: * config/riscv/riscv-protos.h (struct common_vector_cost): Add segment_permute cost. * config/riscv/riscv-vector-costs.cc (costs::adjust_stmt_cost): Handle segment loads/stores. * config/riscv/riscv.cc: Initialize segment_permute_[2-8] to 1. gcc/testsuite/ChangeLog: * gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c: Adjust test. Diff: --- gcc/config/riscv/riscv-protos.h| 9 ++ gcc/config/riscv/riscv-vector-costs.cc | 163 +++-- gcc/config/riscv/riscv.cc | 14 ++ .../gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c | 4 +- 4 files changed, 146 insertions(+), 44 deletions(-) diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 565ead1382a7..004ceb1031b8 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -222,6 +222,15 @@ struct common_vector_cost const int gather_load_cost; const int scatter_store_cost; + /* Segment load/store permute cost. */ + const int segment_permute_2; + const int segment_permute_3; + const int segment_permute_4; + const int segment_permute_5; + const int segment_permute_6; + const int segment_permute_7; + const int segment_permute_8; + /* Cost of a vector-to-scalar operation. */ const int vec_to_scalar_cost; diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc index 4582b0db4250..0a88e142a934 100644 --- a/gcc/config/riscv/riscv-vector-costs.cc +++ b/gcc/config/riscv/riscv-vector-costs.cc @@ -1052,6 +1052,25 @@ costs::better_main_loop_than_p (const vector_costs *uncast_other) const return vector_costs::better_main_loop_than_p (other); } +/* Returns the group size i.e. the number of vectors to be loaded by a + segmented load/store instruction. Return 0 if it is no segmented + load/store. */ +static int +segment_loadstore_group_size (enum vect_cost_for_stmt kind, + stmt_vec_info stmt_info) +{ + if (stmt_info + && (kind == vector_load || kind == vector_store) + && STMT_VINFO_DATA_REF (stmt_info)) +{ + stmt_info = DR_GROUP_FIRST_ELEMENT (stmt_info); + if (stmt_info + && STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info) == VMAT_LOAD_STORE_LANES) + return DR_GROUP_SIZE (stmt_info); +} + return 0; +} + /* Adjust vectorization cost after calling riscv_builtin_vectorization_cost. For some statement, we would like to further fine-grain tweak the cost on top of riscv_builtin_vectorization_cost handling which doesn't have any @@ -1076,55 +1095,115 @@ costs::adjust_stmt_cost (enum vect_cost_for_stmt kind, loop_vec_info loop, case vector_load: case vector_store: { - /* Unit-stride vector loads and stores do not have offset addressing -as opposed to scalar loads and stores. -If the address depends on a variable we need an additional -add/sub for each load/store in the worst case. */ - if (stmt_info && stmt_info->stmt) + if (stmt_info && stmt_info->stmt && STMT_VINFO_DATA_REF (stmt_info)) { - data_reference *dr = STMT_VINFO_DATA_REF (stmt_info); - class loop *father = stmt_info->stmt->bb->loop_father; - if (!loop && father && !father->inner && father->superloops) + /* Segment loads and stores. When the group size is > 1 +the vectorizer will add a vector load/store statement for +each vector in the group. Here we additionally add permute +costs for each. */ + /* TODO: Indexed and ordered/unordered cost. */ + int group_size = segment_loadstore_group_size (kind, stmt_info); + if (group_size > 1) + { + switch (group_size) + { + case 2: + if (riscv_v_ext_vector_mode_p (loop->vector_mode)) + stmt_cost += costs->vla->segment_permute_2; + else + stmt_cost += costs->vls->segment_permute_2; + break; + case 3: + if (riscv_v_ext_vector_mode_p (loop->vector_mode)) + stmt_cost += costs->vla->segment_permute_3; + else + stmt_cost += costs->vls->segment_permute_3; + brea
[gcc r15-640] Regenerate common.opt.urls
https://gcc.gnu.org/g:4e3bb431bbf2802bcf8e5d983dd1450f719d6ac7 commit r15-640-g4e3bb431bbf2802bcf8e5d983dd1450f719d6ac7 Author: David Malcolm Date: Fri May 17 17:56:56 2024 -0400 Regenerate common.opt.urls I forgot to do this for r15-636-g770657d02c986c. gcc/ChangeLog: * common.opt.urls: Regenerate to add fdiagnostics-show-event-links. Signed-off-by: David Malcolm Diff: --- gcc/common.opt.urls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/common.opt.urls b/gcc/common.opt.urls index f71ed80a34b4..10462e408744 100644 --- a/gcc/common.opt.urls +++ b/gcc/common.opt.urls @@ -534,6 +534,9 @@ UrlSuffix(gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-show fdiagnostics-show-caret UrlSuffix(gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-show-caret) +fdiagnostics-show-event-links +UrlSuffix(gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-show-event-links) + fdiagnostics-show-labels UrlSuffix(gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-show-labels)
[gcc r15-641] Fix Ada runtime library breakage on Solaris
https://gcc.gnu.org/g:5812e1bbb1c8a7a90d995a0165cddae4d450d6cf commit r15-641-g5812e1bbb1c8a7a90d995a0165cddae4d450d6cf Author: Eric Botcazou Date: Sat May 18 00:21:56 2024 +0200 Fix Ada runtime library breakage on Solaris The recent changes made to the runtime library broke its build on Solaris because it uses Solaris threads instead of POSIX threads on this platform. gcc/ada/ PR ada/115133 * libgnarl/s-osinte__solaris.ads (mutex_t): Fix typo. * libgnarl/s-taprop__solaris.adb (Record_Lock): Add conversion. (Check_Sleep): Likewise. (Record_Wakeup): Likewise. (Check_Unlock): Likewise. * libgnarl/s-tasini.adb (Initialize_RTS_Lock): Add pragma Import on the overlaid variable. (Finalize_RTS_Lock): Likewise. (Acquire_RTS_Lock): Likewise. (Release_RTS_Lock): Likewise. * libgnarl/s-taspri__solaris.ads (To_RTS_Lock_Ptr): New instance of Ada.Unchecked_Conversion. * libgnat/s-oslock__solaris.ads: Add with clause for Ada.Unchecked_Conversion. (array_type_9): Add missing name qualification. (record_type_3): Likewise. (mutex_t): Fix formatting. Diff: --- gcc/ada/libgnarl/s-osinte__solaris.ads | 2 +- gcc/ada/libgnarl/s-taprop__solaris.adb | 8 gcc/ada/libgnarl/s-tasini.adb | 4 gcc/ada/libgnarl/s-taspri__solaris.ads | 2 ++ gcc/ada/libgnat/s-oslock__solaris.ads | 7 --- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads b/gcc/ada/libgnarl/s-osinte__solaris.ads index 12ad52bb48ed..3703697ef44f 100644 --- a/gcc/ada/libgnarl/s-osinte__solaris.ads +++ b/gcc/ada/libgnarl/s-osinte__solaris.ads @@ -298,7 +298,7 @@ package System.OS_Interface is function To_thread_t is new Ada.Unchecked_Conversion (Integer, thread_t); - subtype mutex_t is System.OS_Lock.mutex_t; + subtype mutex_t is System.OS_Locks.mutex_t; type cond_t is limited private; diff --git a/gcc/ada/libgnarl/s-taprop__solaris.adb b/gcc/ada/libgnarl/s-taprop__solaris.adb index 88b77b09820d..82e51b8d25c5 100644 --- a/gcc/ada/libgnarl/s-taprop__solaris.adb +++ b/gcc/ada/libgnarl/s-taprop__solaris.adb @@ -1399,7 +1399,7 @@ package body System.Task_Primitives.Operations is P := Self_ID.Common.LL.Locks; if P /= null then - L.Next := P; + L.Next := To_RTS_Lock_Ptr (P); end if; Self_ID.Common.LL.Locking := null; @@ -1440,7 +1440,7 @@ package body System.Task_Primitives.Operations is Self_ID.Common.LL.L.Owner := null; P := Self_ID.Common.LL.Locks; - Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next; + Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next); P.Next := null; return True; end Check_Sleep; @@ -1468,7 +1468,7 @@ package body System.Task_Primitives.Operations is P := Self_ID.Common.LL.Locks; if P /= null then - L.Next := P; + L.Next := To_RTS_Lock_Ptr (P); end if; Self_ID.Common.LL.Locking := null; @@ -1549,7 +1549,7 @@ package body System.Task_Primitives.Operations is L.Owner := null; P := Self_ID.Common.LL.Locks; - Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next; + Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next); P.Next := null; return True; end Check_Unlock; diff --git a/gcc/ada/libgnarl/s-tasini.adb b/gcc/ada/libgnarl/s-tasini.adb index 794183f5356a..d42d2881df45 100644 --- a/gcc/ada/libgnarl/s-tasini.adb +++ b/gcc/ada/libgnarl/s-tasini.adb @@ -246,6 +246,7 @@ package body System.Tasking.Initialization is procedure Initialize_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Initialize_Lock (Lock'Unchecked_Access, PO_Level); @@ -258,6 +259,7 @@ package body System.Tasking.Initialization is procedure Finalize_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Finalize_Lock (Lock'Unchecked_Access); @@ -270,6 +272,7 @@ package body System.Tasking.Initialization is procedure Acquire_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Write_Lock (Lock'Unchecked_Access); @@ -282,6 +285,7 @@ package body System.Tasking.Initialization is procedure Release_RTS_Lock (Addr : Address) is Lock : aliased SOL.RTS_Lock; for Lock'Address use Addr; + pragma Import (Ada, Lock); begin Unlock (Lock'Unchecked_Access); diff --git a/gcc/ada/libgnarl/s-taspri__solaris.ads b/gcc/ada/libgnarl/s-taspri__solaris.ads index ca40229993bd..16fc4196b005 100644 --- a/gcc/ada/l
[gcc] Created branch 'meissner/heads/work166' in namespace 'refs/users'
The branch 'meissner/heads/work166' was created in namespace 'refs/users' pointing to: 5812e1bbb1c8... Fix Ada runtime library breakage on Solaris
[gcc(refs/users/meissner/heads/work166)] Add ChangeLog.meissner and REVISION.
https://gcc.gnu.org/g:34b6b91f102919d2980c99c796e9fc5fab5a80e4 commit 34b6b91f102919d2980c99c796e9fc5fab5a80e4 Author: Michael Meissner Date: Fri May 17 20:40:01 2024 -0400 Add ChangeLog.meissner and REVISION. 2024-05-17 Michael Meissner gcc/ * REVISION: New file for branch. * ChangeLog.meissner: New file. gcc/c-family/ * ChangeLog.meissner: New file. gcc/c/ * ChangeLog.meissner: New file. gcc/cp/ * ChangeLog.meissner: New file. gcc/fortran/ * ChangeLog.meissner: New file. gcc/testsuite/ * ChangeLog.meissner: New file. libgcc/ * ChangeLog.meissner: New file. Diff: --- gcc/ChangeLog.meissner | 6 ++ gcc/REVISION | 1 + gcc/c-family/ChangeLog.meissner | 6 ++ gcc/c/ChangeLog.meissner | 6 ++ gcc/cp/ChangeLog.meissner| 6 ++ gcc/fortran/ChangeLog.meissner | 6 ++ gcc/testsuite/ChangeLog.meissner | 6 ++ libgcc/ChangeLog.meissner| 6 ++ libstdc++-v3/ChangeLog.meissner | 6 ++ 9 files changed, 49 insertions(+) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION new file mode 100644 index ..42eef54d0aeb --- /dev/null +++ b/gcc/REVISION @@ -0,0 +1 @@ +work166 branch diff --git a/gcc/c-family/ChangeLog.meissner b/gcc/c-family/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/c-family/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/c/ChangeLog.meissner b/gcc/c/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/c/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/cp/ChangeLog.meissner b/gcc/cp/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/cp/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/fortran/ChangeLog.meissner b/gcc/fortran/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/fortran/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/testsuite/ChangeLog.meissner b/gcc/testsuite/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/gcc/testsuite/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/libgcc/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/libstdc++-v3/ChangeLog.meissner b/libstdc++-v3/ChangeLog.meissner new file mode 100644 index ..50c34720bc0d --- /dev/null +++ b/libstdc++-v3/ChangeLog.meissner @@ -0,0 +1,6 @@ + Branch work166, baseline + +2024-05-17 Michael Meissner + + Clone branch +
[gcc] Created branch 'meissner/heads/work166-dmf' in namespace 'refs/users'
The branch 'meissner/heads/work166-dmf' was created in namespace 'refs/users' pointing to: 34b6b91f1029... Add ChangeLog.meissner and REVISION.
[gcc(refs/users/meissner/heads/work166-dmf)] Add ChangeLog.dmf and update REVISION.
https://gcc.gnu.org/g:40164d1259418c6a92375d1950a19bf22d14beb4 commit 40164d1259418c6a92375d1950a19bf22d14beb4 Author: Michael Meissner Date: Fri May 17 20:40:56 2024 -0400 Add ChangeLog.dmf and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.dmf: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.dmf | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.dmf b/gcc/ChangeLog.dmf new file mode 100644 index ..ab0fdd1054fb --- /dev/null +++ b/gcc/ChangeLog.dmf @@ -0,0 +1,6 @@ + Branch work166-dmf, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..ee73a03644d7 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-dmf branch
[gcc] Created branch 'meissner/heads/work166-vpair' in namespace 'refs/users'
The branch 'meissner/heads/work166-vpair' was created in namespace 'refs/users' pointing to: 34b6b91f1029... Add ChangeLog.meissner and REVISION.
[gcc(refs/users/meissner/heads/work166-vpair)] Add ChangeLog.vpair and update REVISION.
https://gcc.gnu.org/g:371220eb0c0136af5c4f080e0b2312ea081f23e0 commit 371220eb0c0136af5c4f080e0b2312ea081f23e0 Author: Michael Meissner Date: Fri May 17 20:41:52 2024 -0400 Add ChangeLog.vpair and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.vpair: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.vpair | 6 ++ gcc/REVISION| 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.vpair b/gcc/ChangeLog.vpair new file mode 100644 index ..172fd3d00bc4 --- /dev/null +++ b/gcc/ChangeLog.vpair @@ -0,0 +1,6 @@ + Branch work166-vpair, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..155b9d8d70eb 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-vpair branch
[gcc] Created branch 'meissner/heads/work166-tar' in namespace 'refs/users'
The branch 'meissner/heads/work166-tar' was created in namespace 'refs/users' pointing to: 34b6b91f1029... Add ChangeLog.meissner and REVISION.
[gcc(refs/users/meissner/heads/work166-tar)] Add ChangeLog.tar and update REVISION.
https://gcc.gnu.org/g:1a2e3e0e4240ccc23aa93d1bccb4126713ab651b commit 1a2e3e0e4240ccc23aa93d1bccb4126713ab651b Author: Michael Meissner Date: Fri May 17 20:47:03 2024 -0400 Add ChangeLog.tar and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.tar: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.tar | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.tar b/gcc/ChangeLog.tar new file mode 100644 index ..3e168fa367eb --- /dev/null +++ b/gcc/ChangeLog.tar @@ -0,0 +1,6 @@ + Branch work166-tar, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..3b5b120ee37e 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-tar branch
[gcc] Created branch 'meissner/heads/work166-bugs' in namespace 'refs/users'
The branch 'meissner/heads/work166-bugs' was created in namespace 'refs/users' pointing to: 34b6b91f1029... Add ChangeLog.meissner and REVISION.
[gcc(refs/users/meissner/heads/work166-bugs)] Add ChangeLog.bugs and update REVISION.
https://gcc.gnu.org/g:4adff7dc8cd232071777468c6469d1ac6928c038 commit 4adff7dc8cd232071777468c6469d1ac6928c038 Author: Michael Meissner Date: Fri May 17 20:47:59 2024 -0400 Add ChangeLog.bugs and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.bugs: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.bugs | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.bugs b/gcc/ChangeLog.bugs new file mode 100644 index ..48a479c763ff --- /dev/null +++ b/gcc/ChangeLog.bugs @@ -0,0 +1,6 @@ + Branch work166-bugs, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..5e353b50cf66 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-bugs branch
[gcc] Created branch 'meissner/heads/work166-test' in namespace 'refs/users'
The branch 'meissner/heads/work166-test' was created in namespace 'refs/users' pointing to: 34b6b91f1029... Add ChangeLog.meissner and REVISION.
[gcc(refs/users/meissner/heads/work166-test)] Add ChangeLog.test and update REVISION.
https://gcc.gnu.org/g:ebd3fabfb5ba02a2829e031aa12bb7c8bd6e7675 commit ebd3fabfb5ba02a2829e031aa12bb7c8bd6e7675 Author: Michael Meissner Date: Fri May 17 20:48:57 2024 -0400 Add ChangeLog.test and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.test: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.test | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.test b/gcc/ChangeLog.test new file mode 100644 index ..e2a281f8f9ec --- /dev/null +++ b/gcc/ChangeLog.test @@ -0,0 +1,6 @@ + Branch work166-test, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..a8ef9d6b8080 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-test branch
[gcc] Created branch 'meissner/heads/work166-orig' in namespace 'refs/users'
The branch 'meissner/heads/work166-orig' was created in namespace 'refs/users' pointing to: 5812e1bbb1c8... Fix Ada runtime library breakage on Solaris
[gcc(refs/users/meissner/heads/work166-orig)] Add REVISION.
https://gcc.gnu.org/g:fc9431681be76b76abbe4cf546757fdad4a72601 commit fc9431681be76b76abbe4cf546757fdad4a72601 Author: Michael Meissner Date: Fri May 17 20:49:52 2024 -0400 Add REVISION. 2024-05-17 Michael Meissner gcc/ * REVISION: New file for branch. Diff: --- gcc/REVISION | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/REVISION b/gcc/REVISION new file mode 100644 index ..21f194ed8dcc --- /dev/null +++ b/gcc/REVISION @@ -0,0 +1 @@ +work166-orig branch
[gcc(refs/users/meissner/heads/work166)] Add -mcpu=power11 support.
https://gcc.gnu.org/g:00c9f9b1f8e3e7a01298c6df58a3c8baeff0e196 commit 00c9f9b1f8e3e7a01298c6df58a3c8baeff0e196 Author: Michael Meissner Date: Fri May 17 20:52:51 2024 -0400 Add -mcpu=power11 support. This patch adds the power11 option to the -mcpu= and -mtune= switches. This patch treats the power11 like a power10 in terms of costs and reassociation width. This patch issues a ".machine power11" to the assembly file if you use -mcpu=power11. This patch defines _ARCH_PWR11 if the user uses -mcpu=power11. This patch allows GCC to be configured with the --with-cpu=power11 and --with-tune=power11 options. This patch passes -mpwr11 to the assembler if the user uses -mcpu=power11. This patch adds support for using "power11" in the __builtin_cpu_is built-in function. 2024-05-17 Michael Meissner gcc/ * config.gcc (rs6000*-*-*, powerpc*-*-*): Add support for power11. * config/rs6000/aix71.h (ASM_CPU_SPEC): Add support for -mcpu=power11. * config/rs6000/aix72.h (ASM_CPU_SPEC): Likewise. * config/rs6000/aix73.h (ASM_CPU_SPEC): Likewise. * config/rs6000/driver-rs6000.cc (asm_names): Likewise. * config/rs6000/ppc-auxv.h (PPC_PLATFORM_POWER11): New define. * config/rs6000/rs6000-builtin.cc (cpu_is_info): Add power11. * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define _ARCH_PWR11 if -mcpu=power11. * config/rs6000/rs6000-cpus.def (ISA_POWER11_MASKS_SERVER): New define. (POWERPC_MASKS): Add power11 isa bit. (power11 cpu): Add power11 definition. * config/rs6000/rs6000-opts.h (PROCESSOR_POWER11): Add power11 processor. * config/rs6000/rs6000-string.cc (expand_compare_loop): Likewise. * config/rs6000/rs6000-tables.opt: Regenerate. * config/rs6000/rs6000.cc (rs6000_option_override_internal): Add power11 support. (rs6000_machine_from_flags): Likewise. (rs6000_reassociation_width): Likewise. (rs6000_adjust_cost): Likewise. (rs6000_issue_rate): Likewise. (rs6000_sched_reorder): Likewise. (rs6000_sched_reorder2): Likewise. (rs6000_register_move_cost): Likewise. (rs6000_opt_masks): Likewise. * config/rs6000/rs6000.h (ASM_CPU_SPEC): Likewise. * config/rs6000/rs6000.md (cpu attribute): Add power11. * config/rs6000/rs6000.opt (-mpower11): Add internal power11 ISA flag. * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mcpu=power11. Diff: --- gcc/config.gcc | 6 -- gcc/config/rs6000/aix71.h | 1 + gcc/config/rs6000/aix72.h | 1 + gcc/config/rs6000/aix73.h | 1 + gcc/config/rs6000/driver-rs6000.cc | 2 ++ gcc/config/rs6000/ppc-auxv.h| 3 +-- gcc/config/rs6000/rs6000-builtin.cc | 1 + gcc/config/rs6000/rs6000-c.cc | 2 ++ gcc/config/rs6000/rs6000-cpus.def | 5 + gcc/config/rs6000/rs6000-opts.h | 3 ++- gcc/config/rs6000/rs6000-string.cc | 1 + gcc/config/rs6000/rs6000-tables.opt | 3 +++ gcc/config/rs6000/rs6000.cc | 32 gcc/config/rs6000/rs6000.h | 1 + gcc/config/rs6000/rs6000.md | 2 +- gcc/config/rs6000/rs6000.opt| 3 +++ gcc/doc/invoke.texi | 5 +++-- 17 files changed, 56 insertions(+), 16 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index cfc2db545d01..226d90396d96 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -534,7 +534,9 @@ powerpc*-*-*) extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h" extra_headers="${extra_headers} amo.h" case x$with_cpu in - xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower10|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500) + xpowerpc64 | xdefault64 | x6[23]0 | x970 | xG5 | xpower[3456789] \ + | xpower1[01] | xpower6x | xrs64a | xcell | xa2 | xe500mc64 \ + | xe5500 | xe6500) cpu_is_64bit=yes ;; esac @@ -5622,7 +5624,7 @@ case "${target}" in eval "with_$which=405" ;; "" | common | native \ - | power[3456789] | power10 | power5+ | power6x \ + | power[3456789] | power1[01] | power5+ | power6x \ | powerpc | powerpc64 | powerpc64le \ | rs64 \ | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \ diff --git a/gcc/config/rs6000/aix71.h b/gcc/config/rs6000/aix71.h index 24bc301e37d6..41037b3852d7 100644 --- a/gcc/config/rs6000/aix71.h +++ b/gcc/config/rs6000/aix71.h @@ -79,6 +79,7 @@ d
[gcc(refs/users/meissner/heads/work166)] Add -mcpu=power11 tuning support.
https://gcc.gnu.org/g:c47c66e78975dfbc517707ba72f92c5746c41036 commit c47c66e78975dfbc517707ba72f92c5746c41036 Author: Michael Meissner Date: Fri May 17 20:53:58 2024 -0400 Add -mcpu=power11 tuning support. This patch makes -mtune=power11 use the same tuning decisions as -mtune=power10. 2024-05-17 Michael Meissner gcc/ * config/rs6000/power10.md (all reservations): Add power11 as an alternative to power10. Diff: --- gcc/config/rs6000/power10.md | 144 +-- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/gcc/config/rs6000/power10.md b/gcc/config/rs6000/power10.md index fcc2199ab291..90312643858e 100644 --- a/gcc/config/rs6000/power10.md +++ b/gcc/config/rs6000/power10.md @@ -1,4 +1,4 @@ -;; Scheduling description for the IBM POWER10 processor. +;; Scheduling description for the IBM POWER10 and POWER11 processors. ;; Copyright (C) 2020-2024 Free Software Foundation, Inc. ;; ;; Contributed by Pat Haugen (pthau...@us.ibm.com). @@ -97,12 +97,12 @@ (eq_attr "update" "no") (eq_attr "size" "!128") (eq_attr "prefixed" "no") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_any_power10,LU_power10") (define_insn_reservation "power10-fused-load" 4 (and (eq_attr "type" "fused_load_cmpi,fused_addis_load,fused_load_load") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-prefixed-load" 4 @@ -110,13 +110,13 @@ (eq_attr "update" "no") (eq_attr "size" "!128") (eq_attr "prefixed" "yes") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-load-update" 4 (and (eq_attr "type" "load") (eq_attr "update" "yes") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10+SXU_power10") (define_insn_reservation "power10-fpload-double" 4 @@ -124,7 +124,7 @@ (eq_attr "update" "no") (eq_attr "size" "64") (eq_attr "prefixed" "no") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_any_power10,LU_power10") (define_insn_reservation "power10-prefixed-fpload-double" 4 @@ -132,14 +132,14 @@ (eq_attr "update" "no") (eq_attr "size" "64") (eq_attr "prefixed" "yes") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-fpload-update-double" 4 (and (eq_attr "type" "fpload") (eq_attr "update" "yes") (eq_attr "size" "64") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10+SXU_power10") ; SFmode loads are cracked and have additional 3 cycles over DFmode @@ -148,27 +148,27 @@ (and (eq_attr "type" "fpload") (eq_attr "update" "no") (eq_attr "size" "32") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-fpload-update-single" 7 (and (eq_attr "type" "fpload") (eq_attr "update" "yes") (eq_attr "size" "32") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10+SXU_power10") (define_insn_reservation "power10-vecload" 4 (and (eq_attr "type" "vecload") (eq_attr "size" "!256") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_any_power10,LU_power10") ; lxvp (define_insn_reservation "power10-vecload-pair" 4 (and (eq_attr "type" "vecload") (eq_attr "size" "256") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,LU_power10+SXU_power10") ; Store Unit @@ -178,12 +178,12 @@ (eq_attr "prefixed" "no") (eq_attr "size" "!128") (eq_attr "size" "!256") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_any_power10,STU_power10") (define_insn_reservation "power10-fused-store" 0 (and (eq_attr "type" "fused_store_store") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,STU_power10") (define_insn_reservation "power10-prefixed-store" 0 @@ -191,52 +191,52 @@ (eq_attr "prefixed" "yes") (eq_attr "size" "!128") (eq_attr "size" "!256") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_even_power10,STU_power10") ; Update forms have 2 cycle latency for updated addr reg (define_insn_reservation "power10-store-update" 2 (and (eq_attr "type" "store,fpstore") (eq_attr "update" "yes") - (eq_attr "cpu" "power10")) + (eq_attr "cpu" "power10,power11")) "DU_any_power10,STU_p
[gcc(refs/users/meissner/heads/work166)] Add -mcpu=power11 tests.
https://gcc.gnu.org/g:d69f7b44398a5c83c8cf37b28b27bb3eba1eed44 commit d69f7b44398a5c83c8cf37b28b27bb3eba1eed44 Author: Michael Meissner Date: Fri May 17 20:54:49 2024 -0400 Add -mcpu=power11 tests. This patch adds some simple tests for -mcpu=power11 support. In order to run these tests, you need an assembler that supports the appropriate option for supporting the Power11 processor (-mpower11 under Linux or -mpwr11 under AIX). 2024-05-17 Michael Meissner gcc/testsuite/ * gcc.target/powerpc/power11-1.c: New test. * gcc.target/powerpc/power11-2.c: Likewise. * gcc.target/powerpc/power11-3.c: Likewise. * lib/target-supports.exp (check_effective_target_power11_ok): Add new effective target. Diff: --- gcc/testsuite/gcc.target/powerpc/power11-1.c | 13 + gcc/testsuite/gcc.target/powerpc/power11-2.c | 20 gcc/testsuite/gcc.target/powerpc/power11-3.c | 10 ++ gcc/testsuite/lib/target-supports.exp| 17 + 4 files changed, 60 insertions(+) diff --git a/gcc/testsuite/gcc.target/powerpc/power11-1.c b/gcc/testsuite/gcc.target/powerpc/power11-1.c new file mode 100644 index ..6a2e802eedf3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/power11-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target power11_ok } */ +/* { dg-options "-mdejagnu-cpu=power11 -O2" } */ + +/* Basic check to see if the compiler supports -mcpu=power11. */ + +#ifndef _ARCH_PWR11 +#error "-mcpu=power11 is not supported" +#endif + +void foo (void) +{ +} diff --git a/gcc/testsuite/gcc.target/powerpc/power11-2.c b/gcc/testsuite/gcc.target/powerpc/power11-2.c new file mode 100644 index ..7b9904c1d294 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/power11-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target power11_ok } */ +/* { dg-options "-O2" } */ + +/* Check if we can set the power11 target via a target attribute. */ + +__attribute__((__target__("cpu=power9"))) +void foo_p9 (void) +{ +} + +__attribute__((__target__("cpu=power10"))) +void foo_p10 (void) +{ +} + +__attribute__((__target__("cpu=power11"))) +void foo_p11 (void) +{ +} diff --git a/gcc/testsuite/gcc.target/powerpc/power11-3.c b/gcc/testsuite/gcc.target/powerpc/power11-3.c new file mode 100644 index ..9b2d643cc0fd --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/power11-3.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target power11_ok } */ +/* { dg-options "-mdejagnu-cpu=power8 -O2" } */ + +/* Check if we can set the power11 target via a target_clones attribute. */ + +__attribute__((__target_clones__("cpu=power11,cpu=power9,default"))) +void foo (void) +{ +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ec9baa4f32a3..cfff747f3c8c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7105,6 +7105,23 @@ proc check_effective_target_power10_ok { } { } } +# Return 1 if this is a PowerPC target supporting -mcpu=power11. + +proc check_effective_target_power11_ok { } { +if { ([istarget powerpc*-*-*]) } { + return [check_no_compiler_messages power11_ok object { + int main (void) { + #ifndef _ARCH_PWR11 + #error "-mcpu=power11 is not supported" + #endif + return 0; + } + } "-mcpu=power11"] +} else { + return 0 +} +} + # Return 1 if this is a PowerPC target supporting -mfloat128 via either # software emulation on power7/power8 systems or hardware support on power9.
[gcc(refs/users/meissner/heads/work166)] Add -mcpu=future support.
https://gcc.gnu.org/g:78dc63916474eec9e2f6c1cb76d948742fdffb94 commit 78dc63916474eec9e2f6c1cb76d948742fdffb94 Author: Michael Meissner Date: Fri May 17 20:56:47 2024 -0400 Add -mcpu=future support. This patch adds the future option to the -mcpu= and -mtune= switches. This patch treats the future like a power11 in terms of costs and reassociation width. This patch issues a ".machine future" to the assembly file if you use -mcpu=power11. This patch defines _ARCH_PWR_FUTURE if the user uses -mcpu=future. This patch allows GCC to be configured with the --with-cpu=future and --with-tune=future options. This patch passes -mfuture to the assembler if the user uses -mcpu=future. 2024-05-17 Michael Meissner gcc/ * config.gcc (rs6000*-*-*, powerpc*-*-*): Add support for power11. * config/rs6000/aix71.h (ASM_CPU_SPEC): Add support for -mcpu=power11. * config/rs6000/aix72.h (ASM_CPU_SPEC): Likewise. * config/rs6000/aix73.h (ASM_CPU_SPEC): Likewise. * config/rs6000/driver-rs6000.cc (asm_names): Likewise. * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define _ARCH_PWR_FUTURE if -mcpu=future. * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): New define. (POWERPC_MASKS): Add future isa bit. (power11 cpu): Add future definition. * config/rs6000/rs6000-opts.h (PROCESSOR_FUTURE): Add future processor. * config/rs6000/rs6000-string.cc (expand_compare_loop): Likewise. * config/rs6000/rs6000-tables.opt: Regenerate. * config/rs6000/rs6000.cc (rs6000_option_override_internal): Add future support. (rs6000_machine_from_flags): Likewise. (rs6000_reassociation_width): Likewise. (rs6000_adjust_cost): Likewise. (rs6000_issue_rate): Likewise. (rs6000_sched_reorder): Likewise. (rs6000_sched_reorder2): Likewise. (rs6000_register_move_cost): Likewise. (rs6000_opt_masks): Likewise. * config/rs6000/rs6000.h (ASM_CPU_SPEC): Likewise. * config/rs6000/rs6000.md (cpu attribute): Add future. * config/rs6000/rs6000.opt (-mpower11): Add internal future ISA flag. * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mcpu=future. Diff: --- gcc/config.gcc | 4 ++-- gcc/config/rs6000/aix71.h | 1 + gcc/config/rs6000/aix72.h | 1 + gcc/config/rs6000/aix73.h | 1 + gcc/config/rs6000/driver-rs6000.cc | 2 ++ gcc/config/rs6000/rs6000-c.cc | 2 ++ gcc/config/rs6000/rs6000-cpus.def | 5 + gcc/config/rs6000/rs6000-opts.h | 3 ++- gcc/config/rs6000/rs6000-string.cc | 1 + gcc/config/rs6000/rs6000-tables.opt | 3 +++ gcc/config/rs6000/rs6000.cc | 30 ++ gcc/config/rs6000/rs6000.h | 1 + gcc/config/rs6000/rs6000.md | 2 +- gcc/config/rs6000/rs6000.opt| 3 +++ gcc/doc/invoke.texi | 2 +- 15 files changed, 48 insertions(+), 13 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 226d90396d96..dbc7ac975de4 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -535,7 +535,7 @@ powerpc*-*-*) extra_headers="${extra_headers} amo.h" case x$with_cpu in xpowerpc64 | xdefault64 | x6[23]0 | x970 | xG5 | xpower[3456789] \ - | xpower1[01] | xpower6x | xrs64a | xcell | xa2 | xe500mc64 \ + | xpower1[01] | xfuture | xpower6x | xrs64a | xcell | xa2 | xe500mc64 \ | xe5500 | xe6500) cpu_is_64bit=yes ;; @@ -5624,7 +5624,7 @@ case "${target}" in eval "with_$which=405" ;; "" | common | native \ - | power[3456789] | power1[01] | power5+ | power6x \ + | power[3456789] | power1[01] | power5+ | power6x | future \ | powerpc | powerpc64 | powerpc64le \ | rs64 \ | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \ diff --git a/gcc/config/rs6000/aix71.h b/gcc/config/rs6000/aix71.h index 41037b3852d7..570ddcc451db 100644 --- a/gcc/config/rs6000/aix71.h +++ b/gcc/config/rs6000/aix71.h @@ -79,6 +79,7 @@ do { \ #undef ASM_CPU_SPEC #define ASM_CPU_SPEC \ "%{mcpu=native: %(asm_cpu_native); \ + mcpu=future: -mfuture; \ mcpu=power11: -mpwr11; \ mcpu=power10: -mpwr10; \ mcpu=power9: -mpwr9; \ diff --git a/gcc/config/rs6000/aix72.h b/gcc/config/rs6000/aix72.h index fe59f8319b48..242ca94bd065 100644 --- a/gcc/config/rs6000/aix72.h +++ b/gcc/config/rs6000/aix72.h @@ -79,6 +79,7 @@ do {
[gcc(refs/users/meissner/heads/work166)] Add -mcpu=future tuning support.
https://gcc.gnu.org/g:a0ccb78078a306d10ba79d60c5258c0cbdd6a4cf commit a0ccb78078a306d10ba79d60c5258c0cbdd6a4cf Author: Michael Meissner Date: Fri May 17 20:57:50 2024 -0400 Add -mcpu=future tuning support. This patch makes -mtune=future use the same tuning decision as -mtune=power11. 2024-05-17 Michael Meissner gcc/ * config/rs6000/power10.md (all reservations): Add future as an alterntive to power10 and power11. Diff: --- gcc/config/rs6000/power10.md | 145 ++- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/gcc/config/rs6000/power10.md b/gcc/config/rs6000/power10.md index 90312643858e..1ec1bef07260 100644 --- a/gcc/config/rs6000/power10.md +++ b/gcc/config/rs6000/power10.md @@ -1,4 +1,5 @@ -;; Scheduling description for the IBM POWER10 and POWER11 processors. +;; Scheduling description for the IBM POWER10 and POWER11 processors as well as +;; potential future processors. ;; Copyright (C) 2020-2024 Free Software Foundation, Inc. ;; ;; Contributed by Pat Haugen (pthau...@us.ibm.com). @@ -97,12 +98,12 @@ (eq_attr "update" "no") (eq_attr "size" "!128") (eq_attr "prefixed" "no") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_any_power10,LU_power10") (define_insn_reservation "power10-fused-load" 4 (and (eq_attr "type" "fused_load_cmpi,fused_addis_load,fused_load_load") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-prefixed-load" 4 @@ -110,13 +111,13 @@ (eq_attr "update" "no") (eq_attr "size" "!128") (eq_attr "prefixed" "yes") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-load-update" 4 (and (eq_attr "type" "load") (eq_attr "update" "yes") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10+SXU_power10") (define_insn_reservation "power10-fpload-double" 4 @@ -124,7 +125,7 @@ (eq_attr "update" "no") (eq_attr "size" "64") (eq_attr "prefixed" "no") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_any_power10,LU_power10") (define_insn_reservation "power10-prefixed-fpload-double" 4 @@ -132,14 +133,14 @@ (eq_attr "update" "no") (eq_attr "size" "64") (eq_attr "prefixed" "yes") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-fpload-update-double" 4 (and (eq_attr "type" "fpload") (eq_attr "update" "yes") (eq_attr "size" "64") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10+SXU_power10") ; SFmode loads are cracked and have additional 3 cycles over DFmode @@ -148,27 +149,27 @@ (and (eq_attr "type" "fpload") (eq_attr "update" "no") (eq_attr "size" "32") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10") (define_insn_reservation "power10-fpload-update-single" 7 (and (eq_attr "type" "fpload") (eq_attr "update" "yes") (eq_attr "size" "32") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10+SXU_power10") (define_insn_reservation "power10-vecload" 4 (and (eq_attr "type" "vecload") (eq_attr "size" "!256") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_any_power10,LU_power10") ; lxvp (define_insn_reservation "power10-vecload-pair" 4 (and (eq_attr "type" "vecload") (eq_attr "size" "256") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,LU_power10+SXU_power10") ; Store Unit @@ -178,12 +179,12 @@ (eq_attr "prefixed" "no") (eq_attr "size" "!128") (eq_attr "size" "!256") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_any_power10,STU_power10") (define_insn_reservation "power10-fused-store" 0 (and (eq_attr "type" "fused_store_store") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,STU_power10") (define_insn_reservation "power10-prefixed-store" 0 @@ -191,52 +192,52 @@ (eq_attr "prefixed" "yes") (eq_attr "size" "!128") (eq_attr "size" "!256") - (eq_attr "cpu" "power10,power11")) + (eq_attr "cpu" "power10,power11,future")) "DU_even_power10,STU_power10") ; Update fo
[gcc(refs/users/meissner/heads/work166)] Update ChangeLog.*
https://gcc.gnu.org/g:373ebc4c081d8e60a58a832f7b4244b8b5794d68 commit 373ebc4c081d8e60a58a832f7b4244b8b5794d68 Author: Michael Meissner Date: Fri May 17 21:01:02 2024 -0400 Update ChangeLog.* Diff: --- gcc/ChangeLog.meissner | 185 - 1 file changed, 184 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index 50c34720bc0d..c192220892b8 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,6 +1,189 @@ + Branch work166, patch #11 + +Add -mcpu=future tuning support. + +This patch makes -mtune=future use the same tuning decision as -mtune=power11. + +2024-05-17 Michael Meissner + +gcc/ + + * config/rs6000/power10.md (all reservations): Add future as an + alterntive to power10 and power11. + + Branch work166, patch #10 + +Add -mcpu=future support. + +This patch adds the future option to the -mcpu= and -mtune= switches. + +This patch treats the future like a power11 in terms of costs and reassociation +width. + +This patch issues a ".machine future" to the assembly file if you use +-mcpu=power11. + +This patch defines _ARCH_PWR_FUTURE if the user uses -mcpu=future. + +This patch allows GCC to be configured with the --with-cpu=future and +--with-tune=future options. + +This patch passes -mfuture to the assembler if the user uses -mcpu=future. + +2024-05-17 Michael Meissner + +gcc/ + + * config.gcc (rs6000*-*-*, powerpc*-*-*): Add support for power11. + * config/rs6000/aix71.h (ASM_CPU_SPEC): Add support for -mcpu=power11. + * config/rs6000/aix72.h (ASM_CPU_SPEC): Likewise. + * config/rs6000/aix73.h (ASM_CPU_SPEC): Likewise. + * config/rs6000/driver-rs6000.cc (asm_names): Likewise. + * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define + _ARCH_PWR_FUTURE if -mcpu=future. + * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): New define. + (POWERPC_MASKS): Add future isa bit. + (power11 cpu): Add future definition. + * config/rs6000/rs6000-opts.h (PROCESSOR_FUTURE): Add future processor. + * config/rs6000/rs6000-string.cc (expand_compare_loop): Likewise. + * config/rs6000/rs6000-tables.opt: Regenerate. + * config/rs6000/rs6000.cc (rs6000_option_override_internal): Add future + support. + (rs6000_machine_from_flags): Likewise. + (rs6000_reassociation_width): Likewise. + (rs6000_adjust_cost): Likewise. + (rs6000_issue_rate): Likewise. + (rs6000_sched_reorder): Likewise. + (rs6000_sched_reorder2): Likewise. + (rs6000_register_move_cost): Likewise. + (rs6000_opt_masks): Likewise. + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Likewise. + * config/rs6000/rs6000.md (cpu attribute): Add future. + * config/rs6000/rs6000.opt (-mpower11): Add internal future ISA flag. + * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mcpu=future. + + Branch work166, patch #3 + +Add -mcpu=power11 tests. + +This patch adds some simple tests for -mcpu=power11 support. In order to run +these tests, you need an assembler that supports the appropriate option for +supporting the Power11 processor (-mpower11 under Linux or -mpwr11 under AIX). + +2024-05-17 Michael Meissner + +gcc/testsuite/ + + * gcc.target/powerpc/power11-1.c: New test. + * gcc.target/powerpc/power11-2.c: Likewise. + * gcc.target/powerpc/power11-3.c: Likewise. + * lib/target-supports.exp (check_effective_target_power11_ok): Add new + effective target. + + Branch work166, patch #2 + +Add -mcpu=power11 tuning support. + +This patch makes -mtune=power11 use the same tuning decisions as -mtune=power10. + +2024-05-17 Michael Meissner + +gcc/ + + * config/rs6000/power10.md (all reservations): Add power11 as an + alternative to power10. + + Branch work166, patch #1 + +Add -mcpu=power11 support. + +This patch adds the power11 option to the -mcpu= and -mtune= switches. + +This patch treats the power11 like a power10 in terms of costs and reassociation +width. + +This patch issues a ".machine power11" to the assembly file if you use +-mcpu=power11. + +This patch defines _ARCH_PWR11 if the user uses -mcpu=power11. + +This patch allows GCC to be configured with the --with-cpu=power11 and +--with-tune=power11 options. + +This patch passes -mpwr11 to the assembler if the user uses -mcpu=power11. + +This patch adds support for using "power11" in the __builtin_cpu_is built-in +function. + +2024-05-17 Michael Meissner + +gcc/ + + * config.gcc (rs6000*-*-*, powerpc*-*-*): Add support for power11. + * config/rs6000/aix71.h (ASM_CPU_SPEC): Add support for -mcpu=power11. + * config/rs6000/aix72.h (ASM_CPU_SPEC): Li
[gcc/meissner/heads/work166-bugs] (8 commits) Merge commit 'refs/users/meissner/heads/work166-bugs' of gi
The branch 'meissner/heads/work166-bugs' was updated to point to: 0c733b94c2d6... Merge commit 'refs/users/meissner/heads/work166-bugs' of gi It previously pointed to: 4adff7dc8cd2... Add ChangeLog.bugs and update REVISION. Diff: Summary of changes (added commits): --- 0c733b9... Merge commit 'refs/users/meissner/heads/work166-bugs' of gi fac728f... Add ChangeLog.bugs and update REVISION. 373ebc4... Update ChangeLog.* (*) a0ccb78... Add -mcpu=future tuning support. (*) 78dc639... Add -mcpu=future support. (*) d69f7b4... Add -mcpu=power11 tests. (*) c47c66e... Add -mcpu=power11 tuning support. (*) 00c9f9b... Add -mcpu=power11 support. (*) (*) This commit already exists in another branch. Because the reference `refs/users/meissner/heads/work166-bugs' matches your hooks.email-new-commits-only configuration, no separate email is sent for this commit.
[gcc(refs/users/meissner/heads/work166-bugs)] Add ChangeLog.bugs and update REVISION.
https://gcc.gnu.org/g:fac728fd72e41d2ee9292dd39570b66bf5e62b23 commit fac728fd72e41d2ee9292dd39570b66bf5e62b23 Author: Michael Meissner Date: Fri May 17 20:47:59 2024 -0400 Add ChangeLog.bugs and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.bugs: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.bugs | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.bugs b/gcc/ChangeLog.bugs new file mode 100644 index ..48a479c763ff --- /dev/null +++ b/gcc/ChangeLog.bugs @@ -0,0 +1,6 @@ + Branch work166-bugs, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..5e353b50cf66 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-bugs branch
[gcc(refs/users/meissner/heads/work166-bugs)] Merge commit 'refs/users/meissner/heads/work166-bugs' of git+ssh://gcc.gnu.org/git/gcc into me/work1
https://gcc.gnu.org/g:0c733b94c2d60debfec04af40b87382bb2a8b1e8 commit 0c733b94c2d60debfec04af40b87382bb2a8b1e8 Merge: fac728fd72e4 4adff7dc8cd2 Author: Michael Meissner Date: Fri May 17 21:02:22 2024 -0400 Merge commit 'refs/users/meissner/heads/work166-bugs' of git+ssh://gcc.gnu.org/git/gcc into me/work166-bugs Diff:
[gcc/meissner/heads/work166-dmf] (8 commits) Merge commit 'refs/users/meissner/heads/work166-dmf' of git
The branch 'meissner/heads/work166-dmf' was updated to point to: 93ac8e1984dd... Merge commit 'refs/users/meissner/heads/work166-dmf' of git It previously pointed to: 40164d125941... Add ChangeLog.dmf and update REVISION. Diff: Summary of changes (added commits): --- 93ac8e1... Merge commit 'refs/users/meissner/heads/work166-dmf' of git 4c7f520... Add ChangeLog.dmf and update REVISION. 373ebc4... Update ChangeLog.* (*) a0ccb78... Add -mcpu=future tuning support. (*) 78dc639... Add -mcpu=future support. (*) d69f7b4... Add -mcpu=power11 tests. (*) c47c66e... Add -mcpu=power11 tuning support. (*) 00c9f9b... Add -mcpu=power11 support. (*) (*) This commit already exists in another branch. Because the reference `refs/users/meissner/heads/work166-dmf' matches your hooks.email-new-commits-only configuration, no separate email is sent for this commit.
[gcc(refs/users/meissner/heads/work166-dmf)] Add ChangeLog.dmf and update REVISION.
https://gcc.gnu.org/g:4c7f5203b45e07a82673f95f5dfa8fb6c9dde105 commit 4c7f5203b45e07a82673f95f5dfa8fb6c9dde105 Author: Michael Meissner Date: Fri May 17 20:40:56 2024 -0400 Add ChangeLog.dmf and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.dmf: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.dmf | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.dmf b/gcc/ChangeLog.dmf new file mode 100644 index ..ab0fdd1054fb --- /dev/null +++ b/gcc/ChangeLog.dmf @@ -0,0 +1,6 @@ + Branch work166-dmf, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..ee73a03644d7 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-dmf branch
[gcc(refs/users/meissner/heads/work166-dmf)] Merge commit 'refs/users/meissner/heads/work166-dmf' of git+ssh://gcc.gnu.org/git/gcc into me/work16
https://gcc.gnu.org/g:93ac8e1984dd4f23f79508ab73112adb197dfba2 commit 93ac8e1984dd4f23f79508ab73112adb197dfba2 Merge: 4c7f5203b45e 40164d125941 Author: Michael Meissner Date: Fri May 17 21:03:34 2024 -0400 Merge commit 'refs/users/meissner/heads/work166-dmf' of git+ssh://gcc.gnu.org/git/gcc into me/work166-dmf Diff:
[gcc(refs/users/meissner/heads/work166-tar)] Add ChangeLog.tar and update REVISION.
https://gcc.gnu.org/g:b0dd90490ee602491f114faf07969e6baf4b9f49 commit b0dd90490ee602491f114faf07969e6baf4b9f49 Author: Michael Meissner Date: Fri May 17 20:47:03 2024 -0400 Add ChangeLog.tar and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.tar: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.tar | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.tar b/gcc/ChangeLog.tar new file mode 100644 index ..3e168fa367eb --- /dev/null +++ b/gcc/ChangeLog.tar @@ -0,0 +1,6 @@ + Branch work166-tar, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..3b5b120ee37e 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-tar branch
[gcc/meissner/heads/work166-tar] (8 commits) Merge commit 'refs/users/meissner/heads/work166-tar' of git
The branch 'meissner/heads/work166-tar' was updated to point to: 7f03db8d2914... Merge commit 'refs/users/meissner/heads/work166-tar' of git It previously pointed to: 1a2e3e0e4240... Add ChangeLog.tar and update REVISION. Diff: Summary of changes (added commits): --- 7f03db8... Merge commit 'refs/users/meissner/heads/work166-tar' of git b0dd904... Add ChangeLog.tar and update REVISION. 373ebc4... Update ChangeLog.* (*) a0ccb78... Add -mcpu=future tuning support. (*) 78dc639... Add -mcpu=future support. (*) d69f7b4... Add -mcpu=power11 tests. (*) c47c66e... Add -mcpu=power11 tuning support. (*) 00c9f9b... Add -mcpu=power11 support. (*) (*) This commit already exists in another branch. Because the reference `refs/users/meissner/heads/work166-tar' matches your hooks.email-new-commits-only configuration, no separate email is sent for this commit.
[gcc(refs/users/meissner/heads/work166-tar)] Merge commit 'refs/users/meissner/heads/work166-tar' of git+ssh://gcc.gnu.org/git/gcc into me/work16
https://gcc.gnu.org/g:7f03db8d29149b9b3c0a04f849d38649e5917c08 commit 7f03db8d29149b9b3c0a04f849d38649e5917c08 Merge: b0dd90490ee6 1a2e3e0e4240 Author: Michael Meissner Date: Fri May 17 21:05:34 2024 -0400 Merge commit 'refs/users/meissner/heads/work166-tar' of git+ssh://gcc.gnu.org/git/gcc into me/work166-tar Diff:
[gcc/meissner/heads/work166-test] (8 commits) Merge commit 'refs/users/meissner/heads/work166-test' of gi
The branch 'meissner/heads/work166-test' was updated to point to: 92c1554aaa04... Merge commit 'refs/users/meissner/heads/work166-test' of gi It previously pointed to: ebd3fabfb5ba... Add ChangeLog.test and update REVISION. Diff: Summary of changes (added commits): --- 92c1554... Merge commit 'refs/users/meissner/heads/work166-test' of gi d955b23... Add ChangeLog.test and update REVISION. 373ebc4... Update ChangeLog.* (*) a0ccb78... Add -mcpu=future tuning support. (*) 78dc639... Add -mcpu=future support. (*) d69f7b4... Add -mcpu=power11 tests. (*) c47c66e... Add -mcpu=power11 tuning support. (*) 00c9f9b... Add -mcpu=power11 support. (*) (*) This commit already exists in another branch. Because the reference `refs/users/meissner/heads/work166-test' matches your hooks.email-new-commits-only configuration, no separate email is sent for this commit.
[gcc(refs/users/meissner/heads/work166-test)] Add ChangeLog.test and update REVISION.
https://gcc.gnu.org/g:d955b23a2461097fbd714d30945505762cdd0a21 commit d955b23a2461097fbd714d30945505762cdd0a21 Author: Michael Meissner Date: Fri May 17 20:48:57 2024 -0400 Add ChangeLog.test and update REVISION. 2024-05-17 Michael Meissner gcc/ * ChangeLog.test: New file for branch. * REVISION: Update. Diff: --- gcc/ChangeLog.test | 6 ++ gcc/REVISION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.test b/gcc/ChangeLog.test new file mode 100644 index ..e2a281f8f9ec --- /dev/null +++ b/gcc/ChangeLog.test @@ -0,0 +1,6 @@ + Branch work166-test, baseline + +2024-05-17 Michael Meissner + + Clone branch + diff --git a/gcc/REVISION b/gcc/REVISION index 42eef54d0aeb..a8ef9d6b8080 100644 --- a/gcc/REVISION +++ b/gcc/REVISION @@ -1 +1 @@ -work166 branch +work166-test branch