aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
6 hoursopenmp: Refactor handling of iteratorsHEADtrunkmasterKwok Cheung Yeung8-196/+173
Move code to calculate the iteration size and to generate the iterator expansion loop into separate functions. Use OMP_ITERATOR_DECL_P to check for iterators in clause declarations. gcc/c-family/ * c-omp.cc (c_finish_omp_depobj): Use OMP_ITERATOR_DECL_P. gcc/c/ * c-typeck.cc (handle_omp_array_sections): Use OMP_ITERATOR_DECL_P. (c_finish_omp_clauses): Likewise. gcc/cp/ * pt.cc (tsubst_omp_clause_decl): Use OMP_ITERATOR_DECL_P. * semantics.cc (handle_omp_array_sections): Likewise. (finish_omp_clauses): Likewise. gcc/ * gimplify.cc (gimplify_omp_affinity): Use OMP_ITERATOR_DECL_P. (compute_omp_iterator_count): New. (build_omp_iterator_loop): New. (gimplify_omp_depend): Use OMP_ITERATOR_DECL_P, compute_omp_iterator_count and build_omp_iterator_loop. * tree-inline.cc (copy_tree_body_r): Use OMP_ITERATOR_DECL_P. * tree-pretty-print.cc (dump_omp_clause): Likewise. * tree.h (OMP_ITERATOR_DECL_P): New macro.
6 hoursx86: Convert MMX integer loads from constant vector poolUros Bizjak11-19/+181
For MMX 16-bit, 32-bit and 64-bit constant vector loads from constant vector pool: (insn 6 2 7 2 (set (reg:V1SI 5 di) (mem/u/c:V1SI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S4 A32])) "pr121062-2.c":10:3 2036 {*movv1si_internal} (expr_list:REG_EQUAL (const_vector:V1SI [ (const_int -1 [0xffffffffffffffff]) ]) (nil))) we can convert it to (insn 12 2 7 2 (set (reg:SI 5 di) (const_int -1 [0xffffffffffffffff])) "pr121062-2.c":10:3 100 {*movsi_internal} (nil)) Co-Developed-by: H.J. Lu <hjl.tools@gmail.com> gcc/ PR target/121062 * config/i386/i386.cc (ix86_convert_const_vector_to_integer): Handle E_V1SImode and E_V1DImode. * config/i386/mmx.md (V_16_32_64): Add V1SI, V2BF and V1DI. (mmxinsnmode): Add V1DI and V1SI. Add V_16_32_64 splitter for constant vector loads from constant vector pool. (V_16_32_64:*mov<mode>_imm): Moved after V_16_32_64 splitter. Replace lowpart_subreg with adjust_address. gcc/testsuite/ PR target/121062 * gcc.target/i386/pr121062-1.c: New test. * gcc.target/i386/pr121062-2.c: Likewise. * gcc.target/i386/pr121062-3a.c: Likewise. * gcc.target/i386/pr121062-3b.c: Likewise. * gcc.target/i386/pr121062-3c.c: Likewise. * gcc.target/i386/pr121062-4.c: Likewise. * gcc.target/i386/pr121062-5.c: Likewise. * gcc.target/i386/pr121062-6.c: Likewise. * gcc.target/i386/pr121062-7.c: Likewise.
6 hoursx86: Warn -pg without -mfentry only on glibc targetsH.J. Lu10-11/+18
Since only glibc targets support -mfentry, warn -pg without -mfentry only on glibc targets. gcc/ PR target/120881 PR testsuite/121078 * config/i386/i386-options.cc (ix86_option_override_internal): Warn -pg without -mfentry only on glibc targets. gcc/testsuite/ PR target/120881 PR testsuite/121078 * gcc.dg/20021014-1.c (dg-additional-options): Add -mfentry -fno-pic only on gnu/x86 targets. * gcc.dg/aru-2.c (dg-additional-options): Likewise. * gcc.dg/nest.c (dg-additional-options): Likewise. * gcc.dg/pr32450.c (dg-additional-options): Likewise. * gcc.dg/pr43643.c (dg-additional-options): Likewise. * gcc.target/i386/pr104447.c (dg-additional-options): Likewise. * gcc.target/i386/pr113122-3.c(dg-additional-options): Likewise. * gcc.target/i386/pr119386-1.c (dg-additional-options): Add -mfentry only on gnu targets. * gcc.target/i386/pr119386-2.c (dg-additional-options): Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
6 hoursi386: Use various predicates instead of open coding themUros Bizjak3-4/+4
No functional changes. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_move): Use MEM_P predicate instead of open coding it. (ix86_erase_embedded_rounding): Use NONJUMP_INSN_P predicate instead of open coding it. * config/i386/i386-features.cc (convertible_comparison_p): Use REG_P predicate instead of open coding it. * config/i386/i386.cc (ix86_rtx_costs): Use SUBREG_P predicate instead of open coding it.
6 hoursi386: Use LABEL_REF_P predicate instead of open coding itUros Bizjak4-21/+21
No functional changes. gcc/ChangeLog: * config/i386/i386.cc (symbolic_reference_mentioned_p): Use LABEL_REF_P predicate instead of open coding it. (ix86_legitimate_constant_p): Ditto. (legitimate_pic_address_disp_p): Ditto. (ix86_legitimate_address_p): Ditto. (legitimize_pic_address): Ditto. (ix86_print_operand): Ditto. (ix86_print_operand_address_as): Ditto. (ix86_rip_relative_addr_p): Ditto. * config/i386/i386.h (SYMBOLIC_CONST): Ditto. * config/i386/i386.md (*anddi_1 to *andsi_1_zext splitter): Ditto. * config/i386/predicates.md (symbolic_operand): Ditto. (local_symbolic_operand): Ditto. (vsib_address_operand): Ditto.
6 hoursi386: Use SYMBOL_REF_P predicate instead of open coding itUros Bizjak6-46/+45
No functional changes. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_move): Use SYMBOL_REF_P predicate instead of open coding it. (ix86_split_long_move): Ditto. (construct_plt_address): Ditto. (ix86_expand_call): Ditto. (ix86_notrack_prefixed_insn_p): Ditto. * config/i386/i386-features.cc (rest_of_insert_endbr_and_patchable_area): Ditto. * config/i386/i386.cc (symbolic_reference_mentioned_p): Ditto. (ix86_force_load_from_GOT_p): Ditto. (ix86_legitimate_constant_p): Ditto. (legitimate_pic_operand_p): Ditto. (legitimate_pic_address_disp_p): Ditto. (ix86_legitimate_address_p): Ditto. (legitimize_pic_address): Ditto. (ix86_legitimize_address): Ditto. (ix86_delegitimize_tls_address): Ditto. (ix86_print_operand): Ditto. (ix86_print_operand_address_as): Ditto. (ix86_rip_relative_addr_p): Ditto. (symbolic_base_address_p): Ditto. * config/i386/i386.h (SYMBOLIC_CONST): Ditto. * config/i386/i386.md (*anddi_1 to *andsi_1_zext splitter): Ditto. * config/i386/predicates.md (symbolic_operand): Ditto. (local_symbolic_operand): Ditto. (local_func_symbolic_operand): Ditto.
6 hoursi386: Use CONST_VECTOR_P predicate instead of open coding itUros Bizjak4-22/+22
No functional changes. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_vector_logical_operator): Use CONST_VECTOR_P instead of open coding it. (ix86_expand_int_sse_cmp): Ditto. (ix86_extract_perm_from_pool_constant): Ditto. (ix86_split_to_parts): Ditto. (const_vector_equal_evenodd_p): Ditto. * config/i386/i386.cc (ix86_print_operand): Ditto. * config/i386/predicates.md (zero_extended_scalar_load_operand): Ditto. (float_vector_all_ones_operand): Ditto. * config/i386/sse.md (avx512vl_vextractf128<mode>): Ditto.
7 hourstree-optimization/121049 - avoid loop masking with even/odd reductionRichard Biener4-0/+68
The following disables loop masking when we are using an even/odd widening operation in a reduction because the loop mask then aligns to the wrong elements. PR tree-optimization/121049 * internal-fn.h (widening_evenodd_fn_p): Declare. * internal-fn.cc (widening_evenodd_fn_p): New function. * tree-vect-stmts.cc (vectorizable_conversion): When using an even/odd widening function disable loop masking. * gcc.dg/vect/pr121049.c: New testcase.
9 hoursifconv: simple factor out operators while doing ifcvt [PR119920]Andrew Pinski4-0/+362
For possible reductions, ifconv currently handles if the addition is on one side of the if. But in the case of PR 119920, the reduction addition is on both sides of the if. E.g. ``` if (_27 == 0) goto <bb 14>; [50.00%] else goto <bb 13>; [50.00%] <bb 14> a_29 = b_14(D) + a_17; goto <bb 15>; [100.00%] <bb 13> a_28 = c_12(D) + a_17; <bb 15> # a_30 = PHI <a_28(13), a_29(14)> ``` Which ifcvt converts into: ``` _34 = _32 + _33; a_15 = (int) _34; _23 = _4 == 0; _37 = _33 + _35; a_13 = (int) _37; a_5 = _23 ? a_15 : a_13; ``` But the vectorizer does not recognize this as a reduction. To fix this, we should factor out the addition from the `if`. This allows us to get: ``` iftmp.0_7 = _22 ? b_13(D) : c_12(D); a_14 = iftmp.0_7 + a_18; ``` Which then the vectorizer recognizes as a reduction. In the case of PR 112324 and PR 110015, it is similar but with MAX_EXPR reduction instead of an addition. Note while this should be done in phiopt, there are regressions due to other passes not able to handle the factored out cases (see linked bug to PR 64700). I have not had time to fix all of the passes that could handle the addition being in the if/then/else rather than being outside yet. So this is I thought it would be useful just to have a localized version in ifconv which is then only used for the vectorizer. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/119920 PR tree-optimization/112324 PR tree-optimization/110015 gcc/ChangeLog: * tree-if-conv.cc (find_different_opnum): New function. (factor_out_operators): New function. (predicate_scalar_phi): Call factor_out_operators when there is only 2 elements of a phi. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-reduc-cond-1.c: New test. * gcc.dg/vect/vect-reduc-cond-2.c: New test. * gcc.dg/vect/vect-reduc-cond-3.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
9 hoursifconv: Small improvement to fold_build_cond_expr; lhs and rhs being the same.Andrew Pinski1-0/+4
This is a small compile time optimization, as match and simplify will generate the same thing but with rhs and lhs being the same we can return early instead of having to go through match and simplify. This might not show up that much at this point but can/will show up after my patch for PR 119920 where we factor out common code between the 2 sides of the if statement while in if-conv. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-if-conv.cc (fold_build_cond_expr): Return early if lhs and rhs are the same. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
9 hoursifconv: Remove unused array predicatedAndrew Pinski1-4/+1
While starting to improve if-conv, I noticed that predicated was only being set once inside a loop and accessed right below. This became this way due to r14-8869-g8636c538b68068 and before it was needed since it was accessed via 2 loops but now it is only set and then accessed in the next statement, there is no reason for it being there. So let's remove it and just use the value from it instead. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-if-conv.cc (combine_blocks): Remove predicated dynamic array. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
11 hourstree-optimization/121116 - avoid _BitInt for vector element initRichard Biener2-0/+22
When having a _BitInt induction we should make sure to not create the step vector elements as _BitInts but as vector element typed. PR tree-optimization/121116 * tree-vect-loop.cc (vectorizable_induction): Use the step vector element type for further processing. * gcc.dg/torture/pr121116.c: New testcase.
13 hoursamdgcn: Fix various unrecognized pattern issues with add<mode>3_vcc_dupAndrew Stubbs1-11/+11
The patterns did not accept inline immediate constants, even though the hardware instructions do, which has lead to some errors in some patches I'm working on. Also the VCC update RTL was using the wrong operands in the wrong places. This appears to have been harmless(?) but is definitely not intended. gcc/ChangeLog: * config/gcn/gcn-valu.md (add<mode>3_vcc_dup<exec_vcc>): Change operand 2 to allow gcn_alu_operand. Swap the operands in the VCC update RTL. (add<mode>3_vcc_zext_dup): Likewise. (add<mode>3_vcc_zext_dup_exec): Likewise. (add<mode>3_vcc_zext_dup2): Likewise. (add<mode>3_vcc_zext_dup2_exec): Likewise.
14 hoursaarch64: Fold builtins with highpart args to highpart equivalent [PR117850]Spencer Abson9-72/+1304
Add a fold at gimple_fold_builtin to prefer the highpart variant of a builtin if at least one argument is a vector highpart and all others are VECTOR_CSTs that we can extend to 128-bits. For example, we prefer to duplicate f0 and use UMULL2 here over DUP+UMULL: uint16x8_t foo (const uint8x16_t s) { const uint8x8_t f0 = vdup_n_u8 (4); return vmull_u8 (vget_high_u8 (s), f0); } gcc/ChangeLog: PR target/117850 * config/aarch64/aarch64-builtins.cc (LO_HI_PAIRINGS): New, group the lo/hi pairs from aarch64-builtin-pairs.def. (aarch64_get_highpart_builtin): New function. (aarch64_v128_highpart_ref): New function, helper to look for vector highparts. (aarch64_build_vector_cst): New function, helper to build duplicated VECTOR_CSTs. (aarch64_fold_lo_call_to_hi): New function. (aarch64_general_gimple_fold_builtin): Add cases for the lo builtins in aarch64-builtin-pairs.def. * config/aarch64/aarch64-builtin-pairs.def: New file, declare the parirs of lowpart-operating and highpart-operating builtins. gcc/testsuite/ChangeLog: PR target/117850 * gcc.target/aarch64/simd/vabal_combine.c: Removed. This is covered by fold_to_highpart_1.c * gcc.target/aarch64/simd/fold_to_highpart_1.c: New test. * gcc.target/aarch64/simd/fold_to_highpart_2.c: Likewise. * gcc.target/aarch64/simd/fold_to_highpart_3.c: Likewise. * gcc.target/aarch64/simd/fold_to_highpart_4.c: Likewise. * gcc.target/aarch64/simd/fold_to_highpart_5.c: Likewise. * gcc.target/aarch64/simd/fold_to_highpart_6.c: Likewise.
15 hoursAdd get_clone_versions and get_target_version functions.Alfie Richards3-1/+73
This is a reimplementation of get_target_clone_attr_len, get_attr_str, and separate_attrs using string_slice and auto_vec to make memory management and use simpler. Adds get_target_version helper function to get the target_version string from a decl. gcc/c-family/ChangeLog: * c-attribs.cc (handle_target_clones_attribute): Change to use get_clone_versions. gcc/ChangeLog: * tree.cc (get_clone_versions): New function. (get_clone_attr_versions): New function. (get_version): New function. * tree.h (get_clone_versions): New function. (get_clone_attr_versions): New function. (get_target_version): New function.
15 hoursChange make_attribute to take string_slice.Alfie Richards2-12/+6
gcc/ChangeLog: * attribs.cc (make_attribute): Change arguments. * attribs.h (make_attribute): Change arguments.
15 hoursRemove unnecessary `record` argument from maybe_version_functions.Alfie Richards3-17/+12
Previously, the `record` argument in maybe_version_function allowed the call to cgraph_node::record_function_versions to be skipped. However, this was only skipped when both decls were already marked as versioned, in which case we trigger the early exit in record_function_versions instead. Therefore, the argument is unnecessary. gcc/cp/ChangeLog: * class.cc (add_method): Remove argument. * cp-tree.h (maybe_version_functions): Ditto. * decl.cc (decls_match): Ditto. (maybe_version_functions): Ditto.
15 hoursAdd string_slice class.Alfie Richards6-4/+306
The string_slice inherits from array_slice and is used to refer to a substring of an array that is memory managed elsewhere without modifying the underlying array. For example, this is useful in cases such as when needing to refer to a substring of an attribute in the syntax tree. Adds some minimal helper functions for string_slice, such as a strtok alternative, equality operators, strcmp, and a function to strip whitespace from the beginning and end of a string_slice. gcc/c-family/ChangeLog: * c-format.cc (local_string_slice_node): New node type. (asm_fprintf_char_table): New entry. (init_dynamic_diag_info): Add support for string_slice. * c-format.h (T_STRING_SLICE): New node type. gcc/ChangeLog: * pretty-print.cc (format_phase_2): Add support for string_slice. * vec.cc (string_slice::tokenize): New static method. (string_slice::strcmp): New static method. (string_slice::strip): New method. (test_string_slice_initializers): New test. (test_string_slice_tokenize): Ditto. (test_string_slice_strcmp): Ditto. (test_string_slice_equality): Ditto. (test_string_slice_inequality): Ditto. (test_string_slice_invalid): Ditto. (test_string_slice_strip): Ditto. (vec_cc_tests): Add new tests. * vec.h (class string_slice): New class. gcc/testsuite/ChangeLog * g++.dg/warn/Wformat-gcc_diag-1.C: Add string_slice "%B" format tests.
17 hoursexpand: Allow fixed-point arithmetic for RDIV_EXPR.Robin Dapp3-2/+15
r16-2175-g5aa21765236730 introduced an assert for floating-point modes when expanding an RDIV_EXPR but forgot fixed-point modes. This patch adds ALL_FIXED_POINT_MODE_P to the assert. PR middle-end/121065 gcc/ChangeLog: * cfgexpand.cc (expand_debug_expr): Allow fixed-point modes for RDIV_EXPR. * optabs-tree.cc (optab_for_tree_code): Ditto. gcc/testsuite/ChangeLog: * gcc.target/arm/pr121065.c: New test.
17 hoursRISC-V: Fix vsetvl merge rule.Robin Dapp2-3/+53
In PR120297 we fuse vsetvl e8,mf2,... vsetvl e64,m1,... into vsetvl e64,m4,... Individually, that's ok but we also change the new vsetvl's demand to "SEW only" even though the first original one demanded SEW >= 8 and ratio = 16. As we forget the ratio after the merge we find that the vsetvl following the merged one has ratio = 64 demand and we fuse into vsetvl e64,m1,.. which obviously doesn't have ratio = 16 any more. Regtested on rv64gcv_zvl512b. PR target/120297 gcc/ChangeLog: * config/riscv/riscv-vsetvl.def: Do not forget ratio demand of previous vsetvl. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/pr120297.c: New test.
17 hoursaarch64: Use SVE2 BSL2N for vector EONKyrylo Tkachov2-0/+86
SVE2 BSL2N (x, y, z) = (x & z) | (~y & ~z). When x == y this computes: (x & z) | (~x & ~z) which is ~(x ^ z). Thus, we can use it to match RTL patterns (not (xor (...) (...))) for both Advanced SIMD and SVE modes when TARGET_SVE2. This patch does that. For code like: uint64x2_t eon_q(uint64x2_t a, uint64x2_t b) { return EON(a, b); } svuint64_t eon_z(svuint64_t a, svuint64_t b) { return EON(a, b); } We now generate: eon_q: bsl2n z0.d, z0.d, z0.d, z1.d ret eon_z: bsl2n z0.d, z0.d, z0.d, z1.d ret instead of the previous: eon_q: eor v0.16b, v0.16b, v1.16b not v0.16b, v0.16b ret eon_z: eor z0.d, z0.d, z1.d ptrue p3.b, all not z0.d, p3/m, z0.d ret Bootstrapped and tested on aarch64-none-linux-gnu. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> gcc/ * config/aarch64/aarch64-sve2.md (*aarch64_sve2_bsl2n_eon<mode>): New pattern. (*aarch64_sve2_eon_bsl2n_unpred<mode>): Likewise. gcc/testsuite/ * gcc.target/aarch64/sve2/eon_bsl2n.c: New test.
17 hoursaarch64: Use SVE2 NBSL for vector NOR and NAND for Advanced SIMD modesKyrylo Tkachov2-0/+97
We already have patterns to use the NBSL instruction to implement vector NOR and NAND operations for SVE types and modes. It is straightforward to have similar patterns for the fixed-width Advanced SIMD modes as well, though it requires combine patterns without the predicate operand and an explicit 'Z' output modifier. This patch does so. So now for example we generate for: uint64x2_t nand_q(uint64x2_t a, uint64x2_t b) { return NAND(a, b); } uint64x2_t nor_q(uint64x2_t a, uint64x2_t b) { return NOR(a, b); } nand_q: nbsl z0.d, z0.d, z1.d, z1.d ret nor_q: nbsl z0.d, z0.d, z1.d, z0.d ret instead of the previous: nand_q: and v0.16b, v0.16b, v1.16b not v0.16b, v0.16b ret nor_q: orr v0.16b, v0.16b, v1.16b not v0.16b, v0.16b ret The tied operand requirements for NBSL mean that we can generate the MOVPRFX when the operands fall that way, but I guess having a 2-insn MOVPRFX form is not worse than the current 2-insn codegen at least, and the MOVPRFX can be fused by many cores. Bootstrapped and tested on aarch64-none-linux-gnu. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> gcc/ * config/aarch64/aarch64-sve2.md (*aarch64_sve2_unpred_nor<mode>): New define_insn. (*aarch64_sve2_nand_unpred<mode>): Likewise. gcc/testsuite/ * gcc.target/aarch64/sve2/nbsl_nor_nand_neon.c: New test.
19 hoursFortran: Fix ICE in ASSOCIATE with user defined operator [PR121060]Paul Thomas2-0/+57
2025-07-16 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/121060 * interface.cc (matching_typebound_op): Defer determination of specific procedure until resolution by returning NULL. gcc/testsuite/ PR fortran/121060 * gfortran.dg/associate_75.f90: New test.
19 hoursFortran: Fix ICE in F2018 IMPORT statements.Paul Thomas2-3/+27
2025-07-16 Steve Kargl <sgk@troutmask.apl.washington.edu> gcc/fortran * decl.cc (gfc_match_import): Correct minor whitespace snafu and fix NULL pointer dereferences in two places. gcc/testsuite/ * gfortran.dg/import13.f90: New test.
21 hoursc, c++: Fix unused result for empty types [PR82134]Jeremy Rifkin5-0/+21
Hi, This fixes PR c/82134 which concerns gcc emitting an incorrect unused result diagnostic for empty types. This diagnostic is emitted from tree-cfg.cc because of a couple code paths which attempt to avoid copying empty types, resulting in GIMPLE that isn't using the returned value of a call. To fix this I've added suppress_warning in three locations and a corresponding check in do_warn_unused_result. Cheers, Jeremy PR c/82134 gcc/cp/ChangeLog: * call.cc (build_call_a): Add suppress_warning * cp-gimplify.cc (cp_gimplify_expr): Add suppress_warning gcc/ChangeLog: * gimplify.cc (gimplify_modify_expr): Add suppress_warning * tree-cfg.cc (do_warn_unused_result): Check warning_suppressed_p gcc/testsuite/ChangeLog: * c-c++-common/attr-warn-unused-result-2.c: New test. Signed-off-by: Jeremy Rifkin <jeremy@rifkin.dev>
22 hoursi386: Decouple AMX-AVX512 from AVX10.2 and imply AVX512FHaochen Jiang5-11/+10
In ISE058, the AVX10.2 imply is removed from AMX-AVX512. This leads to re-consideration on the imply for AMX-AVX512. Since it is using zmm register and using zmm register only, we need to at least imply AVX512F. AVX512VL is not needed. On the other hand, if we imply AVX10.1 for AMX-AVX512, it will cause -mno-avx10.1 disabling AMX-AVX512. This would be a surprise for users. Based on the two reasons above, the patch is decoupling AMX-AVX512 from AVX10.2 and imply AVX512F. gcc/ChangeLog: * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_AMX_AVX512_SET): Do not set AVX10.2. (OPTION_MASK_ISA2_AVX10_2_UNSET): Remove AMX-AVX512 unset. (OPTION_MASK_ISA2_AVX512F_UNSET): Unset AMX-AVX512. (ix86_handle_option): Imply AVX512F for AMX-AVX512. gcc/testsuite/ChangeLog: * gcc.target/i386/amxavx512-cvtrowd2ps-2.c: Add -mavx512fp16 to use FP16 related intrins for convert. * gcc.target/i386/amxavx512-cvtrowps2bf16-2.c: Ditto. * gcc.target/i386/amxavx512-cvtrowps2ph-2.c: Ditto. * gcc.target/i386/amxavx512-movrow-2.c: Ditto.
23 hoursRISC-V: Refine the scalar SAT_* test casesPan Li262-4101/+517
Per previous discuss with Jeff, we don't do complicated asm check like scalar saturation alu. It is somehow not easy to maintain, as well as fragile. Thus, we remove these function-body check, and introduce the jmp label asm check instead.The code-gen of SAT_* will never have a jmp, and the other run test will make sure the correctness of SAT_* code-gen. The below test suites are passed for this patch series. * The rv64gcv fully regression test. The below failed test cases are resolved: FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Oz check-function-bodies sat_s_add_imm_int8_t_fmt_2_1 FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Os check-function-bodies sat_s_add_imm_int8_t_fmt_2_1 FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -O3 check-function-bodies sat_s_add_imm_int8_t_fmt_2_1 FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Ofast check-function-bodies sat_s_add_imm_int8_t_fmt_2_1 FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -O2 check-function-bodies sat_s_add_imm_int8_t_fmt_2_1 gcc/testsuite/ChangeLog: * gcc.target/riscv/sat/sat_s_add-1-i16.c: Remove function-body check and add no jmp label asm check. * gcc.target/riscv/sat/sat_s_add-1-i32.c: * gcc.target/riscv/sat/sat_s_add-1-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add-1-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_add-2-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_add-2-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_add-2-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add-2-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_add-3-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_add-3-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_add-3-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add-3-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_add-4-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_add-4-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_add-4-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add-4-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-1-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-1-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-1-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-1-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-2-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-2-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-2-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_add_imm-2-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-1-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-1-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-1-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-1-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-2-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-2-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-2-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-2-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-3-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-3-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-3-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-3-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-4-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-4-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-4-i64.c: Ditto. * gcc.target/riscv/sat/sat_s_sub-4-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-1-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-2-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-3-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-4-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-5-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-6-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-7-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i16-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i32-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i32-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i64-to-i16.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i64-to-i32.c: Ditto. * gcc.target/riscv/sat/sat_s_trunc-8-i64-to-i8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-1-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-1-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-1-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-1-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-2-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-2-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-2-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-2-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-3-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-3-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-3-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-3-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-4-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-4-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-4-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-4-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-5-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-5-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-5-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-5-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-6-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-6-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-6-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-6-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u16-from-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u16-from-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u32-from-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u8-from-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u8-from-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add-7-u8-from-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-1-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-1-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-1-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-1-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-2-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-2-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-2-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-2-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-3-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-3-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-3-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-3-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-4-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-4-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-4-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_add_imm-4-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_mul-1-u16-from-u128.c: Ditto. * gcc.target/riscv/sat/sat_u_mul-1-u32-from-u128.c: Ditto. * gcc.target/riscv/sat/sat_u_mul-1-u64-from-u128.c: Ditto. * gcc.target/riscv/sat/sat_u_mul-1-u8-from-u128.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-1-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-1-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-1-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-1-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-10-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-10-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-10-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-10-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-11-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-11-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-11-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-11-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-12-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-12-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-12-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-12-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-2-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-2-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-2-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-2-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-3-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-3-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-3-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-3-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-4-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-4-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-4-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-4-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-5-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-5-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-5-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-5-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-6-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-6-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-6-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-6-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-7-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-7-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-7-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-7-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-8-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-8-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-8-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-8-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-9-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-9-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-9-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub-9-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u16-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u16-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u16-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u16-4.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u32-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u32-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u32-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u32-4.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u64-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u64-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u8-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u8-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u8-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u8-4.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-1-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u16-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u16-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u16-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u32-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u32-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u32-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u64-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u8-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u8-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u8-3.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-2-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u16-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u16-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u32-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u32-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u8-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u8-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-3-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u16-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u16-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u32-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u32-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u8-1.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u8-2.c: Ditto. * gcc.target/riscv/sat/sat_u_sub_imm-4-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-1-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-1-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-1-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-1-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-2-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-2-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-2-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-2-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-3-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-3-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-3-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-3-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-4-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-4-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-4-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-4-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-5-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-5-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-5-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-5-u8.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-6-u16.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-6-u32.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-6-u64.c: Ditto. * gcc.target/riscv/sat/sat_u_trunc-6-u8.c: Ditto. Signed-off-by: Pan Li <pan2.li@intel.com>
24 hoursRISC-V: Support RVVDImode for avg3_floor auto vectPan Li17-13/+59
The avg3_floor pattern leverage the add and shift rtl with the DOUBLE_TRUNC mode iterator. Aka, RVVDImode iterator will generate avg3rvvsimode_floor, only the element size QI, HI and SI are allowed. Thus, this patch would like to support the DImode by the standard name, with the iterator V_VLSI_D. The below test suites are passed for this patch series. * The rv64gcv fully regression test. gcc/ChangeLog: * config/riscv/autovec.md (avg<mode>3_floor): Add new pattern of avg3_floor for rvv DImode. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/avg.h: Add int128 type when xlen == 64. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i16-from-i32.c: Suppress __int128 warning for run test. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i16-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i32-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i8-from-i16.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i8-from-i32.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_ceil-run-1-i8-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_data.h: Fix one incorrect test data. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i16-from-i32.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i16-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i32-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i8-from-i16.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i8-from-i32.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i8-from-i64.c: Ditto. * gcc.target/riscv/rvv/autovec/avg_floor-1-i64-from-i128.c: New test. * gcc.target/riscv/rvv/autovec/avg_floor-run-1-i64-from-i128.c: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
24 hoursDaily bump.GCC Administrator9-1/+481
28 hoursspellcheck.{cc,h}: modernizationDavid Malcolm2-61/+66
No functional change intended. gcc/ChangeLog: * spellcheck.cc: Define INCLUDE_ALGORITHM. (CASE_COST, BASE_COST): Convert to... (case_cost, base_cost): ...these, in an anonymous namespace. (get_edit_distance): Update for above. Use std::min rather than MIN. (get_edit_distance_cutoff): Likewise. Use std::max rather than MAX. (selftest::test_edit_distances): Update for BASE_COST renaming. (selftest::get_old_cutoff): Likewise. Use std::max. (selftest::assert_not_suggested_for): Use nullptr. (selftest::test_find_closest_string): Likewise. * spellcheck.h: Replace TYPE with StringLikeType in templates, and use CamelCase. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
28 hourslibgdiagnostics: add diagnostic_message_buffer [PR120792]David Malcolm28-205/+1852
This patch extends libgdiagnostics to provide a way to capture the pp tokens making up a message string, so that SARIF and HTML sinks can retain information such as event IDs and URLs. As well as richer output, this improves the round-tripping of such information through sarif-replay. This also allows diagnostic messages to be built up in pieces, with a drop-in replacement for fprintf, which I've found useful when attempting to port "ld" to use libgdiagnostics. gcc/ChangeLog: PR sarif-replay/120792 * auto-obstack.h: New file, based on material taken from pretty-print.cc. * diagnostic-digraphs.h (diagnostics::digraphs::digraph::set_description): New. (diagnostics::digraphs::node::set_label): New. * doc/libgdiagnostics/topics/compatibility.rst: Add LIBGDIAGNOSTICS_ABI_4. * doc/libgdiagnostics/topics/diagnostics.rst (diagnostic_finish_via_msg_buf): Document new entrypoint. * doc/libgdiagnostics/topics/execution-paths.rst (diagnostic_execution_path_add_event_via_msg_buf): Document new entrypoint. * doc/libgdiagnostics/topics/index.rst: Add message-buffers.rst. * doc/libgdiagnostics/topics/message-buffers.rst: New file. * doc/libgdiagnostics/topics/message-formatting.rst: Add note about message buffers. * doc/libgdiagnostics/topics/physical-locations.rst (diagnostic_add_location_with_label_via_msg_buf): Add. * doc/libgdiagnostics/tutorial/07-execution-paths.rst: Link to next section. * doc/libgdiagnostics/tutorial/08-message-buffers.rst: New file. * doc/libgdiagnostics/tutorial/index.rst: Add 08-message-buffers.rst. * libgdiagnostics++.h (libgdiagnostics::message_buffer): New class. (libgdiagnostics::execution_path::add_event_via_msg_buf): New. (libgdiagnostics::diagnostic::add_location_with_label): New. (libgdiagnostics::diagnostic::finish_via_msg_buf): New. (libgdiagnostics::graph::set_description): New overload. (libgdiagnostics::graph::add_edge): New overload. (libgdiagnostics::node::set_label): New overload. * libgdiagnostics-private.h (private_diagnostic_execution_path_add_event_2): Drop decl. (private_diagnostic_execution_path_add_event_3): New decl. * libgdiagnostics.cc: Include "pretty-print-format-impl.h", "pretty-print-markup.h", and "auto-obstack.h". (class copying_token_printer): New. (struct diagnostic_message_buffer): New. (class pp_element_message_buffer): New. (libgdiagnostics_path_event::libgdiagnostics_path_event): Replace params "gmsgid" and "args" with "msg_buf". (libgdiagnostics_path_event::print_desc): Reimplement using pp_element_message_buffer to replay m_msg_buf into "pp". (libgdiagnostics_path_event::m_desc_uncolored): Drop field. (libgdiagnostics_path_event::m_desc_colored): Drop field. (libgdiagnostics_path_event::msg_buf): New field. (diagnostic_execution_path::add_event_va): Reimplement. (diagnostic_execution_path::add_event_via_msg_buf): New. (diagnostic::add_location_with_label): New overload, using msg_buf. (diagnostic_manager::emit): Reimplement with... (diagnostic_manager::emit_va): ...this. (diagnostic_manager::emit_msg_buf): New. (FAIL_IF_NULL): Rename "p" to "ptr_arg". (diagnostic_finish_va): Update to use diagnostic_manager::emit_va. (diagnostic_graph::add_node_with_id): Rename "id" to "node_id". (diagnostic_graph_add_node): Likewise. (diagnostic_graph_add_edge): Rename "id" to "edge_id". (diagnostic_graph_get_node_by_id): Rename "id" to "node_id". (diagnostic_graph_get_edge_by_id): Rename "id" to "edge_id". (private_diagnostic_execution_path_add_event_2): Delete. (diagnostic_message_buffer_new): New public entrypoint. (diagnostic_message_buffer_release): Likewise. (diagnostic_message_buffer_append_str): Likewise. (diagnostic_message_buffer_append_text): Likewise. (diagnostic_message_buffer_append_byte): Likewise. (diagnostic_message_buffer_append_printf): Likewise. (diagnostic_message_buffer_append_event_id): Likewise. (diagnostic_message_buffer_begin_url): Likewise. (diagnostic_message_buffer_end_url): Likewise. (diagnostic_message_buffer_begin_quote): Likewise. (diagnostic_message_buffer_end_quote): Likewise. (diagnostic_message_buffer_begin_color): Likewise. (diagnostic_message_buffer_end_color): Likewise. (diagnostic_message_buffer_dump): Likewise. (diagnostic_finish_via_msg_buf): Likewise. (diagnostic_add_location_with_label_via_msg_buf): Likewise. (diagnostic_execution_path_add_event_via_msg_buf): Likewise. (diagnostic_graph_set_description_via_msg_buf): Likewise. (diagnostic_graph_add_edge_via_msg_buf): Likewise. (diagnostic_node_set_label_via_msg_buf): Likewise. (private_diagnostic_execution_path_add_event_3): New private entrypoint. * libgdiagnostics.h (LIBGDIAGNOSTICS_PARAM_FORMAT_STRING): New macro. (LIBGDIAGNOSTICS_PARAM_PRINTF_FORMAT_STRING): New macro. (diagnostic_message_buffer): New typedef. (LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer): New define. (diagnostic_message_buffer_new): New decl. (diagnostic_message_buffer_release): New decl. (diagnostic_message_buffer_append_str): New decl. (diagnostic_message_buffer_append_text): New decl. (diagnostic_message_buffer_append_byte): New decl. (diagnostic_message_buffer_append_printf): New decl. (diagnostic_message_buffer_append_event_id): New decl. (diagnostic_message_buffer_begin_url): New decl. (diagnostic_message_buffer_end_url): New decl. (diagnostic_message_buffer_begin_quote): New decl. (diagnostic_message_buffer_end_quote): New decl. (diagnostic_message_buffer_begin_color): New decl. (diagnostic_message_buffer_end_color): New decl. (diagnostic_message_buffer_dump): New decl. (diagnostic_finish_via_msg_buf): New decl. (diagnostic_add_location_with_label_via_msg_buf): New decl. (diagnostic_execution_path_add_event_via_msg_buf): New decl. (diagnostic_graph_set_description_via_msg_buf): New decl. (diagnostic_graph_add_edge_via_msg_buf): New decl. (diagnostic_node_set_label_via_msg_buf): New decl. * libgdiagnostics.map (LIBGDIAGNOSTICS_ABI_3): Drop private_diagnostic_execution_path_add_event_2. (LIBGDIAGNOSTICS_ABI_4): New. * libsarifreplay.cc (class annotation): Use libgdiagnostics::message_buffer rather than label_text. (add_any_annotations): Likewise. (sarif_replayer::handle_result_obj): Likewise. (make_plain_text_within_result_message): Likewise. (handle_thread_flow_location_object): Likewise. (handle_location_object): Likewise. (sarif_replayer::handle_graph_object): Likewise. (sarif_replayer::handle_node_object): Likewise. (sarif_replayer::handle_edge_object): Likewise. * pretty-print-format-impl.h (pp_token_list::push_back_byte): New decl. * pretty-print-markup.h (pp_markup::context::begin_url): New decl. (pp_markup::context::end_url): New decl. (pp_markup::context::add_event_id): New decl. * pretty-print.cc: Include "auto-obstack.h". (pp_token_list::push_back_byte): New. (struct auto_obstack): Move to auto-obstack.h. (default_token_printer): Make non-static. (pp_markup::context::begin_url): New. (pp_markup::context::end_url): New. (pp_markup::context::add_event_id): New. gcc/testsuite/ChangeLog: PR sarif-replay/120792 * libgdiagnostics.dg/sarif.py: Delete duplicate script. * libgdiagnostics.dg/test-message-buffer-c.py: New test script. * libgdiagnostics.dg/test-message-buffer.c: New test. * libgdiagnostics.dg/test-warning-with-path-c.py: Update expected output to reflect that SARIF for event messages now contains JSON pointers when referring to other events by ID. * sarif-replay.dg/2.1.0-valid/3.11.6-embedded-links.sarif: Add HTML and SARIF output, and call out to Python scripts to verify the output. Add example of a result with a link in its message. * sarif-replay.dg/2.1.0-valid/embedded-links-check-html.py: New test script. * sarif-replay.dg/2.1.0-valid/embedded-links-check-sarif-roundtrip.py: New test script. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
29 hoursc++: don't mark void exprs as read [PR44677]Jason Merrill3-40/+15
In Jakub's patch for PR44677 he added code to prevent mark_exp_read on e.g. (void)++i from marking i as read, but it seems to me that we can generalize that to avoid looking any farther into any void expression; you can't read a void value, and an explicit cast will have already called mark_exp_read on its operand in convert_to_void. For testing I added an assert to catch places where we were trying to mark void expressions as read, and fix a few that it found. But there were several other places (such as check_return_expr) where we could have a void expression but always calling mark_exp_read makes sense, so I dropped the assert from the final commit. PR c++/44677 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_fold) [CLEANUP_POINT_EXPR]: Don't force rvalue. [COMPOUND_EXPR]: Likewise. * cvt.cc (convert_to_void): Call mark_exp_read later. * expr.cc (mark_use): Turn off read_p for any void argument. (mark_exp_read): Return early for void argument.
32 hours[PATCH v5] RISC-V: Mips P8700 Conditional Move Support.Umesh Kalappa10-37/+187
Updated the test for rv32 accordingly and no regress found for runs like "runtest --tool gcc --target_board='riscv-sim/-march=rv32gc_zba_zbb_zbc_zbs/-mabi=ilp32d/-mcmodel=medlow' riscv.exp" and "runtest --tool gcc --target_board='riscv-sim/-march=rv64gc_zba_zbb_zbc_zbs/-mabi=lp64d/-mcmodel=medlow' riscv.exp" lint warnings can be ignored for riscv-cores.def and riscv-ext-mips.def gcc/ChangeLog: * config/riscv/riscv-cores.def (RISCV_CORE): Updated the supported march. * config/riscv/riscv-ext-mips.def (DEFINE_RISCV_EXT): New file added for mips conditional mov extension. * config/riscv/riscv-ext.def: Likewise. * config/riscv/t-riscv: Generates riscv-ext.opt * config/riscv/riscv-ext.opt: Generated file. * config/riscv/riscv.cc (riscv_expand_conditional_move): Updated for mips cmov and outlined some code that handle arch cond move. * config/riscv/riscv.md (mov<mode>cc): updated expand for MIPS CCMOV. * config/riscv/mips-insn.md: New file for mips-p8700 ccmov insn. * doc/riscv-ext.texi: Updated for mips cmov. gcc/testsuite/ChangeLog: * gcc.target/riscv/mipscondmov.c: Test file for mips.ccmov insn.
33 hoursc++: constexpr uninitialized union [PR120577]Jason Merrill2-3/+48
This was failing for two reasons: 1) We were wrongly treating the basic_string constructor as zero-initializing the object, which it doesn't. 2) Given that, when we went to look for a value for the anonymous union, we concluded that it was value-initialized, and trying to evaluate that broke because we weren't setting ctx->ctor for it. This patch fixes both issues, #1 by setting CONSTRUCTOR_NO_CLEARING and #2 by inserting a new CONSTRUCTOR for the member rather than evaluate it out of context, which is consistent with cxx_eval_store_expression. PR c++/120577 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_call_expression): Set CONSTRUCTOR_NO_CLEARING on initial value for ctor. (cxx_eval_component_reference): Make value-initialization of an aggregate member explicit. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/constexpr-union9.C: New test.
33 hoursc++: decomp25 vs -fimplicit-constexpr [PR117784]Jason Merrill1-1/+1
Avoid diagnostic changes from -fimplicit-constexpr. PR c++/117784 gcc/testsuite/ChangeLog: * g++.dg/cpp26/decomp25.C: Add -fno-implicit-constexpr.
34 hoursopenmp, fortran: Fix ICE when the procedure name cannot be found in declare ↵Kwok Cheung Yeung2-2/+18
variant directives [PR104428] The result of searching for the procedure name symbol should be checked in case the symbol cannot be found to avoid a null dereference. gcc/fortran/ PR fortran/104428 * trans-openmp.cc (gfc_trans_omp_declare_variant): Check that proc_st is non-NULL before dereferencing. Add line number to error message. gcc/testsuite/ PR fortran/104428 * gfortran.dg/gomp/pr104428.f90: New.
34 hoursasf: Fix offset check in base reg initialization for big-endian targetsKonstantinos Eleftheriou2-13/+28
During the base register initialization, in the case that we are eliminating the load instruction, we are using `offset == 0` in order to find the store instruction that has the same offset as the load. This would not work on big-endian targets where byte 0 would be the MS byte. This patch updates the condition to take into account the target's endianness. We are, also, removing the adjustment of the starting position for the bitfield insertion, when BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN. This is supposed to be handled inside `store_bit_field` and it's not needed anymore after the offset fix. Bootstrapped/regtested on AArch64 LE, x86_64 and PowerPC LE. gcc/ChangeLog: * avoid-store-forwarding.cc (generate_bit_insert_sequence): Remove adjustment of bitfield insertion's starting position when BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN. (process_store_forwarding): Update offset check in base reg initialization to take into account the target's endianness. gcc/testsuite/ChangeLog: * gcc.target/aarch64/avoid-store-forwarding-be.c: New test.
34 hoursaarch64: Enable selective LDAPUR generation for cores with RCPC2Soumya AR12-16/+161
This patch adds the ability to fold the address computation into the addressing mode for LDAPR instructions using LDAPUR when RCPC2 is available. LDAPUR emission is enabled by default when RCPC2 is available, but can be disabled using the avoid_ldapur tune flag on a per-core basis. Currently, it is disabled for neoverse-v2, neoverse-v3, cortex-x925, and architecutres before armv8.8-a. Earlier, the following code: uint64_t foo (std::atomic<uint64_t> *x) { return x[1].load(std::memory_order_acquire); } would generate: foo(std::atomic<unsigned long>*): add x0, x0, 8 ldapr x0, [x0] ret but now generates: foo(std::atomic<unsigned long>*): ldapur x0, [x0, 8] ret The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression. OK for mainline? Signed-off-by: Soumya AR <soumyaa@nvidia.com> gcc/ChangeLog: * config/aarch64/aarch64-tuning-flags.def (AARCH64_EXTRA_TUNING_OPTION): Add AVOID_LDAPUR tuning flag. * config/aarch64/aarch64.cc (aarch64_adjust_generic_arch_tuning): Set AVOID_LDAPUR for architectures before armv8.8-a. (aarch64_override_options_internal): Apply generic tuning adjustments to generic_armv8_a_tunings and generic_armv9_a_tunings. * config/aarch64/aarch64.h (TARGET_ENABLE_LDAPUR): New macro to control LDAPUR usage based on RCPC2 and tuning flags. * config/aarch64/aarch64.md: Add enable_ldapur attribute. * config/aarch64/atomics.md (aarch64_atomic_load<mode>_rcpc): Modify to emit LDAPUR for cores with RCPC2. (*aarch64_atomic_load<ALLX:mode>_rcpc_zext): Likewise. (*aarch64_atomic_load<ALLX:mode>_rcpc_sext): Update constraint to Ust. * config/aarch64/tuning_models/cortexx925.h: Add AVOID_LDAPUR flag. * config/aarch64/tuning_models/neoversev2.h: Likewise. * config/aarch64/tuning_models/neoversev3.h: Likewise. * config/aarch64/tuning_models/neoversev3ae.h: Likewise. gcc/testsuite/ChangeLog: * gcc.target/aarch64/ldapr-sext.c: Update expected output to include offsets. * gcc.target/aarch64/ldapur.c: New test for LDAPUR. * gcc.target/aarch64/ldapur_avoid.c: New test for AVOID_LDAPUR flag.
35 hourstree-optimization/121059 - fixup loop mask queryRichard Biener2-4/+27
When we opportunistically mask an operand of a AND with an already available loop mask we need to query that set with the correct number of masks we expect. PR tree-optimization/121059 * tree-vect-stmts.cc (vectorizable_operation): Query scalar_cond_masked_set with the correct number of masks. * gcc.dg/vect/pr121059.c: New testcase. Co-Authored-By: Richard Sandiford <richard.sandiford@arm.com>
35 hoursc, c++: Extend -Wunused-but-set-* warnings [PR44677]Jakub Jelinek40-57/+1185
The -Wunused-but-set-* warnings work by using 2 bits on VAR_DECLs & PARM_DECLs, TREE_USED and DECL_READ_P. If neither is set, we typically emit -Wunused-variable or -Wunused-parameter warning, that is for variables which are just declared (including initializer) and completely unused. If TREE_USED is set and DECL_READ_P is unset, -Wunused-but-set-* warnings are emitted, i.e. for variables which can appear on the lhs of an assignment expression but aren't actually used elsewhere. The DECL_READ_P marking is done through mark_exp_read called from lots of places (e.g. lvalue to rvalue conversions etc.). LLVM has an extension on top of that in that it doesn't count pre/post inc/decrements as use (i.e. DECL_READ_P for GCC). The following patch does that too, though because we had the current behavior for 11+ years already and lot of people is -Wunused-but-set-* warning free in the current GCC behavior and not in the clang one (including GCC sources), it allows users to choose. Furthermore, it implements another level, where also var @= expr uses of var (except when it is also used in expr) aren't counted as DECL_READ_P. I think it would be nice to also handle var = var @ expr or var = expr @ var but unfortunately mark_exp_read is then done in both FEs during parsing of var @ expr or expr @ var and the code doesn't know it is rhs of an assignment with var as lhs. The patch works mostly by checking if DECL_READ_P is clear at some point and then clearing it again after some operation which might have set it. -Wunused or -Wall or -Wunused -Wextra or -Wall -Wextra turn on the 3 level of the new warning (i.e. the one which ignores also var++, ++var etc. as well as var @= expr), so does -Wunused-but-set-{variable,parameter}, but users can use explicit -Wunused-but-set-{variable,parameter}={1,2} to select a different level. 2025-07-15 Jakub Jelinek <jakub@redhat.com> Jason Merrill <jason@redhat.com> PR c/44677 gcc/ * common.opt (Wunused-but-set-parameter=, Wunused-but-set-variable=): New options. (Wunused-but-set-parameter, Wunused-but-set-variable): Turn into aliases. * common.opt.urls: Regenerate. * diagnostic-spec.cc (nowarn_spec_t::nowarn_spec_t): Use OPT_Wunused_but_set_variable_ instead of OPT_Wunused_but_set_variable and OPT_Wunused_but_set_parameter_ instead of OPT_Wunused_but_set_parameter. * gimple-ssa-store-merging.cc (find_bswap_or_nop_1): Remove unused but set variable tmp. * ipa-strub.cc (pass_ipa_strub::execute): Cast named_args to (void) if ATTR_FNSPEC_DECONST_WATERMARK is not defined. * doc/invoke.texi (Wunused-but-set-parameter=, Wunused-but-set-variable=): Document new options. (Wunused-but-set-parameter, Wunused-but-set-variable): Adjust documentation now that they are just aliases. gcc/c-family/ * c-opts.cc (c_common_post_options): Change warn_unused_but_set_parameter and warn_unused_but_set_variable from 1 to 3 if they were set only implicitly. * c-attribs.cc (build_attr_access_from_parms): Remove unused but set variable nelts. gcc/c/ * c-parser.cc (c_parser_unary_expression): Clear DECL_READ_P after default_function_array_read_conversion for -Wunused-but-set-{parameter,variable}={2,3} on PRE{IN,DE}CREMENT_EXPR argument. (c_parser_postfix_expression_after_primary): Similarly for POST{IN,DE}CREMENT_EXPR. * c-decl.cc (pop_scope): Use OPT_Wunused_but_set_variable_ instead of OPT_Wunused_but_set_variable. (finish_function): Use OPT_Wunused_but_set_parameter_ instead of OPT_Wunused_but_set_parameter. * c-typeck.cc (mark_exp_read): Handle {PRE,POST}{IN,DE}CREMENT_EXPR and don't handle it when cast to void. (build_modify_expr): Clear DECL_READ_P after build_binary_op for -Wunused-but-set-{parameter,variable}=3. gcc/cp/ * cp-gimplify.cc (cp_fold): Clear DECL_READ_P on lhs of MODIFY_EXPR after cp_fold_rvalue if it wasn't set before. * decl.cc (poplevel): Use OPT_Wunused_but_set_variable_ instead of OPT_Wunused_but_set_variable. (finish_function): Use OPT_Wunused_but_set_parameter_ instead of OPT_Wunused_but_set_parameter. * expr.cc (mark_use): Clear read_p for {PRE,POST}{IN,DE}CREMENT_EXPR cast to void on {VAR,PARM}_DECL for -Wunused-but-set-{parameter,variable}={2,3}. (mark_exp_read): Handle {PRE,POST}{IN,DE}CREMENT_EXPR and don't handle it when cast to void. * module.cc (trees_in::fn_parms_fini): Remove unused but set variable ix. * semantics.cc (finish_unary_op_expr): Return early for PRE{IN,DE}CREMENT_EXPR. * typeck.cc (cp_build_unary_op): Clear DECL_READ_P after mark_lvalue_use for -Wunused-but-set-{parameter,variable}={2,3} on PRE{IN,DE}CREMENT_EXPR argument. (cp_build_modify_expr): Clear DECL_READ_P after cp_build_binary_op for -Wunused-but-set-{parameter,variable}=3. gcc/go/ * gofrontend/gogo.cc (Function::export_func_with_type): Remove unused but set variable i. gcc/cobol/ * gcobolspec.cc (lang_specific_driver): Remove unused but set variable n_cobol_files. gcc/testsuite/ * c-c++-common/Wunused-parm-1.c: New test. * c-c++-common/Wunused-parm-2.c: New test. * c-c++-common/Wunused-parm-3.c: New test. * c-c++-common/Wunused-parm-4.c: New test. * c-c++-common/Wunused-parm-5.c: New test. * c-c++-common/Wunused-parm-6.c: New test. * c-c++-common/Wunused-var-7.c (bar, baz): Expect warning on a. * c-c++-common/Wunused-var-19.c: New test. * c-c++-common/Wunused-var-20.c: New test. * c-c++-common/Wunused-var-21.c: New test. * c-c++-common/Wunused-var-22.c: New test. * c-c++-common/Wunused-var-23.c: New test. * c-c++-common/Wunused-var-24.c: New test. * g++.dg/cpp26/name-independent-decl1.C (foo): Expect one set but not used warning. * g++.dg/warn/Wunused-parm-12.C: New test. * g++.dg/warn/Wunused-parm-13.C: New test. * g++.dg/warn/Wunused-var-2.C (f2): Expect set but not used warning on parameter x and variable a. * g++.dg/warn/Wunused-var-40.C: New test. * g++.dg/warn/Wunused-var-41.C: New test. * gcc.dg/memchr-3.c (test_find): Change return type from void to int, and add return n; statement. * gcc.dg/unused-9.c (g): Move dg-bogus to the correct line and expect a warning on i.
38 hoursaarch64: fixup: Implement sme2+faminmax extension.Alfie Richards1-3/+3
Fixup to the SME2+FAMINMAX intrinsics commit. gcc/ChangeLog: * config/aarch64/aarch64-sme.md (@aarch64_sme_<faminmax_uns_op><mode>): Change gating and comment.
40 hoursRevert "aarch64: Use EOR3 for DImode values"Kyrylo Tkachov2-30/+1
This reverts commit cfa827188dc236ba905b12ef06ccc517b9f2de39.
40 hoursaarch64: AND/BIC combines for unpacked SVE FP comparisonsSpencer Abson3-13/+65
This patch extends the splitting patterns for combining FP comparisons with predicated logical operations such that they cover all of SVE_F. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (*fcm<cmp_op><mode>_and_combine): Extend from SVE_FULL_F to SVE_F. (*fcmuo<mode>_and_combine): Likewise. (*fcm<cmp_op><mode>_bic_combine): Likewise. (*fcm<cmp_op><mode>_nor_combine): Likewise. (*fcmuo<mode>_bic_combine): Likewise. (*fcmuo<mode>_nor_combine): Likewise. Move the comment here to above fcmuo<mode>_bic_combine, since it applies to both patterns. gcc/testsuite/ChangeLog: * gcc.target/aarch64/sve/unpacked_fcm_combines_1.c: New test. * gcc.target/aarch64/sve/unpacked_fcm_combines_2.c: Likewise.
40 hoursfortran: Amend descriptor bounds init if unallocatedMikael Morin2-47/+49
Always generate the conditional initialization of unallocated variables regardless of the basic variable allocation tracking done in the frontend and with an additional always false condition. The scalarizer used to always evaluate array bounds, including in the case of unallocated arrays on the left hand side of an assignment. This was (correctly) causing uninitialized warnings, even if the uninitialized values were in the end discarded. Since the fix for PR fortran/108889, an initialization of the descriptor bounds is added to silent the uninitialized warnings, conditional on the array being unallocated. This initialization is not useful in the execution of the program, and it is removed if the compiler can prove that the variable is unallocated (in the case of a local variable for example). Unfortunately, the compiler is not always able to prove it and the useless initialization may remain in the final code. Moreover, the generated code that was causing the evaluation of uninitialized variables has ben changed to avoid them, so we can try to remove or revisit that unallocated variable bounds initialization tweak. Unfortunately, just removing the extra initialization restores the warnings at -O0, as there is no dead code removal at that optimization level. Instead, this change keeps the initialization and modifies its guarding condition with an extra always false variable, so that if optimizations are enabled the whole initialization block is removed, and if they are disabled it remains and is sufficient to prevent the warning. The new variable requires the code generation to be done earlier in the function so that the variable declaration and usage are in the same scope. As the modified condition guarantees the removal of the block with optimizations, we can emit it more broadly and remove the basic allocation tracking that was done in the frontend to limit its emission. gcc/fortran/ChangeLog: * gfortran.h (gfc_symbol): Remove field allocated_in_scope. * trans-array.cc (gfc_array_allocate): Don't set it. (gfc_alloc_allocatable_for_assignment): Likewise. Generate the unallocated descriptor bounds initialisation before the opening of the reallocation code block. Create a variable and use it as additional condition to the unallocated descriptor bounds initialisation.
40 hoursfortran: Delay evaluation of array bounds after reallocationMikael Morin2-47/+104
Delay the evaluation of bounds, offset, etc after the reallocation, for the scalarization of allocatable arrays on the left hand side of assignments. Before this change, the code preceding the scalarization loop is like: D.4757 = ref2.offset; D.4759 = ref2.dim[0].ubound; D.4762 = ref2.dim[0].lbound; { if (ref2.data == 0B) goto realloc; if (ref2.dim[0].lbound + 4 != ref2.dim[0].ubound) goto realloc; goto L.10; realloc: ... change offset and bounds ... D.4757 = ref2.offset; D.4762 = NON_LVALUE_EXPR <ref2.dim[0].lbound>; ... reallocation ... L.10:; } while (1) { ... scalarized code ... so the bounds etc are evaluated first to variables, and the reallocation code takes care to update the variables during the reallocation. This is problematic because the variables' initialization references the array bounds, which for unallocated arrays are uninitialized at the evaluation point. This used to (correctly) cause uninitialized warnings (see PR fortran/108889), and a workaround for variables was found, that initializes the bounds of arrays variables to some value beforehand if they are unallocated. For allocatable components, there is no warning but the problem remains, some uninitialized values are used, even if discarded later. After this change the code becomes: { if (ref2.data == 0B) goto realloc; if (ref2.dim[0].lbound + 4 != ref2.dim[0].ubound) goto realloc; goto L.10; realloc:; ... change offset and bounds ... ... reallocation ... L.10:; } D.4762 = ref2.offset; D.4763 = ref2.dim[0].lbound; D.4764 = ref2.dim[0].ubound; while (1) { ... scalarized code so the scalarizer avoids storing the values to variables at the time it evaluates them, if the array is reallocatable on assignment. Instead, it keeps expressions with references to the array descriptor fields, expressions that remain valid through reallocation. After the reallocation code has been generated, the expressions stored by the scalarizer are evaluated in place to variables. The decision to delay evaluation is based on the existing field is_alloc_lhs, which requires a few tweaks to be alway correct wrt to what its name suggests. Namely it should be set even if the assignment right hand side is an intrinsic function, and it should not be set if the right hand side is a scalar and neither if the -fno-realloc-lhs flag is passed to the compiler. gcc/fortran/ChangeLog: * trans-array.cc (gfc_conv_ss_descriptor): Don't evaluate offset and data to a variable if is_alloc_lhs is set. Move the existing evaluation decision condition for data... (save_descriptor_data): ... here as a new predicate. (evaluate_bound): Add argument save_value. Omit the evaluation of the value to a variable if that argument isn't set. (gfc_conv_expr_descriptor): Update caller. (gfc_conv_section_startstride): Update caller. Set save_value if is_alloc_lhs is not set. Omit the evaluation of stride to a variable if save_value isn't set. (gfc_set_delta): Omit the evaluation of delta to a variable if is_alloc_lhs is set. (gfc_is_reallocatable_lhs): Return false if flag_realloc_lhs isn't set. (gfc_alloc_allocatable_for_assignment): Don't update the variables that may be stored in saved_offset, delta, and data. Call instead... (update_reallocated_descriptor): ... this new procedure. * trans-expr.cc (gfc_trans_assignment_1): Don't omit setting the is_alloc_lhs flag if the right hand side is an intrinsic function. Clear the flag if the right hand side is scalar.
40 hoursfortran: Generate array reallocation out of loopsMikael Morin1-9/+12
Generate the array reallocation on assignment code before entering the scalarization loops. This doesn't move the generated code itself, which was already put before the outermost loop, but only changes the current scope at the time the code is generated. This is a prerequisite for a followup patch that makes the reallocation code create new variables. Without this change the new variables would be declared in the innermost loop body and couldn't be used outside of it. gcc/fortran/ChangeLog: * trans-expr.cc (gfc_trans_assignment_1): Generate array reallocation code before entering the scalarisation loops.
41 hoursFix tree.cc compilation on SPARCRainer Orth1-0/+1
commit 4d7baa94a48c27030c8ffcfaf3dd187be09903a9 Author: Andrew Pinski <quic_apinski@quicinc.com> Date: Sun Jul 13 11:56:03 2025 -0700 tree: Add include to tm_p.h to tree.cc [PR120866] broke SPARC bootstrap: In file included from ./tm_p.h:4, from /vol/gcc/src/hg/master/local/gcc/tree.cc:35: /vol/gcc/src/hg/master/local/gcc/config/sparc/sparc-protos.h:46:47: error: use of enum ‘memmodel’ without previous declaration 46 | extern void sparc_emit_membar_for_model (enum memmodel, int, int); | Fixed by including memmodel.h. Bootstrapped without regressions on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2025-07-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc: * tree.cc: Include memmodel.h.
42 hoursfortran: Fix indentationFilip Kastl1-10/+10
Move a block of code two spaces to the left. Commiting as obvious. gcc/fortran/ChangeLog: * resolve.cc (resolve_select_type): Fix indentation. Signed-off-by: Filip Kastl <fkastl@suse.cz>
2 daysDaily bump.GCC Administrator5-1/+359
2 dayscobol: Eliminate cppcheck warnings in gcc/cobol .cc files.Robert Dubner15-150/+177
These changes eliminate various cppcheck warnings, mostly involving C-Style casting and applying "const" to various variables and formal parameters. Some tab characters were eliminated, and some lines were trimmed to seventy-nine characters. gcc/cobol/ChangeLog: * cobol1.cc (cobol_langhook_handle_option): Eliminate cppcheck warnings. * dts.h: Likewise. * except.cc (cbl_enabled_exceptions_t::dump): Likewise. * gcobolspec.cc (lang_specific_driver): Likewise. * genapi.cc (parser_file_merge): Likewise. * gengen.cc (gg_unique_in_function): Likewise. (gg_declare_variable): Likewise. (gg_peek_fn_decl): Likewise. (gg_define_function): Likewise. * genmath.cc (set_up_on_exception_label): Likewise. (set_up_compute_error_label): Likewise. (arithmetic_operation): Likewise. (fast_divide): Likewise. * genutil.cc (get_and_check_refstart_and_reflen): Likewise. (get_depending_on_value_from_odo): Likewise. (get_data_offset): Likewise. (get_binary_value): Likewise. (process_this_exception): Likewise. (copy_little_endian_into_place): Likewise. (refer_is_clean): Likewise. (refer_fill_depends): Likewise. * genutil.h (process_this_exception): Likewise. (copy_little_endian_into_place): Likewise. (refer_is_clean): Likewise. * lexio.cc (check_push_pop_directive): Likewise. (check_source_format_directive): Likewise. (location_in): Likewise. (lexer_input): Likewise. (cdftext::lex_open): Likewise. (lexio_dialect_mf): Likewise. (valid_sequence_area): Likewise. (cdftext::free_form_reference_format): Likewise. (cdftext::segment_line): Likewise. * lexio.h (struct span_t): Likewise. * scan_ante.h (trim_location): Likewise. * symbols.cc (symbol_elem_cmp): Likewise. (symbol_alphabet): Likewise. (end_of_group): Likewise. (cbl_field_t::attr_str): Likewise. (symbols_update): Likewise. (symbol_typedef_add): Likewise. (symbol_field_add): Likewise. (new_temporary_impl): Likewise. (symbol_label_section_exists): Likewise. (symbol_program_callables): Likewise. (file_status_status_of): Likewise. * symfind.cc (is_data_field): Likewise. (finalize_symbol_map2): Likewise. (class in_scope): Likewise. (symbol_match2): Likewise. * util.cc (get_current_dir_name): Likewise. (gb4): Likewise. (class cdf_directives_t): Likewise. (cbl_field_t::report_invalid_initial_value): Likewise. (literal_subscript_oob): Likewise. (cbl_refer_t::str): Likewise. (date_time_fmt): Likewise. (class unique_stack): Likewise. (cobol_set_pp_option): Likewise. (cobol_filename): Likewise. (cobol_filename_restore): Likewise. (gcc_location_set_impl): Likewise. (ydferror): Likewise. (error_msg_direct): Likewise. (yyerror): Likewise. (cbl_unimplemented_at): Likewise.