- Nov 07, 2023
-
-
Richard Biener authored
The following makes the C++98 locale init path follow the way the C++11 performs initialization. This way we deal with pthread_once failing, falling back to non-threadsafe initialization which, given we initialize from the library, should be serialized by the dynamic loader already. PR libstdc++/112351 libstdc++-v3/ * src/c++98/locale.cc (locale::facet::_S_initialize_once): Check whether _S_c_locale is already initialized. (locale::facet::_S_get_c_locale): Always perform non-threadsafe init when threadsafe init failed.
-
Robin Dapp authored
Similar to before this modifies a check so we do only match a vectorization attempt if it succeeded. On riscv we potentially try several modes if which some may fail. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-cond-reduc-4.c: Make check more accurate.
-
Robin Dapp authored
This patch makes sure we check for note: Basic block will be vectorized using SLP instead of optimized: basic block which will also match optimized: basic block part of which there are many more in an RVV dump. gcc/testsuite/ChangeLog: * gcc.dg/vect/bb-slp-over-widen-1.c: Change test expectation. * gcc.dg/vect/bb-slp-over-widen-2.c: Ditto.
-
Juzhe-Zhong authored
Like all other targets, we add RISC-V into vect_cmdline_needed. This patch fixes following FAILs: FAIL: gcc.dg/tree-ssa/gen-vect-11b.c scan-tree-dump-times vect "vectorized 0 loops" 1 FAIL: gcc.dg/tree-ssa/gen-vect-11c.c scan-tree-dump-times vect "vectorized 0 loops" 1 FAIL: gcc.dg/tree-ssa/gen-vect-26.c scan-tree-dump-times vect "Alignment of access forced using peeling" 1 FAIL: gcc.dg/tree-ssa/gen-vect-28.c scan-tree-dump-times vect "Alignment of access forced using peeling" 1 gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add RISC-V.
-
Alexandre Oliva authored
Various tests fail on powerpc if the toolchain is configured to enable -mstrict-align by default. This patch introduces -mno-strict-align on tests found to fail that way, when the target supports this option. I suppose !non_strict_align could be used to skip tests, instead of or in addition to this tweak, and that might be desirable if they still fail on targets that do no support -mno-strict-align, but I haven't observed such scenarios. The p9-vec-length tests expect vectorization on loop bodies and epilogues that reference arrays that are not known to be more aligned than their small element types. Though VSX vectors work best with 32- or 64-bit alignment, unaligned vector loads and stores are expected by the tests. However, with -mstrict-align by default, vector loads and stores not known to be aligned end up open coded, which doesn't match the asm output expectations coded in the tests. for gcc/ChangeLog * doc/sourcebuild.texi (opt_mstrict_align): New target. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_opt_mstrict_align): New. * gcc.dg/strlenopt-80.c: Add -mno-strict-align if supported. * gcc.target/powerpc/prefix-ds-dq.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-8.c: Likewise.
-
Christoph Müllner authored
stdint.h can be replaced with stdint-gcc.h to resolve some missing system headers in non-multilib installations. Signed-off-by:
Christoph Müllner <christoph.muellner@vrull.eu> gcc/testsuite/ChangeLog: * gcc.target/riscv/xtheadmemidx-helpers.h: Replace stdint.h with stdint-gcc.h.
-
Christoph Müllner authored
The XTheadFMemIdx tests set the required ABI for RV32, but not for RV64, which has the effect that the tests are expected to succeed for RV64/LP64. Let's set the ABI to LP64D in these tests to clarify the requirements. Signed-off-by:
Christoph Müllner <christoph.muellner@vrull.eu> gcc/testsuite/ChangeLog: * gcc.target/riscv/xtheadfmemidx-index-update.c: Add ABI. * gcc.target/riscv/xtheadfmemidx-index-xtheadbb-update.c: Likewise. * gcc.target/riscv/xtheadfmemidx-index-xtheadbb.c: Likewise. * gcc.target/riscv/xtheadfmemidx-index.c: Likewise. * gcc.target/riscv/xtheadfmemidx-uindex-update.c: Likewise. * gcc.target/riscv/xtheadfmemidx-uindex-xtheadbb-update.c: Likewise. * gcc.target/riscv/xtheadfmemidx-uindex-xtheadbb.c: Likewise. * gcc.target/riscv/xtheadfmemidx-uindex.c: Likewise.
-
Eric Botcazou authored
The front-end now rewrites it as a renaming when it is initialized with a function call and the same processing must be applied in the renaming case as in the regular case for this kind of special objects. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Apply the specific rewriting done for an aliased object with an unconstrained array nominal subtype in the renaming case too.
-
Eric Botcazou authored
It comes from an incomplete optimization performed by LTO that is caused by an obsolete transformation done in Gigi, which is redundant with the common uniquization of constant CONSTRUCTORs now performed during gimplification. gcc/ada/ * gcc-interface/trans.cc (gnat_gimplify_expr) <CALL_EXPR>: Delete.
-
Bob Duff authored
This patch fixes a bug: if "for T'Alignment use..." is followed by "for T use (<enum rep>);" the compiler crashes. A workaround is to move the alignment clause after the enumeration rep clause. gcc/ada/ * sem_ch13.ads (Set_Enum_Esize): Do not set alignment. * sem_ch13.adb (Set_Enum_Esize): Do not set alignment. Archaeology seems to show that this line of code dates from when "Alignment = 0" meant "the Alignment is not known at compile time" and "the Alignment is not yet known at compile time" as well as "the Alignment is zero". In any case, it seems to be unnecessary, and in this case harmful, because gigi would crash. Alignment_Clause is set (because there is one), so gigi would query the Alignment, but Alignment was destroyed.
-
Julien Bortolussi authored
Update the logo and the background color in the top right corner of the GNAT User’s Guide for Native Platforms gcc/ada/ * doc/share/conf.py: Changed the background color and the logo.
-
Eric Botcazou authored
The problem occurs when the function call is the operand of an equality operator, the type used to do the comparison is declared outside of the generic construct but visible inside it, and this generic construct also declares two functions with the same profile except for the result type, one result type being the aforementioned type, the other being derived from this type but not visible inside the generic construct. When the second operand is either a literal or also overloaded, the call may be resolved to the second function instead of the first in instances. gcc/ada/ * gen_il-fields.ads (Opt_Field_Enum): Add Compare_Type. * gen_il-gen-gen_nodes.adb (N_Op_Eq): Likewise. (N_Op_Ge): Likewise. (N_Op_Gt): Likewise. (N_Op_Le): Likewise. (N_Op_Lt): Likewise. (N_Op_Ne): Likewise. * sinfo.ads (Compare_Type): Document new field. * sem_ch4.adb (Analyze_Comparison_Equality_Op): If the entity is already present, set the Compare_Type on overloaded operands if it is present on the node. * sem_ch12.adb (Check_Private_View): Look into the Compare_Type instead of the Etype for comparison operators. (Copy_Generic_Node): Remove obsolete code for comparison operators. (Save_Global_References.Save_References): Do not walk into the descendants of N_Implicit_Label_Declaration nodes. (Save_Global_References.Set_Global_Type): Look into the Compare_Type instead of the Etype for comparison operators. * sem_res.adb (Resolve_Comparison_Op): Set Compare_Type. (Resolve_Equality_Op): Likewise.
-
Ronan Desplanques authored
Before this patch, Ada.Directories.Modification_Time called GetFileAttributesExA under the hood on Windows. That would sometimes fail to work with files whose names were non-ASCII. This patch replaces the call to GetFileAttributesExA with a call to GetFileAttributesEx preceded by an encoding scheme conversion, as is done in other functions of the run-time library. This fixes the issues that were observed with the previous implementations. gcc/ada/ * adaint.c (__gnat_file_time): Fix Windows version.
-
Eric Botcazou authored
When the array is initialized with the result of a call to a function whose result type is unconstrained, then the result is allocated with its bounds, so the array can be rewritten as a renaming of the result in this case too. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Fold initialization expression of Nominal_Subtype_Is_Constrained_Array constant into the computation of Rewrite_As_Renaming and remove the constant. Set it to True for an aliased array with unconstrained nominal subtype if the subtype of the expression is also unconstrained.
-
Piotr Trojanek authored
The new handling of aspects stores the aspect expression as the Expression_Copy of the aspect and not as the Entity of the aspect identified. This has been changed for most of the aspects, but not for Type_Invariant and Default_Initial_Condition, which have custom expansion. Apparently this change only affects GNATprove and not GNAT. gcc/ada/ * exp_util.adb (Add_Own_DIC, Add_Own_Invariants): Store the aspect expression in Expression_Copy.
-
Yannick Moy authored
Function Sem_Aux.Is_Limited_View returns whether the type is "inherently limited" in a slightly different way from the "immutably limited" definition in Ada 2012. Rename for clarity. gcc/ada/ * exp_aggr.adb: Apply the renaming. * exp_ch3.adb: Same. * exp_ch4.adb: Same. * exp_ch6.adb: Same. * exp_ch7.adb: Same. * exp_util.adb: Same. * freeze.adb: Same. * sem_aggr.adb: Same. * sem_attr.adb: Same. * sem_aux.adb: Alphabetize Is_Limited_Type. Rename. * sem_aux.ads: Same. * sem_ch3.adb: Apply the renaming. * sem_ch6.adb: Same. * sem_ch8.adb: Same. * sem_prag.adb: Same. * sem_res.adb: Same. * sem_util.adb: Same.
-
Viljar Indus authored
In the previous implementation Aspect Specifications were stored in a separate table and not directly under each node. This implementation included a lot of extra code that needed to be maintained manually. The new implementation stores Aspect_Specfications as a syntactic field under each node. This removes the extra code that was needed to store, traverse and clone aspects for nodes. gcc/ada/ * aspects.adb (Exchange_Aspects): Removed. This method was typically called after a Rewrite method. Now since the Rewrite switches the aspects between the new and the old node it is no longer needed. (Has_Aspects): Converted to a utility method that performs the same before as the previous Has_Aspects field did. Meaning it shows whether a node actually has aspects or not. (Copy_Aspects): New utility method that performs a deep copy of the From nodes aspects. (Aspect_Specfications): Removed. No longer needed. Replaced by the primitive operation for the Aspect_Specification fields. (Set_Aspect_Specifications): Likewise. (Aspect_Specifications_Hash_Table): Remove the table and all the utility methods for storing the old aspects. * aspects.ads: Likewise. * atree.adb (Copy_Separate_Tree): Remove custom code for aspects. (New_Copy): Likewise. (Replace): Likewise. (Rewrite): Likewise. * exp_ch3.adb (Expand_N_Object_Declaration): Keep the aspects from the old node. * exp_ch6.adb (Validate_Subprogram_Calls): Previously aspects were ignored because they were not on the tree. Explicitly ignore them here when traversing the tree. * exp_unst.adb (Build_Tables): Likewise * gen_il-fields.ads: Remove Has_Aspects and add Aspect_Specifications fields. * gen_il-gen-gen_nodes.adb: Add Aspect_Specification fields for all nodes that can have aspects. Additionally add Expression_Copy for Aspect_Speficiations to avoid reusing the Associated_Node for generic instantiation and aspect analysis. * ghost.adb (Remove_Ignored_Ghost_Node): Remove call to Remove_Aspects. The rewritten node is a Null_Statement that cannot have aspects and there is not anything to gain from removing them from the Orignal_Node of N since it technically is not part of the active tree. * inline.adb (Process_Formals_In_Aspects): Simplify code for node traversal. * par-ch13.adb: Avoid setting the parent explicitly for the Aspect_Specifications list. This is done explicitly in the setter. * par-ch6.adb: Likewise. * par_sco.adb (Traverse_Aspects): Handle early return. * sem_ch10.adb: Simplify code for Analyze_Aspect_Specifications. * sem_ch11.adb: Likewise. * sem_ch12.adb (Analyze_Formal_Derived_Interface_Type): Keep the aspects from the orignal node after rewrite. (Analyze_Formal_Derived_Type): Likewise. (Analyze_Formal_Interface_Type): Likewise. (Analyze_Formal_Object_Declaration): Simplify code for Analyze_Aspect_Specifications. (Analyze_Formal_Package_Declaration): Likewise. (Analyze_Formal_Subprogram_Declaration): Likewise. (Analyze_Formal_Type_Declaration): Likewise. (Analyze_Generic_Package_Declaration): Remove Exchange_Aspects. The new node already has the correct aspects after the rewrite. Also simplify code for Analyze_Aspect_Specifications. (Analyze_Generic_Subprogram_Declaration): Likewise. (Analyze_Package_Instantiation): Simplify code for Analyze_Aspect_Specifications. (Build_Instance_Compilation_Unit_Nodes): Remove explicit copy of aspects that is no longer needed. (Save_References): Update the traversal code to handle Aspect_Specifications in the tree. (Copy_Generic_Node): Remove explicit copy for aspects. New_Copy took care of that already. * sem_ch13.adb (Analyze_Aspect_Specifications): Add early return to simplify code for its calls. Avoid reusing the Entity(Associated_Node) field for storing the original expression. Instead use the new Expression_Copy field since Entity(Associated_Node) is also used in generic instantiation. (Analyze_Aspects_On_Subprogram_Body_Or_Stub): Simlify call to Analyze_Aspect_Specifications. (Check_Aspect_At_End_Of_Declarations): Use Expression_Copy instead of Entity. (Check_Aspect_At_Freeze_Point): Likewise. * sem_ch3.adb: Simplify calls to Analyze_Aspect_Specifications. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Simplify call to Analyze_Aspect_Specifications. (Analyze_Expression_Function): Keep the aspects from the original node after a rewrite. (Analyze_Generic_Subprogram_Body): Remove Exchange aspects that is no longer needed. Simplify call to Analyze_Aspect_Specifications. (Analyze_Null_Procedure): Keep the aspects from the original node after a rewrite. (Analyze_Subprogram_Body_Helper): Simplify calls to Analyze_Aspect_Specifications. (Analyze_Subprogram_Declaration): Likewise. * sem_ch7.adb (Analyze_Package_Body_Helper): Remove Exchange aspects that is no longer needed. Simplify call to Analyze_Aspect_Specifications. (Analyze_Package_Declaration): Simplify call to Analyze_Aspect_Specifications. (Analyze_Private_Type_Declaration): Likewise. * sem_ch8.adb: Simplify calls to Analyze_Aspect_Specifications. * sem_ch9.adb (Analyze_Entry_Body): Simplify call to Analyze_Aspects_On_Subprogram_Body_Or_Stub. (Analyze_Entry_Declaration): Simplify call to Analyze_Aspect_Specifications. (Analyze_Protected_Body): Likewise. (Analyze_Protected_Type_Declaration): Likewise. (Analyze_Single_Protected_Declaration): Keep the aspects from the original node after a rewrite. Simplify call to Analyze_Aspect_Specifications. (Analyze_Single_Task_Declaration): Likewise. (Analyze_Task_Body): Simplify call to Analyze_Aspect_Specifications. (Analyze_Task_Type_Declaration): Simplify calls to Analyze_Aspect_Specifications. * sem_dim.adb: Remove explicitly setting the parents for the Aspect_Specification list. * sem_disp.adb: Remove the with that is no longer required since Aspect_Specifications is a node operation now. * sem_util.adb (Copy_Node_With_Replacement): Remove explicit code for aspects. * treepr.adb (Print_Field): Remove the version that was used for printing aspects. (Print_Node): Remove aspect specific code.
-
Eric Botcazou authored
No functional changes. gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Op_Boolean): Fix description. * sem_ch4.adb (Analyze_Comparison_Equality_Op): Tidy up. * sem_ch12.adb (Copy_Generic_Node): Use N_Op_Compare subtype.
-
Piotr Trojanek authored
gcc/ada/ * exp_ch6.adb, exp_disp.adb, sem_ch13.adb, sem_ch3.adb: Fix newly detected violations.
-
Piotr Trojanek authored
We had a GNATcheck rule that suggests replacing "not Present (...)" with "No (...)", but it only detected calls with a parameter of type Node_Id. Now this rules also detects parameters of type Elist_Id. gcc/ada/ * sem_ch3.adb, sem_ch4.adb, sem_eval.adb: Fix newly detected violations.
-
Ronan Desplanques authored
-gnatwc has been correctly emitting warnings for expressions outside of tests for a while, but its documentation in the user's guide had never been updated to reflect that. Also, the documentation used "conditional expressions" to designate boolean expressions, but "conditional expressions" has been defined by Ada 2012 to designate if expressions and case expressions. This patch fixes those issues. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix -gnatwc documentation. * gnat_ugn.texi: Regenerate.
-
Steve Baird authored
A GNAT-defined aspect, Local_Restrictions, is defined. This provides a way of enforcing a given restriction for an individual subprogram (and its call-closure) without requiring that the entire program satisfy the restriction. A GNAT-defined aspect, User_Aspect, is defined. This (along with the new User_Aspect_Definition configuration pragma) provides a way of naming a set of aspect specifications which can then be applied to multiple declarations without textual repetition of the set. gcc/ada/ * local_restrict.ads: A new package. Declares Local_Restriction enumeration type and provides operations to check for local restriction violations. * local_restrict.adb: Corresponding package body. Replace "not Present (X)" calls with "No (X)" calls. * aspects.ads: Add a new enumeration elements, Aspect_Local_Restrictions and Aspect_User_Aspect, to the Aspect_Id enumeration type. Update Aspect_Id-indexed aggregates. Add nested package User_Aspect_Support to manage two pieces of state. One is a map from identifiers to User_Aspect_Definition pragmas (updated when such a pragma is encountered). The other is an access-to-subprogram variable that is introduced in order to keep the bulk of semantics out of the closure of package Aspects while allowing a call from aspects.adb to the sem_ch13 procedure that analyzes a User_Aspect aspect specification. * aspects.adb (Find_Aspect): Cope with a case of a block statement with an empty parent. It is not clear whether this is papering over a compiler bug. Add indirect call through the aforementioned access-to-subprogram variable when Find_Aspect enounters an unanalyzed User_Aspect aspect specification. If Find_Aspect is called looking for aspect Foo, then a User_Aspect specification might generate (during analysis) a Foo aspect specification. So the Find_Aspect call needs to trigger that analysis if it has not already taken place. Provide a body for package User_Aspect_Support. Replace "not Present (X)" call with "No (X)" call. * freeze.adb (Freeze_Subprogram): Check local restriction compatibility when a dispatching operation is overridden. * par-prag.adb: Add support for parsing a User_Aspect_Definition pragma. * restrict.ads: We'd like to have the body of package Restrict include a call to a procedure declared in package Local_Restrict. Doing that in the obvious way pulls most of semantics into the closure of package Restrict, and that turns out to cause problems. So we introduce a level of indirection and instead call through an access-to-subprogram value. In this unit, we declare the access-to-subprogram type and object. * restrict.adb (Check Restriction): When a construct is encountered that could violate a global restriction (depending on whether the given restriction is in effect), Check_Restriction is called. At this point, we also check for a violation of any corresponding local restriction that is in effect. For reasons described above, this check is performed via an indirect call. * sem_ch13.ads (Parse_Aspect_Local_Restrictions): A new function, similar to the existing Parse_Aspect_Xxx subprograms. * sem_ch13.adb: Perform semantic analysis of Local_Restrictions and User_Aspect aspect specifications. Declare and call new Validate_Aspect_Local_Restrictions and Analyze_User_Aspect_Aspect_Specification procedures (a reference to the latter is registered during package elaboration). In Analyze_Aspect_Specifications, do not set the Analyzed flag of a User_Aspect aspect specification. Replace "not Present (X)" call with "No (X)" call. Replace 'Image with 'Img in a case where the prefix of the attribute reference is an object; this is done to accomodate older compilers. * sem_ch6.adb (Check_Subtype_Conformant): Include in subtype conformance check a check for overriding-related compatibility of local restrictions. * sem_ch8.adb (Analyze_Subprogram_Renaming): In the case of an instance of a generic that takes a formal subprogram, check that formal and actual are compatible with respect to local restrictions. * sem_prag.adb: Add support for User_Aspect_Definition pragma. * sem_res.adb (Resolve_Call): Check caller/callee compatibility with respect to local restrictions. * snames.ads-tmpl: Add Name_Local_Restrictions, Name_User_Aspect, and Name_User_Aspect_Definition constants. * doc/gnat_rm/implementation_defined_aspects.rst: Document new aspects. * doc/gnat_rm/implementation_defined_pragmas.rst: Document new pragma. * doc/gnat_ugn/the_gnat_compilation_model.rst: Add User_Aspect_Definition to list of GNAT pragmas. * gcc-interface/Make-lang.in: Add local_restrict.o. * gnat-style.texi: Regenerate. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
-
Bob Duff authored
The compiler gives a wrong error for a call of the form X.Y(...) when Y is inherited indirectly via an interface. gcc/ada/ * sem_ch4.adb (Is_Private_Overriding): Return True in the case where a primitive operation is publicly inherited but privately overridden.
-
Piotr Trojanek authored
Expansion of assignments to packed array objects has two cases and had duplicated code for both these cases. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove code from the ELSE branch, because it was is identical to code before the IF statements itself.
-
Piotr Trojanek authored
When expanding assignment to a packed array object, e.g. a formal parameter with mode OUT that might have unconstrained type, we took the component type and component size from the constrained actual subtype. It is simpler to take these properties from the nominal type of the assigned object. Semantics is unaffected, because constraining the array doesn't change the type or size of the array components. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change Ctyp and Csiz from variables to constants and compute them using the nominal type of the assigned array object.
-
Piotr Trojanek authored
Style cleanup. gcc/ada/ * exp_pakd.adb, libgnarl/s-osinte__android.ads, libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads, libgnat/s-gearop.adb, libgnat/s-poosiz.adb, sem_util.adb: Fix style.
-
Piotr Trojanek authored
Expansion of assignments to packed array objects with string literals on the right-hand side, created an unnecessary conversion, i.e.: ... := component_type (declare temp : component_type := "string_literal"; begin temp) Now the expansion omits the outer type conversion. Cleanup; behavior is unaffected. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Simplify handling of assignments with string literals.
-
Piotr Trojanek authored
If an expression value is not known at compile time, it can be represented with No_Uint and doesn't require a dedicated flag. Code cleanup; behavior is unaffected. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove Rhs_Val_Known; represent unknown value by assigning Rhs_Val with No_Uint.
-
Piotr Trojanek authored
Cleanup; semantics is unaffected. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change local Decl object from variable to constant. (Setup_Inline_Packed_Array_Reference): Likewise for Csiz.
-
Piotr Trojanek authored
Style cleanup. gcc/ada/ * exp_pakd.adb (Setup_Inline_Packed_Array_Reference): Remove extra whitespace from the list of parameters.
-
Piotr Trojanek authored
Avoid potentially unnecessary call to Etype. gcc/ada/ * sem_util.adb (Get_Actual_Subtype_If_Available): Only call Etype when necessary.
-
Piotr Trojanek authored
gcc/ada/ * sem_util.adb (Get_Actual_Subtype,Get_Actual_Subtype_If_Available): Fix handling of expanded names.
-
Viljar Indus authored
gcc/ada/ * sem_prag.adb: (Analyze_Pragma): Reduce the number of nested if statements.
-
Viljar Indus authored
Restore the original state of Style_Check pragmas before analyzing each compilation unit to avoid Style_Check pragmas from unit affecting the style checks of a different unit. gcc/ada/ * sem_ch10.adb: (Analyze_Compilation_Unit): Restore the orignal state of style check pragmas at the end of the analysis.
-
Eric Botcazou authored
This occurs when the component is part of a discriminated type and its offset depends on a discriminant, the problem being that the front-end generates an incomplete Bit_Position attribute reference. gcc/ada/ * exp_pakd.adb (Get_Base_And_Bit_Offset): Use the full component reference instead of just the selector name for 'Bit_Position.
-
Juzhe-Zhong authored
Previously, in this patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635392.html I use vect64 && vect128 to represent both RVV and AMDGCN. However, it caused additional FAIL on ARM SVE. I don't know why ARM SVE vect64 is set as true since their AdvSIMD is 128bit vector and they don't use 64bit vector. So, here we leverage current AMDGCN solution, just add RISCV like AMDGCN. gcc/testsuite/ChangeLog: * gcc.dg/vect/bb-slp-cond-1.c: Add riscv.
-
Jiufu Guo authored
With the latest trunk, case pr106550_1.c runs with failure on ppc under -m32. Previously, this case failed with ICE due to PR111971. Now, this emission is exposed. While, the case is testing 64bit constant building. So, "has_arch_ppc64" is required. PR target/112340 gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr106550_1.c: Add has_arch_ppc64 target require.
-
Lehua Ding authored
This patch fixed the fellowing failed testcases on the trunk: FAIL: gcc.target/riscv/rvv/autovec/cond/cond_widen_reduc-2.c scan-assembler-times \\tvfwredusum\\.vs\\tv[0-9]+,v[0-9]+,v[0-9]+,v0\\.t 2 ... FAIL: gcc.target/riscv/rvv/autovec/cond/cond_widen_reduc-2.c scan-assembler-times \\tvwredsumu\\.vs\\tv[0-9]+,v[0-9]+,v[0-9]+,v0\\.t 3 ... The reason for these failed testcases is the introduce of .VCOND_MASK_LEN in midend for other bugfix and further leads to a new vcond_mask_len rtl pattern after expand. So we need add new combine patterns handle this case. Consider this code: int16_t foo (int8_t *restrict a, int8_t *restrict pred) { int16_t sum = 0; for (int i = 0; i < 16; i += 1) if (pred[i]) sum += a[i]; return sum; } Before this patch: foo: vsetivli zero,16,e8,m1,ta,ma vle8.v v0,0(a1) vsetvli a5,zero,e8,m1,ta,ma vmsne.vi v0,v0,0 vsetvli zero,zero,e16,m2,ta,ma li a3,0 vmv.v.i v2,0 vsetivli zero,16,e16,m2,ta,ma vle8.v v6,0(a0),v0.t vmv.s.x v1,a3 vsetvli a5,zero,e16,m2,ta,ma vsext.vf2 v4,v6 vsetivli zero,16,e16,m2,tu,ma vmerge.vvm v2,v2,v4,v0 vsetvli a5,zero,e16,m2,ta,ma vredsum.vs v2,v2,v1 vmv.x.s a0,v2 slliw a0,a0,16 sraiw a0,a0,16 ret After this patch: foo: vsetivli zero,16,e16,m2,ta,ma li a5,0 vle8.v v0,0(a1) vmv.s.x v1,a5 vsetvli zero,zero,e8,m1,ta,ma vmsne.vi v0,v0,0 vle8.v v2,0(a0),v0.t vwredsum.vs v1,v2,v1,v0.t vsetvli zero,zero,e16,m1,ta,ma vmv.x.s a0,v1 slliw a0,a0,16 sraiw a0,a0,16 ret Combine the vsext.vf2, vmerge.vvm, and vredsum.vs instructions while reducing the corresponding vsetvl instructions. gcc/ChangeLog: * config/riscv/autovec-opt.md (*cond_len_<optab><v_double_trunc><mode>): New combine pattern. (*cond_len_<optab><v_quad_trunc><mode>): Ditto. (*cond_len_<optab><v_oct_trunc><mode>): Ditto. (*cond_len_extend<v_double_trunc><mode>): Ditto. (*cond_len_widen_reduc_plus_scal_<mode>): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/cond/cond_widen_reduc-1.c: * gcc.target/riscv/rvv/autovec/cond/cond_widen_reduc-2.c:
-
Juzhe-Zhong authored
RVV didn't explictly enable DIV_POW2 optab but we cen vectorize it. We should check pattern recognition instead of explicit pattern check. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-sdiv-pow2-1.c: Fix dump check.
-
Juzhe-Zhong authored
RVV didn't explicitly enable SAD optab but we can vectorize it since loop vectorizer is able to recognize SAD pattern for RVV during analysis. Current scan check of explicit SAD pattern looks odd, it should be more reasonable to check recognition of SAD pattern during Loop vectorize analysis. Other SAD tests like slp-reduc-sad-2.c are checking pattern recognition instead of explicit pattern enable. Fix SAD dump check to fix the FAILS for RVV. gcc/testsuite/ChangeLog: * gcc.dg/vect/slp-reduc-sad.c: Fix check. * gcc.dg/vect/vect-reduc-sad.c: Ditto.
-