- Jul 18, 2023
-
-
Tom Tromey authored
This changes gcc-interface to use the typedefs that were recently introduced in gnat. This is another step toward switching the code generator to emit enums rather than preprocessor defines. In a couple of spots, a 'default' case is also added. These avoid warnings from -Wswitch when the typedefs are changed to be enums. gcc/ada/ * gcc-interface/decl.cc (check_ok_for_atomic_type): Use Pragma_Id. * gcc-interface/trans.cc (lvalue_required_p, Pragma_to_gnu): Use Pragma_Id. (get_type_length, Attribute_to_gnu, get_atomic_access): Use Attribute_Id.
-
Javier Miranda authored
When the prefix of 'Image is used with a class-wide interface type object, the frontend does not generate code to displace the pointer to the underlying object to reference its base, and this is required to invoke Ada.Tags.Wide_Wide_Expanded_Name. gcc/ada/ * exp_imgv.adb (Rewrite_Object_Image): fix type of formal. Found reading sources. (Expand_Wide_Image_Attribute): ditto. (Expand_Wide_Wide_Image_Attribute): ditto. (Rewrite_Object_Image): ditto. * exp_put_image.adb (Build_Image_Call): For class-wide interface type prefix generate code to displace the pointer to the object to reference the base of the underlying object.
-
Viljar Indus authored
Create temporary scope for the iterators defined in a container aggregate so that it would not be put to the same scope where the expression was used. This would otherwise lead to multiple aggregates with iterators that have the same name leading to a name conflict. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Association): Add temporary scope when analyzing the Iterator Specification. Use preanalysis instead of Analysis to avoid polluting the tree.
-
Viljar Indus authored
When dealing with a container aggregate with an iterator specification the iterator should take the value of the element of the container instead of the key. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Association): Use the element type for the iterator in a container aggregate with an iterator specification.
-
Viljar Indus authored
The compiler should use unnamed addition methods such as Append when expanding a container aggregate with Iterator Specification. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Use the positional addition method only when dealing with a container aggregate without an Iterator Specification e.g. with a loop parameter specification
-
Eric Botcazou authored
This restores the full listing of the types for the interpretations. gcc/ada/ * sem_util.ads (Wrong_Type): Add Multiple parameter defaulting to False and document it. * sem_util.adb (Wrong_Type): Do not return early if an error has already been posted on Expr and Multiple is True. * sem_ch4.adb (Analyze_One_Call): Pass All_Errors_Mode as the actual parameter for Multiple to Wrong_Type.
-
Javier Miranda authored
When the sources have a type conversion from an interface type T2 to some ancestor interface type T1 (that is, T2 extends T1) the tag check added by the compiler may fail at runtime. gcc/ada/ * exp_disp.adb (Has_Dispatching_Constructor_Call): Removed. (Expand_Interface_Conversion): Reverse patch.
-
Ronan Desplanques authored
Before this patch, the run-time assumed that not specifying a CPU affinity mask when creating a thread was equivalent to specifying a CPU affinity mask that included all CPUs. As documented in the man pages for pthread_create and pthread_setaffinity_np, this assumption is incorrect: a thread created using pthread_create inherits the CPU affinity mask of the creating thread by default. There was a comment in Set_Task_Affinity that acknowledged this behavior, but the actual code made the erroneous assumption mentioned above. That assumption caused the run-time to behave incorrectly when tasks were explicity assigned to Not_A_Specific_CPU: those tasks were assigned to the same CPUs as their parents instead of being allowed to run on any CPU. This patch fixes that behavior. This patch has the negative effect of making the runtime issue sched_setaffinity syscalls that are not necessary. gcc/ada/ * libgnarl/s-taprop__linux.adb (Set_Task_Affinity, Create_Task): Tweak handling of CPU affinities.
-
Eric Botcazou authored
The front-end contains a specific mechanism to deal with aggregates of self-referencing types by means of the Has_Self_Reference flag, which is supposed to be set during semantic analysis and used during expansion. The problem is that the first part overlooks aggregates of derived types which implicitly contain references to an ancestor type (the second part uses a broader condition but it is effectively guarded by the first one). This changes both parts to use the same condition based on the Is_Ancestor predicate, which seems to implement the expected semantic in this case. gcc/ada/ * sem_type.ads (Is_Ancestor): Remove mention of tagged type. * exp_aggr.adb: Add with and use clauses for Sem_Type. (Build_Record_Aggr_Code.Replace_Type): Call Is_Ancestor to spot self-references to the type of the aggregate. * sem_aggr.adb (Resolve_Record_Aggregate.Add_Discriminant_Values): Likewise.
-
Eric Botcazou authored
The new processing is not properly guarded. gcc/ada/ * sem_ch13.adb (Replace_Type_References_Generic.Visible_Component): In the case of private discriminated types, explicitly check that we have a private declaration before examining its discriminant part.
-
Alexandre Oliva authored
Mark exception-raising subprograms with expected_throw attribute. Document the use of the attribute in Control Flow Redundancy. Enable marking subprograms as expected_throw with Machine_Attribute pragmas. gcc/ada/ * libgnat/a-except.ads (Raise_Exception): Mark expected_throw. (Reraise_Occurrence): Likewise. (Raise_Exception_Always): Likewise. (Raise_From_Controlled_Operation): Likewise. (Reraise_Occurrence_Always): Likewise. (Reraise_Occurrence_No_Defer): Likewise. * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception): Likewise. (Complete_And_Propagate_Occurrence): Likewise. (Raise_Exception_No_Defer): Likewise. (Raise_From_Signal_Handler): Likewise. (Raise_With_Msg): Likewise. (Raise_With_Location_And_Msg): Likewise. (Raise_Constraint_Error): Likewise. (Raise_Constraint_Error_Msg): Likewise. (Raise_Program_Error): Likewise. (Raise_Program_Error_Msg): Likewise. (Raise_Storage_Error): Likewise. (Raise_Storage_Error_Msg): Likewise. (Reraise, Rcheck_*): Likewise. * doc/gnat_rm/security_hardening_features.rst (Control Flow Hardening): Note the influence of expected_throw. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. * gcc-interface/utils.cc (handle_expected_throw_attribute): New. (gnat_internal_attribute_table): Add expected_throw.
-
Vasiliy Fofanov authored
The aim of this refactoring is to replace multiple returns from branches of case and if statements by a single return statement with a conditional expression. This is more readable and maintainable, and also conformant with a Highly Recommended design principle of ISO 26262-6. gcc/ada/ * libgnat/s-pack03.adb: Update copyright year; refactor return statements. * libgnat/s-pack05.adb: Likewise. * libgnat/s-pack06.adb: Likewise. * libgnat/s-pack07.adb: Likewise. * libgnat/s-pack09.adb: Likewise. * libgnat/s-pack10.adb: Likewise. * libgnat/s-pack100.adb: Likewise. * libgnat/s-pack101.adb: Likewise. * libgnat/s-pack102.adb: Likewise. * libgnat/s-pack103.adb: Likewise. * libgnat/s-pack104.adb: Likewise. * libgnat/s-pack105.adb: Likewise. * libgnat/s-pack106.adb: Likewise. * libgnat/s-pack107.adb: Likewise. * libgnat/s-pack108.adb: Likewise. * libgnat/s-pack109.adb: Likewise. * libgnat/s-pack11.adb: Likewise. * libgnat/s-pack110.adb: Likewise. * libgnat/s-pack111.adb: Likewise. * libgnat/s-pack112.adb: Likewise. * libgnat/s-pack113.adb: Likewise. * libgnat/s-pack114.adb: Likewise. * libgnat/s-pack115.adb: Likewise. * libgnat/s-pack116.adb: Likewise. * libgnat/s-pack117.adb: Likewise. * libgnat/s-pack118.adb: Likewise. * libgnat/s-pack119.adb: Likewise. * libgnat/s-pack12.adb: Likewise. * libgnat/s-pack120.adb: Likewise. * libgnat/s-pack121.adb: Likewise. * libgnat/s-pack122.adb: Likewise. * libgnat/s-pack123.adb: Likewise. * libgnat/s-pack124.adb: Likewise. * libgnat/s-pack125.adb: Likewise. * libgnat/s-pack126.adb: Likewise. * libgnat/s-pack127.adb: Likewise. * libgnat/s-pack13.adb: Likewise. * libgnat/s-pack14.adb: Likewise. * libgnat/s-pack15.adb: Likewise. * libgnat/s-pack17.adb: Likewise. * libgnat/s-pack18.adb: Likewise. * libgnat/s-pack19.adb: Likewise. * libgnat/s-pack20.adb: Likewise. * libgnat/s-pack21.adb: Likewise. * libgnat/s-pack22.adb: Likewise. * libgnat/s-pack23.adb: Likewise. * libgnat/s-pack24.adb: Likewise. * libgnat/s-pack25.adb: Likewise. * libgnat/s-pack26.adb: Likewise. * libgnat/s-pack27.adb: Likewise. * libgnat/s-pack28.adb: Likewise. * libgnat/s-pack29.adb: Likewise. * libgnat/s-pack30.adb: Likewise. * libgnat/s-pack31.adb: Likewise. * libgnat/s-pack33.adb: Likewise. * libgnat/s-pack34.adb: Likewise. * libgnat/s-pack35.adb: Likewise. * libgnat/s-pack36.adb: Likewise. * libgnat/s-pack37.adb: Likewise. * libgnat/s-pack38.adb: Likewise. * libgnat/s-pack39.adb: Likewise. * libgnat/s-pack40.adb: Likewise. * libgnat/s-pack41.adb: Likewise. * libgnat/s-pack42.adb: Likewise. * libgnat/s-pack43.adb: Likewise. * libgnat/s-pack44.adb: Likewise. * libgnat/s-pack45.adb: Likewise. * libgnat/s-pack46.adb: Likewise. * libgnat/s-pack47.adb: Likewise. * libgnat/s-pack48.adb: Likewise. * libgnat/s-pack49.adb: Likewise. * libgnat/s-pack50.adb: Likewise. * libgnat/s-pack51.adb: Likewise. * libgnat/s-pack52.adb: Likewise. * libgnat/s-pack53.adb: Likewise. * libgnat/s-pack54.adb: Likewise. * libgnat/s-pack55.adb: Likewise. * libgnat/s-pack56.adb: Likewise. * libgnat/s-pack57.adb: Likewise. * libgnat/s-pack58.adb: Likewise. * libgnat/s-pack59.adb: Likewise. * libgnat/s-pack60.adb: Likewise. * libgnat/s-pack61.adb: Likewise. * libgnat/s-pack62.adb: Likewise. * libgnat/s-pack63.adb: Likewise. * libgnat/s-pack65.adb: Likewise. * libgnat/s-pack66.adb: Likewise. * libgnat/s-pack67.adb: Likewise. * libgnat/s-pack68.adb: Likewise. * libgnat/s-pack69.adb: Likewise. * libgnat/s-pack70.adb: Likewise. * libgnat/s-pack71.adb: Likewise. * libgnat/s-pack72.adb: Likewise. * libgnat/s-pack73.adb: Likewise. * libgnat/s-pack74.adb: Likewise. * libgnat/s-pack75.adb: Likewise. * libgnat/s-pack76.adb: Likewise. * libgnat/s-pack77.adb: Likewise. * libgnat/s-pack78.adb: Likewise. * libgnat/s-pack79.adb: Likewise. * libgnat/s-pack80.adb: Likewise. * libgnat/s-pack81.adb: Likewise. * libgnat/s-pack82.adb: Likewise. * libgnat/s-pack83.adb: Likewise. * libgnat/s-pack84.adb: Likewise. * libgnat/s-pack85.adb: Likewise. * libgnat/s-pack86.adb: Likewise. * libgnat/s-pack87.adb: Likewise. * libgnat/s-pack88.adb: Likewise. * libgnat/s-pack89.adb: Likewise. * libgnat/s-pack90.adb: Likewise. * libgnat/s-pack91.adb: Likewise. * libgnat/s-pack92.adb: Likewise. * libgnat/s-pack93.adb: Likewise. * libgnat/s-pack94.adb: Likewise. * libgnat/s-pack95.adb: Likewise. * libgnat/s-pack96.adb: Likewise. * libgnat/s-pack97.adb: Likewise. * libgnat/s-pack98.adb: Likewise. * libgnat/s-pack99.adb: Likewise.
-
Yannick Moy authored
Change the way explain codes are handled to generate the command for the user to get the explanations, as this was not working for warnings. gcc/ada/ * errout.adb (Error_Msg_Internal): Remove call to Prescan_Message on the special continuation for the explain code command, as this does not play well with the setting of global variables for the message (like its status as a warning or not). Instead, set directly the global variables regarding content of the message in terms of special characters.
-
Eric Botcazou authored
The attribute is wrongly computed as always True because, unlike for e.g. private types, Validated_View does not look through the limited view. gcc/ada/ * sem_util.ads (Validated_View): Document enhanced behavior. * sem_util.adb (Validated_View): Return the nonlimited view, if any, of types coming from a limited with.
-
Juzhe-Zhong authored
This patch is to dynamic adjust size of VLA vectors according to TARGET_MIN_VLEN (-march=*zvl*b). Currently, VNx16QImode is always [16,16] when TARGET_MINV_LEN >= 128. We are going to add a bunch of VLS modes (V16QI,V32QI,....etc), these modes should always be considered as having smaller size than VLA vectors. For example, the V32QImode is LMUL = 1 VLS mode when TARGET_MIN_VLEN = 256 and V16QImode is LMUL = 1 VLS mode when TARGET_MINV_LEN = 128. Since a LMUL = 1 VLA mode VNx16QI is always [16,16] before this patch, when TARGET_MIN_VLEN = 128, VNx16QImode ([16,16]) > V16QImode. when TARGET_MIN_VLEN = 256, VNx16QImode ([16,16]) possible < V32QImode. Then such inconsistency (TARGET_MIN_VLEN = 128, regno_reg_rtx[97] is VLA modes wheras it is VLS modes when TARGET_MIN_VLEN = 256). This patch now adjust VLA vector size accurately according to TARGET_MIN_VLEN which make things more reasonable: VNx16QI = [16,16] if TARGET_MIN_VLEN = 128. VNx16QI = [32,32] if TARGET_MIN_VLEN = 256. VNx16QI = [64,64] if TARGET_MIN_VLEN = 512. VNx16QI = [128,128] if TARGET_MIN_VLEN = 1024. VNx16QI = [256,256] if TARGET_MIN_VLEN = 2048. VNx16QI = [512,512] if TARGET_MIN_VLEN = 4096. gcc/ChangeLog: * config/riscv/riscv-selftests.cc (run_poly_int_selftests): Add more selftests. * config/riscv/riscv.cc (riscv_legitimize_poly_move): Dynamic adjust size of VLA vectors. (riscv_convert_vector_bits): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/zve32f_zvl1024b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32f_zvl2048b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32f_zvl256b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32f_zvl4096b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32f_zvl512b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32x_zvl1024b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32x_zvl2048b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32x_zvl256b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32x_zvl4096b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve32x_zvl512b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64d_zvl1024b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64d_zvl2048b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64d_zvl256b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64d_zvl4096b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64d_zvl512b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64f_zvl1024b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64f_zvl2048b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64f_zvl256b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64f_zvl4096b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64f_zvl512b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64x_zvl1024b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64x_zvl2048b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64x_zvl256b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64x_zvl4096b-1.c: New test. * gcc.target/riscv/rvv/autovec/zve64x_zvl512b-1.c: New test.
-
Ju-Zhe Zhong authored
ChangeLog: * MAINTAINERS: Add myself as a reviewer for the riscv port.
-
Juzhe-Zhong authored
This patch is to enable SLP un-order reduction autao-vectorization Consider this following case: int __attribute__((noipa)) add_loop (int *x, int n, int res) { for (int i = 0; i < n; ++i) { res += x[i * 2]; res += x[i * 2 + 1]; } return res; } --param riscv-autovec-preference=scalable -fopt-info-vec-missed: <source>:4:21: missed: couldn't vectorize loop <source>:4:21: missed: unsupported SLP instances After this patch: add_loop: ble a1,zero,.L5 csrr a6,vlenb srli a4,a6,2 slli a1,a1,1 neg a7,a4 vsetvli t1,zero,e32,m1,ta,ma vmv.v.i v2,0 vslide1up.vx v1,v2,a2 -----------> generated by VEC_SHL_INSERT .L4: mv a3,a1 mv a5,a1 bleu a1,a4,.L3 mv a5,a4 .L3: vsetvli zero,a5,e32,m1,tu,ma add a1,a1,a7 vle32.v v2,0(a0) add a0,a0,a6 vadd.vv v1,v1,v2 bgtu a3,a4,.L4 vsetivli zero,1,e32,m1,ta,ma vmv.v.i v2,0 vsetvli t1,zero,e32,m1,ta,ma vredsum.vs v1,v1,v2 vmv.x.s a0,v1 ret .L5: mv a0,a2 ret gcc/ChangeLog: * config/riscv/autovec.md (vec_shl_insert_<mode>): New patterns. * config/riscv/riscv-v.cc (shuffle_compress_patterns): Fix bugs. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/reduc/reduc-5.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc-6.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc-7.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc-8.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc-9.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc_run-5.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc_run-6.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc_run-7.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc_run-8.c: New test. * gcc.target/riscv/rvv/autovec/reduc/reduc_run-9.c: New test.
-
Robin Dapp authored
ChangeLog: * MAINTAINERS: Add myself as a reviewer for the riscv port.
-
Lehua Ding authored
Since the latter patch (https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624689.html) forbidden VLEN > 4096, the testcase attribute-20.c is no long need. This is obvious. gcc/testsuite/ChangeLog: * gcc.target/riscv/attribute-20.c: Removed.
-
Juergen Christ authored
A vec_cmpge produces a negation. Replace this negation by swapping the two selection choices of a vec_sel based on the result of the vec_cmpge. gcc/ChangeLog: * config/s390/vx-builtins.md: New vsel pattern. gcc/testsuite/ChangeLog: * gcc.target/s390/vector/vec-cmpge.c: New test. Signed-off-by:
Juergen Christ <jchrist@linux.ibm.com>
-
Joern Rennecke authored
The original "mv" regexp would match .ascii "\254\254\375\002e2N6\013\231,\354NDmvVP0]\304\312F!biZ\025\211" in the .gnu.lto_foo1.0.32528183c9deec41 section. gcc/testsuite/ * gcc.target/riscv/_Float16-zhinx-1.c: Tighten regexps.
-
liuhongt authored
optimize_insn_for_speed () in assemble output is not aligned with splitter condition, and it cause an ICE when building SPEC2017 blender_r. libpng/pngread.c: In function ‘png_read_image’: libpng/pngread.c:786:1: internal compiler error: in final_scan_insn_1, at final.cc:2813 786 | } | ^ 0x73ac3d final_scan_insn_1 ../../gcc/final.cc:2813 0xb3420b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../gcc/final.cc:2887 0xb344c4 final_1 ../../gcc/final.cc:1979 0xb34f64 rest_of_handle_final ../../gcc/final.cc:4240 0xb34f64 execute ../../gcc/final.cc:4318 gcc/ChangeLog: PR target/110438 * config/i386/sse.md (<mask_codefor>one_cmpl<mode>2<mask_name>): Remove # from assemble output.
-
liuhongt authored
Similar like we did for cmpxchg, but extended to all ix86_comparison_int_operator since cmpccxadd set EFLAGS exactly same as CMP. When operand order in compare insn is same as that in cmpccxadd, compare insn can be eliminated directly. When operand order is swapped in compare insn, only optimize cmpccxadd + cmpl + jcc/setcc to cmpccxadd + jcc/setcc when FLAGS_REG is dead after jcc/setcc. gcc/ChangeLog: PR target/110591 * config/i386/sync.md (cmpccxadd_<mode>): Adjust the pattern to explicitly set FLAGS_REG like *cmp<mode>_1, also add extra 3 define_peephole2 after the pattern. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110591.c: New test. * gcc.target/i386/pr110591-2.c: New test.
-
Ju-Zhe Zhong authored
Hi, Richard. RISC-V port needs to add a bunch VLS modes (V16QI,V32QI,V64QI,...etc) There are sharing same REG_CLASS with VLA modes (VNx16QI,VNx32QI,...etc) When I am adding those VLS modes, the RTL_SSA initialization in VSETVL PASS (inserted after RA) ICE: rvv.c:13:1: internal compiler error: in partial_subreg_p, at rtl.h:3186 13 | } | ^ 0xf7a5b1 partial_subreg_p(machine_mode, machine_mode) ../../../riscv-gcc/gcc/rtl.h:3186 0x1407616 wider_subreg_mode(machine_mode, machine_mode) ../../../riscv-gcc/gcc/rtl.h:3252 0x2a2c6ff rtl_ssa::combine_modes(machine_mode, machine_mode) ../../../riscv-gcc/gcc/rtl-ssa/internals.inl:677 0x2a2b9a4 rtl_ssa::function_info::simplify_phi_setup(rtl_ssa::phi_info*, rtl_ssa::set_info**, bitmap_head*) ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:146 0x2a2c142 rtl_ssa::function_info::simplify_phis() ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:258 0x2a2b3f0 rtl_ssa::function_info::function_info(function*) ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:51 0x1cebab9 pass_vsetvl::init() ../../../riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4578 0x1cec150 pass_vsetvl::execute(function*) ../../../riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4716 The reason is that we have V32QImode (size = [32,0]) which is the mode set as regno_reg_rtx[97] When the PHI input def comes from ENTRY BLOCK (index =0), the def->mode () = V32QImode. But the phi_mode = VNx2QI for example (I use VLA modes intrinsic write the codes). Then combine_modes report ICE. gcc/ChangeLog: * rtl-ssa/internals.inl: Fix when mode1 and mode2 are not ordred.
-
Pan Li authored
Refine the run test case to avoid interactive checking in RV32, by separating each checks in different functions. Signed-off-by:
Pan Li <pan2.li@intel.com> gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/float-point-frm-run-1.c: Fix run failure.
-
Pan Li authored
This patch would like to support the basic floating-point dynamic rounding modes for the RVV. We implement the dynamic rounding mode by below steps. 1. Set entry to DYN and exit to DYN_EXIT. 2. Add one rtl variable into machine_function for backup/restore. 3. Backup frm value when entry. 4. Restore frm value when exit and prev mode is not DYN. 5. Restore frm when mode switching to DYN. 6. Set frm when mode switching to STATIC. Take one flow to describe the scenarios. +-------------+ | Entry (DYN) | <- frrm a5 +-------------+ / \ +-------+ +-----------+ | VFADD | <- fsrm a5 | VFADD RTZ | <- fsrmi 1(RTZ) +-------+ +-----------+ | | +-------+ +-----------+ | VFADD | | VFADD RTZ | +-------+ +-----------+ | | +-----------+ +-------+ | VFADD RUP | <- fsrmi 3(RUP) | VFADD | <- fsrm a5 +-----------+ +-------+ | / +-----------+ / | VFADD RUP | / +-----------+ / \ / +-----------------+ | Exit (DYN_EXIT) | <- fsrm a5 +-----------------+ Please *NOTE* inline asm and call during the cfun will be implemented in another PATCH(s). Signed-off-by:
Pan Li <pan2.li@intel.com> Co-Authored-By:
Juzhe-Zhong <juzhe.zhong@rivai.ai> gcc/ChangeLog: * config/riscv/riscv.cc (struct machine_function): Add new field. (riscv_static_frm_mode_p): New function. (riscv_emit_frm_mode_set): New function for emit FRM. (riscv_emit_mode_set): Extract function for FRM. (riscv_mode_needed): Fix the TODO. (riscv_mode_entry): Initial dynamic frm RTL. (riscv_mode_exit): Return DYN_EXIT. * config/riscv/riscv.md: Add rdfrm. * config/riscv/vector-iterators.md (unspecv): Add DYN_EXIT unspecv. * config/riscv/vector.md (frm_modee): Add new mode dyn_exit. (fsrm): Removed. (fsrmsi_backup): New pattern for swap. (fsrmsi_restore): New pattern for restore. (fsrmsi_restore_exit): New pattern for restore exit. (frrmsi): New pattern for backup. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/float-point-frm-insert-1.c: Adjust test cases. * gcc.target/riscv/rvv/base/float-point-frm-insert-10.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-2.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-3.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-4.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-5.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-6.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-7.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-8.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-insert-9.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-run-1.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-run-2.c: Ditto. * gcc.target/riscv/rvv/base/float-point-frm-run-3.c: Ditto. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-1.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-10.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-11.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-12.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-13.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-14.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-15.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-16.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-17.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-18.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-19.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-2.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-20.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-21.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-22.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-23.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-24.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-25.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-26.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-27.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-28.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-29.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-3.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-30.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-31.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-32.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-4.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-5.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-6.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-7.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-8.c: New test. * gcc.target/riscv/rvv/base/float-point-dynamic-frm-9.c: New test.
-
GCC Administrator authored
-
- Jul 17, 2023
-
-
Arsen Arsenović authored
gcc/ChangeLog: * doc/extend.texi: Add @cindex on __auto_type.
-
Jason Merrill authored
In reviewing Nathaniel's patch for PR70331, it occurred to me that instead of looking for various specific problematic things in the result of a constexpr call to decide whether to cache it, we should use reduced_constant_expression_p. The change to that function is to avoid crashing on uninitialized objects of non-class type. In a trial version of this patch I checked to see what cases this stopped caching; most were instances of partially-initialized return values, which seem fine to not cache. Some were returning pointers to expiring local variables, which we definitely want not to cache. And one was bit-cast3.C, which will be handled in a follow-up patch. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_call_expression): Only cache reduced_constant_expression_p results. (reduced_constant_expression_p): Handle CONSTRUCTOR of scalar type. (cxx_eval_constant_expression): Fold vectors here. (cxx_eval_bare_aggregate): Not here.
-
Uros Bizjak authored
gcc/ChangeLog: * combine-stack-adj.cc (stack_memref_p): Change return type from int to bool and adjust function body accordingly. (rest_of_handle_stack_adjustments): Change return type to void.
-
Uros Bizjak authored
Also change some internal variables and function arguments from int to bool. gcc/ChangeLog: * combine.cc (struct reg_stat_type): Change last_set_invalid to bool. (cant_combine_insn_p): Change return type from int to bool and adjust function body accordingly. (can_combine_p): Ditto. (combinable_i3pat): Ditto. Change "i1_not_in_src" and "i0_not_in_src" function arguments from int to bool. (contains_muldiv): Change return type from int to bool and adjust function body accordingly. (try_combine): Ditto. Change "new_direct_jump" pointer function argument from int to bool. Change "substed_i2", "substed_i1", "substed_i0", "added_sets_0", "added_sets_1", "added_sets_2", "i2dest_in_i2src", "i1dest_in_i1src", "i2dest_in_i1src", "i0dest_in_i0src", "i1dest_in_i0src", "i2dest_in_i0src", "i2dest_killed", "i1dest_killed", "i0dest_killed", "i1_feeds_i2_n", "i0_feeds_i2_n", "i0_feeds_i1_n", "i3_subst_into_i2", "have_mult", "swap_i2i3", "split_i2i3" and "changed_i3_dest" variables from int to bool. (subst): Change "in_dest", "in_cond" and "unique_copy" function arguments from int to bool. (combine_simplify_rtx): Change "in_dest" and "in_cond" function arguments from int to bool. (make_extraction): Change "unsignedp", "in_dest" and "in_compare" function argument from int to bool. (force_int_to_mode): Change "just_select" function argument from int to bool. Change "next_select" variable to bool. (rtx_equal_for_field_assignment_p): Change return type from int to bool and adjust function body accordingly. (merge_outer_ops): Ditto. Change "pcomp_p" pointer function argument from int to bool. (get_last_value_validate): Change return type from int to bool and adjust function body accordingly. (reg_dead_at_p): Ditto. (reg_bitfield_target_p): Ditto. (combine_instructions): Ditto. Change "new_direct_jump" variable to bool. (can_combine_p): Change return type from int to bool and adjust function body accordingly. (likely_spilled_retval_p): Ditto. (can_change_dest_mode): Change "added_sets" function argument from int to bool. (find_split_point): Change "unsignedp" variable to bool. (simplify_if_then_else): Change "comparison_p" and "swapped" variables to bool. (simplify_set): Change "other_changed" variable to bool. (expand_compound_operation): Change "unsignedp" variable to bool. (force_to_mode): Change "just_select" function argument from int to bool. Change "next_select" variable to bool. (extended_count): Change "unsignedp" function argument to bool. (simplify_shift_const_1): Change "complement_p" variable to bool. (simplify_comparison): Change "changed" variable to bool. (rest_of_handle_combine): Change return type to void.
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/95947 PR fortran/110658 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures whose result characteristics depends on the first argument and which can be of type character, the character length will not be deferred. gcc/testsuite/ChangeLog: PR fortran/95947 PR fortran/110658 * gfortran.dg/deferred_character_37.f90: New test.
-
Andre Vieira authored
This patch fixes PR110610 by including insn-opinit.h in the INTERNAL_FN_H list, as insn-opinit.h is now required by internal-fn.h. This will lead to insn-opinit.h being installed in the plugin directory. gcc/ChangeLog: PR plugins/110610 * Makefile.in (INTERNAL_FN_H): Add insn-opinit.h.
-
Senthil Kumar Selvaraj authored
ira.cc:setup_reg_class_relations sets up ira_reg_class_subset (among other things). If reg class cl3 has no registers, then that empty set is always hard_reg_set_subset_p of any other set, and this makes ira_reg_class_subset[ALL_REGS][NO_REGS] equal to such a regclass, rather than NO_REGS. This breaks code (lra-constraints.cc:in_class_p/curr_insn_transform, for e.g.) which uses NO_REGS to check for an empty regclass. Why define an empty regclass? A regclass could be conditionally empty (via TARGET_CONDITIONAL_REGISTER_USAGE) - for the avr target, ADDW_REGS and NO_LD_REGS are empty for the avrtiny subarch, for example. Fix by continuing the innermost loop if the corresponding reg class is empty. gcc/ChangeLog: * ira.cc (setup_reg_class_relations): Continue if regclass cl3 is hard_reg_set_empty_p.
-
Juzhe-Zhong authored
gcc/ChangeLog: * config/riscv/riscv.cc (riscv_option_override): Add sorry check. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/zvl-unimplemented-1.c: New test. * gcc.target/riscv/rvv/base/zvl-unimplemented-2.c: New test.
-
Tobias Burnus authored
The 'uses_allocators' clause to the 'target' construct accepts predefined allocators and can also be used to define a new allocator for a target region. As predefined allocators in GCC do not require special handling, those can and are ignored after parsing, such that this feature now works. On the other hand, defining a new allocator will fail for now with a 'sorry, unimplemented'. Note that both the OpenMP 5.0/5.1 and 5.2 syntax for uses_allocators is supported by this commit. 2023-07-17 Tobias Burnus <tobias@codesoucery.com> Chung-Lin Tang <cltang@codesourcery.com> gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump uses_allocators clause. * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union and traits_sym to u2 union. (OMP_LIST_USES_ALLOCATORS): New enum value. (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg. * match.cc (gfc_free_omp_namelist): Likewise. * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list, gfc_match_omp_to_link, gfc_match_omp_doacross_sink, gfc_match_omp_clause_reduction, gfc_match_omp_allocate, gfc_match_omp_flush): Update call. (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause. (gfc_match_omp_clause_uses_allocators): New. (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS. (OMP_TARGET_CLAUSES): Accept it. (resolve_omp_clauses): Resolve uses_allocators clause * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call. * trans-openmp.cc (gfc_trans_omp_clauses): Handle OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator. (gfc_split_omp_clauses): Handle uses_allocators. libgomp/ChangeLog: * testsuite/libgomp.fortran/uses_allocators_1.f90: New test. * testsuite/libgomp.fortran/uses_allocators_2.f90: New test. Co-authored-by:
Chung-Lin Tang <cltang@codesourcery.com>
-
Martin Jambor authored
This restores bootstrap by removing the variable causing: /home/mjambor/gcc/trunk/src/gcc/tree-ssa-loop-ivcanon.cc: In function ‘bool try_peel_loop(loop*, edge, tree, bool, long int)’: /home/mjambor/gcc/trunk/src/gcc/tree-ssa-loop-ivcanon.cc:1170:17: error: variable ‘entry_count’ set but not used [-Werror=unused-but-set-variable] 1170 | profile_count entry_count = profile_count::zero (); | ^~~~~~~~~~~ cc1plus: all warnings being treated as errors gcc/ChangeLog: 2023-07-17 Martin Jambor <mjambor@suse.cz> * tree-ssa-loop-ivcanon.cc (try_peel_loop): Remove unused variable entry_count.
-
Mikael Morin authored
Pass already evaluated class container argument from gfc_conv_procedure_call down to gfc_add_finalizer_call through gfc_deallocate_scalar_with_status and gfc_deallocate_with_status, to avoid repeatedly evaluating the same data reference expressions in the generated code. PR fortran/110618 gcc/fortran/ChangeLog: * trans.h (gfc_deallocate_with_status): Add class container argument. (gfc_deallocate_scalar_with_status): Ditto. * trans.cc (gfc_deallocate_with_status): Add class container argument and pass it down to gfc_add_finalize_call. (gfc_deallocate_scalar_with_status): Same. * trans-array.cc (structure_alloc_comps): Update caller. * trans-stmt.cc (gfc_trans_deallocate): Ditto. * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass pre-evaluated class container argument if it's available. gcc/testsuite/ChangeLog: * gfortran.dg/intent_out_22.f90: New test.
-
Mikael Morin authored
Add the possibility to provide a pre-evaluated class container argument to gfc_add_finalizer to avoid repeatedly evaluating data reference expressions in the generated code. PR fortran/110618 gcc/fortran/ChangeLog: * trans.h (gfc_add_finalizer_call): Add class container argument. * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new argument to get_final_proc_ref, get_elem_size, get_var_desc, and get_vptr. (get_elem_size): Add class container argument. Use provided class container if it's available. (get_var_descr): Same. (get_vptr): Same. (get_final_proc_ref): Same. Add boolean telling the class container argument is used. Set it. Don't try to use final_wrapper if class container argument was used.
-
Mikael Morin authored
The same scalar descriptor generation code is present twice, in the case of derived type entities, and in the case of polymorphic non-coarray entities. Factor it in preparation for a future third case that will also need the same code for scalar descriptor generation. gcc/fortran/ChangeLog: * trans.cc (get_var_descr): Factor scalar descriptor generation.
-