aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
10 daysivopts: Fix scan-assembler-not regexes for aarch64/sve testChristopher Bazley1-2/+2
The test added by r16-1671-ge7ff8e8d77df74 passed despite using regular expressions that would never match real assembly language output from the compiler. Because the regular expressions were not expected to match, and didn't, this was not noticeable; however, it also made that part of the test useless. The regular expressions have been fixed. Verified that the fixed regular expressions do match assembly language output produced by the compiler before the changes to ivopts in commit e7ff8e8d77d, but do not match assembly language output produced by the compiler after the changes to ivopts. gcc/testsuite/ChangeLog: * gcc.target/aarch64/sve/adr_7.c: Fix regular expressions.
10 daysRISC-V: Add test for vec_duplicate + vssubu.vv combine case 1 with GR2VR ↵Pan Li12-0/+24
cost 0, 1 and 2 Add asm dump check test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 1 and 2. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u16.c: Add asm check for vssubu.vx combine. * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u8.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-5-u16.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-5-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-5-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-5-u8.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-6-u16.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-6-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-6-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-6-u8.c: Ditto. Signed-off-by: Pan Li <pan2.li@intel.com>
10 daysRISC-V: Add test for vec_duplicate + vssubu.vv combine case 0 with GR2VR ↵Pan Li18-1/+293
cost 0, 2 and 15 Add asm dump check and run test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 2 and 15. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check. * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c: Ditto. * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test helper macros. * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test data for run test. * gcc.target/riscv/rvv/autovec/vx_vf/vx_vssub-run-1-u16.c: New test. * gcc.target/riscv/rvv/autovec/vx_vf/vx_vssub-run-1-u32.c: New test. * gcc.target/riscv/rvv/autovec/vx_vf/vx_vssub-run-1-u64.c: New test. * gcc.target/riscv/rvv/autovec/vx_vf/vx_vssub-run-1-u8.c: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
10 daysRISC-V: Reconcile the existing test due to cost model changePan Li3-3/+3
The cost model change will make the default cost of vx to 2, thus reconcile the asm check for this change. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_trunc-1-u16.c: Update the asm check due to cost model change. * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_trunc-1-u32.c: Diito. * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_trunc-1-u8.c: Ditto. Signed-off-by: Pan Li <pan2.li@intel.com>
10 daysRISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR costPan Li3-1/+3
This patch would like to combine the vec_duplicate + vssubu.vv to the vssubu.vx. From example as below code. The related pattern will depend on the cost of vec_duplicate from GR2VR. Then the late-combine will take action if the cost of GR2VR is zero, and reject the combination if the GR2VR cost is greater than zero. Assume we have example code like below, GR2VR cost is 0. #define DEF_VX_BINARY(T, FUNC) \ void \ test_vx_binary (T * restrict out, T * restrict in, T x, unsigned n) \ { \ for (unsigned i = 0; i < n; i++) \ out[i] = FUNC (in[i], x); \ } T sat_sub(T a, T b) { return (a - b) & (-(T)(a >= b)); } DEF_VX_BINARY(uint32_t, sat_sub) Before this patch: 10 │ test_vx_binary_or_int32_t_case_0: 11 │ beq a3,zero,.L8 12 │ vsetvli a5,zero,e32,m1,ta,ma 13 │ vmv.v.x v2,a2 14 │ slli a3,a3,32 15 │ srli a3,a3,32 16 │ .L3: 17 │ vsetvli a5,a3,e32,m1,ta,ma 18 │ vle32.v v1,0(a1) 19 │ slli a4,a5,2 20 │ sub a3,a3,a5 21 │ add a1,a1,a4 22 │ vssubu.vv v1,v1,v2 23 │ vse32.v v1,0(a0) 24 │ add a0,a0,a4 25 │ bne a3,zero,.L3 After this patch: 10 │ test_vx_binary_or_int32_t_case_0: 11 │ beq a3,zero,.L8 12 │ slli a3,a3,32 13 │ srli a3,a3,32 14 │ .L3: 15 │ vsetvli a5,a3,e32,m1,ta,ma 16 │ vle32.v v1,0(a1) 17 │ slli a4,a5,2 18 │ sub a3,a3,a5 19 │ add a1,a1,a4 20 │ vssubu.vx v1,v1,a2 21 │ vse32.v v1,0(a0) 22 │ add a0,a0,a4 23 │ bne a3,zero,.L3 gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_vx_binary_vec_vec_dup): Add new case US_MINUS. * config/riscv/riscv.cc (riscv_rtx_costs): Ditto. * config/riscv/vector-iterators.md: Add new op us_minus. Signed-off-by: Pan Li <pan2.li@intel.com>
10 daysada: Fix Execution_Successful value with exceptionsViljar Indus7-20/+29
Store the Exit_Code value and use that to generate the Exceution_Successful value in the SARIF report. gcc/ada/ChangeLog: * comperr.adb (Compiler_Abort): Pass the exit code in calls to Output_Messages. * errout.adb (Output_Messages): Add new parameter for the Exit_Code and store its value. * errout.ads (Output_Messages): Likewise. * erroutc-sarif_emitter.adb (Print_Invocations): Set Execution_Successful based on the exit code. * erroutc.ads (Exit_Code): Store the exit code value. * gnat1drv.adb (Gnat1drv): Pass the exit code in calls to Output_Messages. * prepcomp.adb (Parse_Preprocessing_Data_File, Prpare_To_Preprocess): Likewise.
10 daysada: Refine use of Has_ExitRonan Desplanques1-1/+1
The description of the Has_Exit field in Einfo makes it pretty clear that it can only be meaningful for loop entities. It was however defined in all entities until this patch, which restricts this field to E_Loop. gcc/ada/ChangeLog: * gen_il-gen-gen_entities.adb (Gen_Entities): Tweak Has_Exit.
10 daysada: Make class-wide Max_Size_In_Storage_Elements return a large valueBob Duff1-7/+27
Max_Size_In_Storage_Elements is supposed to return a value greater or equal to what is passed for any heap allocation for an object of the type. For a tagged type T, we don't know the allocation size for descendants; therefore T'Class'Max_Size_In_Storage_Elements should return a huge number. In particular, it now returns Storage_Count'Last, which is greater than any possible heap allocation. Previously, T'Class'Max_Size_In_Storage_Elements was returning the same value as T'Max_Size_In_Storage_Elements, which was wrong. gcc/ada/ChangeLog: * exp_attr.adb (Attribute_Max_Size_In_Storage_Elements): Return Storage_Count'Last converted to universal_integer.
10 daysada: Add documentation of implemented Ada 2022 featuresTonu Naks6-928/+6599
gcc/ada/ChangeLog: * doc/gnat_rm.rst: add entry point for the new chapter * doc/gnat_rm/about_this_guide.rst: add reference to the new chapter * doc/gnat_rm/implementation_of_ada_2022_features.rst: new file * doc/gnat_rm/implementation_of_ada_2012_features.rst: update explanation about RM references * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
10 daysada: Reuse Snames classification of reserved wordsRonan Desplanques1-6/+9
Before this patch, Check_Future_Keyword had hardcoded lists of what reserved words were introduced in what versions of the Ada language specification. This patch makes it use the classification in Snames instead. gcc/ada/ChangeLog: * par-util.adb (Check_Future_Keyword): Use Snames subtypes. Extend comment.
10 daysada: Remove obsolete commentRonan Desplanques1-4/+0
This patch removes a comment that was left over when an exception declaration was removed. gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Loop_Statement): Remove obsolete comment.
10 daysada: Fix bug in -gnatw.o switch (unreferenced out parameters)Bob Duff1-1/+1
Fixes this bug: If -gnatw.o is specified, it is ignored unless -gnatwm is also specified (either directly, or as part of a catch-all switch like -gnatwa). gcc/ada/ChangeLog: * sem_warn.adb (Warn_On_Useless_Assignments): Enable Warn_On_Useless_Assignment in the case of Warn_On_All_Unread_Out_Parameters.
10 daysada: Remove uses of E_Void for subtype declarationsRonan Desplanques1-9/+34
This patch slightly reorganizes Analyze_Subtype_Declaration so that the proper Ekind of the new subtype's entity is set before anything else is done with it. A new local subprogram is introduced in the process. gcc/ada/ChangeLog: * sem_ch3.adb (Analyze_Subtype_Declaration): Remove uses of E_Void. (Copy_Parent_Attributes): New procedure.
10 daysada: Remove useless Set_Scope callsRonan Desplanques1-4/+0
This patch remove calls to Set_Scope that have no effect because of subsequent calls to Append_Entity, which calls Set_Scope itself. gcc/ada/ChangeLog: * cstand.adb (Make_Aliased_Component, Make_Formal, New_Operator, Create_Standard): Remove useless calls.
10 daysada: Fix missing rounding in System.Value_R.Scan_Raw_RealEric Botcazou1-11/+36
The extra digit returned by the function is supposed to be rounded, either by Scan_Integral_Digits or by Scan_Decimal_Digits, but that is not the case when it is the last digit read by Scan_Integral_Digits. The problem is fixed by rounding it in Scan_Decimal_Digits in this case. gcc/ada/ChangeLog: * libgnat/s-valuer.adb (Scan_Decimal_Digits): Also pretend that the precision limit was just reached if it was already reached. (Scan_Integral_Digits): Add Extra_Rounded out parameter, set it to False on entry and to True when Extra is rounded. (Scan_Raw_Real): New Extra_Rounded local variable. Pass it in the calls to Scan_Integral_Digits. If it is True, pass a dummy extra digit to Scan_Decimal_Digits.
10 daysada: Ignore ghost predicate in Ada.Strings.SuperboundedClaire Dross1-4/+5
Add an assertion policy to ignore the ghost predicates in Ada.Strings.Superbounded. gcc/ada/ChangeLog: * libgnat/a-strsup.ads: Ignore Ghost_Predicate in the assertion policy.
10 daysada: Array aggregates of mutably tagged objectsJavier Miranda8-74/+287
When an array of mutably tagged class-wide types is initialized with an array aggregate, the compiler erroneously rejects it reporting that the type of the aggregate cannot be a class-wide type. In addition, Program_Error is not raised at runtime on array type or record type objects when they have mutably tagged abstract class-wide type components that are initialized by default. gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Record_Aggregate): Adjust the code to handle mutably tagged class-wide types since they don't have discriminants, but all class-wide types are considered to have unknown discriminants. Initialize mutably tagged class-wide type components calling their IP subprogram. * exp_aggr.adb (Gen_Assign): Handle mutably tagged class-wide type components that have an initializing qualified expression, and mutably tagged class-wide components default initialization. (Gen_Loop): Handle mutably tagged class-wide types. (Gen_Assign): ditto. (Build_Record_Aggr_Code): Default initialization of mutably tagged class-wide types is performed by their IP subprogram. * exp_ch3.adb (Init_Component): Generate code to raise Program_Error in the IP subprogram of arrays when the type of their components is a mutably tagged abstract class-wide type. (Build_Init_Procedure): ditto for the init procedure of record types. (Build_Init_Statements): Ensure that the type of the expression initializing a mutably class-wide tagged type component is frozen. (Requires_Init_Proc): Mutably tagged class-wide types require the init-proc since it takes care of their default initialization. * sem_util.adb (Needs_Simple_Initialization): Mutably tagged class-wide types don't require simple initialization. * types.ads (PE_Abstract_Type_Component): New reason for Program_Error. * types.h (PE_Abstract_Type_Component): ditto. * exp_ch11.adb (Get_RT_Exception_Name): Handle new reason for Program_Error. * libgnat/a-except.adb (Rcheck_PE_Abstract_Type_Component): New subprogram.
10 daysada: Sort subprogram declaration in alphabetic orderPiotr Trojanek1-21/+21
Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_util.ads (Get_Enclosing_Object, Get_Enum_Lit_From_Pos, Is_Universal_Numeric_Type): Reorder declarations.
10 daysada: Ignore unchecked type conversions while getting enclosing objectPiotr Trojanek1-1/+3
This patch both makes GNAT emit warnings on unused assignments where previously they were suppressed for obscure reasons and synchronizes routine Get_Enclosing_Object with a similar routine in GNATprove (which differs in handling of explicit dereferences). gcc/ada/ChangeLog: * sem_util.adb (Get_Enclosing_Object): Traverse unchecked type conversions since they from the compiler and should be transparent for semantic reasoning.
10 daysada: Fix Itype-related predicate check omissions (part 2).Steve Baird1-0/+19
Add to the previous fix for this issue to better handle cases where GNATProve calls Einfo.Utils.Predicate_Function, passing in an Itype. gcc/ada/ChangeLog: * einfo-utils.adb (Predicate_Function): Look through an Itype if that takes us to another subtype of the same type.
10 daysada: Filling in gaps in handling of inherited Pre/Post'Class aspectsGary Dismukes2-52/+156
The initial set of changes for doing proper mapping of calls to primitive functions in Pre/Post'Class aspects inherited by derived types was not handling some cases (such as when formals are referenced as part of dereferences, certain aspects such as 'Old and 'Access, and conditional and declare expressions), and mishandling other cases (such as nested function calls). This set of changes attempts to properly address those cases. It also includes a change to suppress unneeded (and sometimes wrong) accessibility checks on conversions of actual parameters of a derived type to the parent type when passing them on calls to parent primitives (encountered while developing these changes). gcc/ada/ChangeLog: * exp_util.adb (Must_Map_Call_To_Parent_Primitive): Change function name (was Call_To_Parent_Dispatching_Op_Must_Be_Mapped). Move logic for attributes and dereferences, plus testing for controlled formals, into new function Expr_Has_Ctrl_Formal_Ref. Add handling for access attributes, multiple levels of attributes/dereferences, conditional_expressions, and declare_expressions. Properly account for function calls with multiple operands and enclosing calls. (Expr_Has_Ctrl_Formal_Ref): New function to determine whether an expression is a reference to a controlling formal or has a prefix that is such a reference. (Is_Controlling_Formal_Ref): New function in Expr_Has_Ctrl_Formal_Ref to determine if a node is a direct reference to a controlling formal. * freeze.adb (Build_DTW_Body): Create an unchecked conversion instead of a regular type conversion for converting actuals in calls to parent inherited primitives that are wrapped for inherited pre/postconditions. Avoids generating unnecessary checks (such as accessibility checks on conversions for anonymous access formals).
10 daysada: Tune name and commend document of a ghost utility routinePiotr Trojanek3-42/+40
Detection of ghost entities work similarly for names of objects (in assignment statements) and for names of subprograms (in subprogram calls). Tune routine name and its comment to match this similarity. gcc/ada/ChangeLog: * sem_util.ads (Get_Enclosing_Ghost_Entity): Rename spec. * sem_util.adb (Get_Enclosing_Ghost_Object): Rename body; reorder alphabetically; adapt recursive call. * ghost.adb: Adapt calls to Get_Enclosing_Ghost_Object.
10 daysada: Fix detection of ghost objects in unusual procedure callsPiotr Trojanek1-30/+4
When name of a called procedure involves unusual constructs, e.g. type conversions (like in "Typ (Obj).all"), we must look at the outermost construct to decide whether the name denotes a ghost entity. gcc/ada/ChangeLog: * ghost.adb (Ghost_Entity): Remove; use Get_Enclosing_Ghost_Object instead; adapt callers.
10 daysada: Fix bogus error for pragma No_Component_Reordering on record typeEric Botcazou1-8/+9
This happens when the record type has an incomplete declaration before its full declaration and is fixed by calling Find_Type appropriately. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma) <Pragma_No_Component_Reordering>: Call Find_Type on the first argument of the pragma.
10 daysada: Remove redundant `gnatls -l` switchTonu Naks1-39/+0
gcc/ada/ChangeLog: * gnatls.adb: remove -l switch
10 daysada: 'Size'Class and interface types documentationSteve Baird2-157/+234
Update GNAT RM documentation of the Size'Class aspect. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Update documentation for mutably tagged types and the Size'Class aspect. * gnat_rm.texi: Regenerate.
10 daysada: Fix detection of ghost objects in assignment statementsPiotr Trojanek3-58/+38
Remove duplicated and inconsistent code for detecting ghost objects on the left-hand side of assignment statements. Fix detection in the presence of attribute references (e.g. "X'Access.all"), function calls (e.g. "F.all"), qualified expressions (e.g. "T'(new Integer'(0)).all") and unchecked type conversions (which come from expansion). gcc/ada/ChangeLog: * ghost.adb (Whole_Object_Ref): Remove; use Get_Enclosing_Ghost_Object instead. (Is_Ghost_Assignment): Handle more than object identifiers. (Mark_And_Set_Ghost_Assignment): Likewise. * sem_util.adb (Get_Enclosing_Ghost_Object): Detect more expressions as ghost references; rename to better match the intended meaning. * sem_util.ads (Get_Enclosing_Ghost_Object): Rename; adjust comment.
10 daysada: Fix fallout of latest change to aggregate expansionEric Botcazou1-1/+3
It exposed a small loophole in the Backend_Processing_Possible predicate. gcc/ada/ChangeLog: * exp_aggr.adb (Backend_Processing_Possible.Component_Check): Return False for delayed conditional expressions.
10 daysada: Elide copy for calls as values of nonlimited by-reference componentsEric Botcazou6-65/+131
...in aggregates. This prevents a temporary from being created on the primary stack to hold the result of the function calls before it is copied to the component of the aggregate in the nonlimited by-reference case. This requires a small tweak to Check_Function_Writable_Actuals to avoid giving a spurious error in a specific case. gcc/ada/ChangeLog: * exp_aggr.ads (Parent_Is_Regular_Aggregate): New predicate. * exp_aggr.adb (In_Place_Assign_OK.Safe_Component): Implement more accurate criterion for function calls. (Convert_To_Assignments): Use Parent_Is_Regular_Aggregate predicate. (Expand_Array_Aggregate): Likewise. Remove obsolete comment. (Initialize_Component): Do not adjust when the expression is a naked function call and Back_End_Return_Slot is True. (Parent_Is_Regular_Aggregate): New predicate. * exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Add test of Back_End_Return_Slot in conjunction with a function call. * exp_ch4.adb (Expand_Allocator_Expression): Likewise. Use the Is_Container_Aggregate predicate to detect container aggregates. (Expand_N_Case_Expression): Delay the expansion if the parent is a regular aggregate and the type should not be copied. (Expand_N_If_Expression): Likewise. (New_Assign_Copy): New function. * exp_ch6.adb (Expand_Ctrl_Function_Call): Bail out when the parent is a regular aggregate. * sem_util.adb (Check_Function_Writable_Actuals): Do not take into account attribute references created by the compiler.
10 daysada: use pointer decay for socket address type compatibilityAlexandre Oliva1-6/+6
GCC 14 is stricter about type conversions. Taking the address of an array and decaying the array to a pointer to its first element yield the same address, but the types are no longer considered compatible. The socket data structures want decayed pointers rather than addresses of arrays, so drop the '&'s. gcc/ada/ChangeLog: * socket.c [__vxworks] (__gnat_gethostbyname): Drop excess '&'. (__gnat_gethostbyaddr): Likewise.
10 daysada: include header to declare isalpha in adaintAlexandre Oliva1-0/+1
A vxworks-specific part of adaint.c calls isalpha without including ctype.h. gcc-14 rejects calls of undeclared functions. Include the required header file when compiling for vxworks. gcc/ada/ChangeLog: * adaint.c [__vxworks]: Include ctype.h.
10 daysada: Record type Put_Image procedures omitting discriminant valuesSteve Baird1-14/+41
If a type T has a partial view with a known_discriminant_part and no user-specified Put_Image aspect specification, then the output generated by T'Put_Image would incorrectly omit the discriminant values. gcc/ada/ChangeLog: * exp_put_image.adb (Build_Record_Put_Image_Procedure): If Discriminant_Specifications takes us from the full view of a type to an (intentionally) unanalyzed subtree, then instead find discriminant entities by calling Discriminant_Specifications on the partial view of the type.
10 daysada: Fix crash on nested access-to-subprogram typesRonan Desplanques3-11/+11
This patch fixes a crash on some subprograms with anonymous access-to-subprogram parameters by removing delayed freezing of subprograms in some cases where it wasn't necessary. The -gnatD output for itypes is also improved. gcc/ada/ChangeLog: * sem_ch6.adb (Check_Delayed_Subprogram, Possible_Freeze): Restrict cases where freezing is delayed. * sem_ch6.ads (Check_Delayed_Subprogram): Improve documentation comment. * sprint.adb (Write_Itype): Improve output.
10 daysada: Remove redundant condition in test of System.Val_Real.Integer_To_RealEric Botcazou2-8/+9
The second condition of the conjunction is redundant with the first. gcc/ada/ChangeLog: * libgnat/s-valrea.adb (Integer_to_Real): Rename to... (Integer_To_Real): ...this. Remove the second condition of the conjunction in the test for the zero value. (Scan_Real): Adjust to above renaming. (Value_Real): Likewise. * libgnat/s-valuer.ads (Scan_Raw_Real): Add note about Val.
10 daysada: Fix a couple of typos in the sanitizers for AdaJose Ruiz2-8/+5
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Fix a couple of minor formatting issues. * gnat_ugn.texi: Regenerate.
10 daysada: Add entity chain debug printing subprogramsRonan Desplanques2-0/+72
This patchs adds two pn-like subprograms that print entity chains. gcc/ada/ChangeLog: * treepr.ads (Print_Entity_Chain, pec, rpec): New subprograms. * treepr.adb (Print_Entity_Chain, pec, rpec): Likewise.
10 daysada: Fix typo in commentRonan Desplanques1-1/+1
gcc/ada/ChangeLog: * atree.ads (Parent_Or_List_Containing): Fix typo.
10 daysada: Tweak handling of Parent field in Print_NodeRonan Desplanques1-2/+2
Before this patch, Print_Node failed to honor its Prefix_Char formal parameter when printing the Parent field. This had no consequences because Prefix_Char was only used to print members of Nlists, and those don't have a parent in the tree. But this patch fixes it anyway in preparation for new debug printing features. gcc/ada/ChangeLog: * treepr.adb (Print_Node): Tweak Parent field printing.
10 daysada: Document sanitizers for AdaJose Ruiz2-2/+4
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Add the documentation about using sanitizers with Ada code. * gnat_ugn.texi: Regenerate.
10 daysada: Document sanitizers for AdaJose Ruiz2-173/+787
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Add the documentation about using sanitizers with Ada code. * gnat_ugn.texi: Regenerate.
10 daysada: Remove dead branch from Get_Enclosing_ObjectPiotr Trojanek1-8/+1
The dead branch in routine Get_Enclosing_Object was most likely some experiment from the early days of GNATprove. This routine is meant to be called with the LHS of an assignment statement where an implicit dereference is always rewritten into explicit one, regardless if code is generated. gcc/ada/ChangeLog: * sem_util.adb (Get_Enclosing_Object): Remove dead code.
10 daysada: Fix Itype-related predicate check omissions.Steve Baird3-3/+118
Clean up problematic interactions between Itype subtypes and predicates, which were causing required predicate checks to be (incorrectly) omitted. gcc/ada/ChangeLog: * einfo-utils.adb (Predicate_Function): Improve handling of a case where a predicate specified for a subtype of a partial view of a type was incorrectly ignored. (Set_Predicate_Function): If the attribute has already been set to the same value, then do nothing (instead of raising P_E). * sem_ch13.adb (Build_Predicate_Function): Add new function Has_Source_Predicate. If a subtype inherits a predicate but also has its own explicitly specified predicate, then avoid misinterpreting the presence of the function built for the inherited predicate to mean that no additional predicate function is needed. * sem_util.adb (Build_Subtype): In the case where we are given a constrained record or array subtype and we need to construct a different subtype, subject to a different constraint, the subtype_mark of the constructed subtype needs to reference an unconstrained subtype (because a new constraint is going to be imposed). If the Predicated_Parent attribute of the given subtype is present and refers to a suitable unconstrained subtype, then use that subtype instead of setting the Predicated_Parent attribute on a new node (and performing the associated attribute copying).
10 daysada: Fix internal error on Ghost aspect applied to Big_IntegersEric Botcazou1-0/+7
That's a regression introduced by the rewrite of the finalization machinery, in the form of dangling references to Master_Node entities remaining in the tree after the removal of the ignored Ghost code. gcc/ada/ChangeLog: * exp_ch7.adb (Process_Transient_In_Scope): Bail out if the object is an ignored ghost entity.
10 daysada: Fix internal error on expression function called for default expressionEric Botcazou1-13/+17
This happens for the default expression of a controlled component when an aggregate is used for the record type, because of a freeze node generated for the expression within an artificial block that is needed to implement the cleanup actions attached to the assignment of the component. This is fixed by extending the special treatment applied to freeze nodes by Insert_Actions, in the case of loops generated for aggregates, to the case of blocks generated for aggregates. gcc/ada/ChangeLog: * exp_util.adb (Insert_Actions): Extend special treatment applied to freeze nodes to the case of blocks generated for aggregates.
10 daysada: Adjust comparisons in if-statements according to coding styleJohannes Kliemann2-3/+3
The Ada coding style requires the use of short circuit forms in if-statements. Use this form consistently for all if-statements. gcc/ada/ChangeLog: * libgnat/s-valuer.adb: Switch missing if-statements to short-circuit form. * libgnat/i-cpoint.adb: Ditto.
10 daysrs6000: Disassemble opaque modes using subregs to allow optimizationsPeter Bergner1-47/+4
PR109116 reveals missed optimizations when using unspecs to extract vector components from opaque-mode variables. Since RTL optimizers do not understand unspecs, this leads to redundant register copies. Replace unspecs with subregs, which are well understood by RTL passes, allowing optimizations to take place. 2025-06-30 Peter Bergner <bergner@linux.ibm.com> gcc/ PR target/109116 * config/rs6000/mma.md (unspec): Delete UNSPEC_MMA_EXTRACT. (vsx_disassemble_pair): Expand into a vector register sized subreg. (mma_disassemble_acc): Likewise. (*vsx_disassemble_pair): Delete. (*mma_disassemble_acc): Likewise.
10 daysRISC-V: Ignore -Oz for most rvv testcase [NFC]Kito Cheng9-12/+12
Most testcase in rvv folder already ignore -Oz, but some of them are not. This patch makes them consistent. gcc/testsuite/ChangeLog. * gcc.target/riscv/rvv/vsetvl/avl_single-21.c: Ignore -Oz. * gcc.target/riscv/rvv/vsetvl/avl_single-26.c: Ditto. * gcc.target/riscv/rvv/vsetvl/avl_single-36.c: Ditto. * gcc.target/riscv/rvv/vsetvl/avl_single-39.c: Ditto. * gcc.target/riscv/rvv/vsetvl/avl_single-41.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvl-22.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-15.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-2.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-4.c: Ditto.
10 daysRISC-V: Primary vector pipeline model for sifive 7 seriesKito Cheng1-1/+136
This commit introduces a primary vector pipeline model for the SiFive 7 series, that pipeline model is kind of simplified version, it only defined vector command queue, arithmetic unit, and vector load store unit. The latency of real hardware is LMUL-aware, but I realize that will complicate the model a lots, so I just use a simplified version, which all LMUL use same latency, we may improve it later once we have found meaningful performance difference. gcc/ChangeLog: * config/riscv/sifive-7.md: Add primary vector pipeline model for SiFive 7 series.
10 daysRISC-V: Adding B ext, fp16 and missing scalar instruction type for sifive-7 ↵Kito Cheng2-3/+34
pipeline model [PR120659] gcc/ChangeLog: PR target/120659 * config/riscv/sifive-7.md: Add B extension, fp16 and missing scalar instruction type for sifive-7 pipeline model. gcc/testsuite/ChangeLog: PR target/120659 * gcc.target/riscv/pr120659.c: New test.
10 daysHandle SLP build operand swapping for ternaries and callsRichard Biener3-10/+60
The following adds SLP build operand swapping for .FMA which is a ternary operator and a call. The current code only handles binary operators in assignments, thus the patch extends this to handle both calls and assignments as well as binary and ternary operators. * tree-vect-slp.cc (vect_build_slp_2): Handle ternary and call operators when swapping operands. * gcc.target/i386/vect-pr82426.c: Pass explicit -ffp-contract=fast. * gcc.target/i386/vect-pr82426-2.c: New testcase variant with -ffp-contract=on.