diff options
258 files changed, 4717 insertions, 1557 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 2ef5738..11a5c7b 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2025-05-09 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> + + * check_GNU_style_lib.py: Remove literal prefix. + 2025-05-01 Gerald Pfeifer <gerald@pfeifer.com> * config-list.mk: Update FreeBSD targets to version 13. diff --git a/contrib/check_GNU_style_lib.py b/contrib/check_GNU_style_lib.py index f680983..8b930ef 100755 --- a/contrib/check_GNU_style_lib.py +++ b/contrib/check_GNU_style_lib.py @@ -279,7 +279,9 @@ def check_GNU_style_file(file, format): patch = PatchSet(file) for pfile in patch.added_files + patch.modified_files: - t = pfile.target_file.lstrip('b/') + t = pfile.target_file + if t.startswith('b/'): + t = t[2:] # Skip testsuite files if 'testsuite' in t or t.endswith('.py'): continue diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d239c35..f4aa01b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,362 @@ +2025-05-09 Eric Botcazou <ebotcazou@adacore.com> + + * vr-values.cc (simplify_using_ranges::simplify) <BIT_AND_EXPR>: + Do not call simplify_bit_ops_using_ranges for boolean types whose + precision is not 1. + +2025-05-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/114166 + * tree-vect-stmts.cc (vectorizable_operation): Lower also + bitwise operations on word-mode vectors. + +2025-05-09 Richard Biener <rguenther@suse.de> + + * tree-vect-stmts.cc (vectorizable_operation): Remve non-SLP + path. + +2025-05-09 Andrew Pinski <quic_apinski@quicinc.com> + + * gimple.h (gimple_cond_true_canonical_p): New function. + (gimple_cond_false_canonical_p): New function. + * gimple-fold.cc (replace_stmt_with_simplification): Return + false if replacing the operands of GIMPLE_COND with an INTEGER_CST + and already in canonical form. + +2025-05-09 Richard Biener <rguenther@suse.de> + + PR rtl-optimization/120182 + * dse.cc (canon_address): Constant addresses have no + separate store group. + +2025-05-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/119960 + * tree-vect-slp.cc (vect_slp_can_convert_to_external): + Handle cases where defs from multiple BBs are ordered + by their dominance relation. + +2025-05-09 Jørgen Kvalsvik <j@lambda.is> + + PR gcov-profile/120086 + * gcov.cc (print_prime_path_lines): Use unsigned, format with + %u. + (print_prime_path_source): Likewise. + (output_path_coverage): Format with HOST_SIZE_T_PRINT_UNSIGNED, + use unsigned for pathno. + +2025-05-09 Jennifer Schmitz <jschmitz@nvidia.com> + + * config/aarch64/aarch64-sve.md (*aarch64_sve_ptrue<mode>_ldr_str): + Add define_insn_and_split to fold predicated SVE loads/stores with + ptrue predicates to unpredicated instructions. + +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * Makefile.in (OBJS-libcommon): Add diagnostic-format-html.o. + * diagnostic-format-html.cc: Move here from + testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc. + Simplify includes. Rename "xhtml" to "html" throughout. + (write_escaped_text): Drop. + (class xhtml_stream_output_format): Drop. + (class html_file_output_format): Reimplement using + diagnostic_output_file. + (diagnostic_output_format_init_xhtml): Drop. + (diagnostic_output_format_init_xhtml_stderr): Drop. + (diagnostic_output_format_init_xhtml_file): Drop. + (diagnostic_output_format_open_html_file): New. + (make_html_sink): New. + (xhtml_format_selftests): Convert to... + (diagnostic_format_html_cc_tests): ...this. + (plugin_is_GPL_compatible): Drop. + (plugin_init): Drop. + * diagnostic-format-html.h: New file. + * doc/invoke.texi (-fdiagnostics-add-output=): Add + "experimental-html" scheme. + * opts-diagnostic.cc: Include "diagnostic-format-html.h". + (class html_scheme_handler): New. + (output_factory::output_factory): Add html_scheme_handler. + (html_scheme_handler::make_sink): New. + * selftest-run-tests.cc (selftest::run_tests): Call the new + selftests. + * selftest.h (selftest::diagnostic_format_html_cc_tests): New + decl. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + * gimple-fold.cc (replace_stmt_with_simplification): Return false + if replacing `bool_var != 0` with `bool_var` in GIMPLE_COND. + +2025-05-08 Andre Vieira <andre.simoesdiasvieira@arm.com> + + * tree-vect-loop.cc (get_initial_def_for_reduction): Remove. + (vect-create_epilog_for_reduction): Remove non-SLP path. + (vectorize_fold_left_reduction): Likewise. + (vectorizable_lane_reducing): Likewise. + (vectorizable_reduction): Likewise. + (vect_transform_reduction): Likewise. + (vect_transform_cycle_phi): Likewise. + (vectorizable_lc_phi): Remove non-SLP PATH and split into... + (vect_transform_lc_phi): ... this. + (update_epilogue_loop_vinfo): Update comment. + * tree-vect-stmts.cc (vect_analyze_stmt): Update call to + vectorizable_lc_phi. + (vect_transform_stmt): Update calls to vect_transform_reduction and + vect_transform_cycle_phi. Rename call from vectorizable_lc_phi to + vect_transform_lc_phi. + * tree-vectorizer.h (vect_transform_reduction): Update declaration. + (vect_transform_cycle_phi): Likewise. + (vectorizable_lc_phi): Likewise. + (vect_transform_lc_phi): New. + +2025-05-08 Richard Earnshaw <rearnsha@arm.com> + + * gensupport.cc (conlist::conlist): Pass a location to the constructor. + Only allow skipping of non-alpha-numeric characters when parsing a + number and only allow '=', '+' or '%'. Add some error checking when + parsing an operand number. + (parse_section_layout): Pass the location to the conlist constructor. + (parse_section): Allow an optional list of forbidden characters. + If specified, reject strings containing them. + (convert_syntax): Reject '=', '+' or '%' in an alternative. + +2025-05-08 Richard Earnshaw <rearnsha@arm.com> + + * config/aarch64/aarch64-sve.md (@aarch64_pred_<optab><mode>): Move + commutative marker to the cons specification. + (add<mode>3): Likewise. + (@aarch64_pred_<su>abd<mode>): Likewise. + (@aarch64_pred_<optab><mode>): Likewise. + (*cond_<optab><mode>_z): Likewise. + (<optab><mode>3): Likewise. + (@aarch64_pred_<optab><mode>): Likewise. + (*aarch64_pred_abd<mode>_relaxed): Likewise. + (*aarch64_pred_abd<mode>_strict): Likewise. + (@aarch64_pred_<optab><mode>): Likewise. + (@aarch64_pred_<optab><mode>): Likewise. + (@aarch64_pred_fma<mode>): Likewise. + (@aarch64_pred_fnma<mode>): Likewise. + (@aarch64_pred_<optab><mode>): Likewise. + * config/aarch64/aarch64-sve2.md (@aarch64_sve_<su>clamp<mode>): Move + commutative marker to the cons specification. + (*aarch64_sve_<su>clamp<mode>_x): Likewise. + (@aarch64_sve_fclamp<mode>): Likewise. + (*aarch64_sve_fclamp<mode>_x): Likewise. + (*aarch64_sve2_nor<mode>): Likewise. + (*aarch64_sve2_nand<mode>): Likewise. + (*aarch64_pred_faminmax_fused): Likewise. + * config/aarch64/aarch64.md (*loadwb_pre_pair_<ldst_sz>): Move the + early-clobber marker to the relevant alternative. + (*storewb_pre_pair_<ldst_sz>): Likewise. + (*add<mode>3_aarch64): Move commutative marker to the cons + specification. + (*addsi3_aarch64_uxtw): Likewise. + (*add<mode>3_poly_1): Likewise. + (add<mode>3_compare0): Likewise. + (*addsi3_compare0_uxtw): Likewise. + (*add<mode>3nr_compare0): Likewise. + (<optab><mode>3): Likewise. + (*<optab>si3_uxtw): Likewise. + (*and<mode>3_compare0): Likewise. + (*andsi3_compare0_uxtw): Likewise. + (@aarch64_and<mode>3nr_compare0): Likewise. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/116352 + * tree-vect-slp.cc (vect_build_slp_tree_2): When compressing + operands from a two-operator node make sure the resulting + operation does not mix defs from different basic-blocks. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120043 + * tree-ssa-phiopt.cc (cond_store_replacement): Check + whether the store is to readonly memory. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + PR tree-optimization/116938 + * tree-ssa-phiopt.cc (move_stmt): Use rewrite_to_defined_overflow + isntead of manually doing the rewrite of the VCE. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + PR tree-optimization/120122 + PR tree-optimization/116939 + * gimple-fold.h (gimple_with_undefined_signed_overflow): Rename to .. + (rewrite_to_defined_overflow): This. + (gimple_needing_rewrite_undefined): Rename to ... + (rewrite_to_defined_unconditional): this. + * gimple-fold.cc (gimple_with_undefined_signed_overflow): Rename to ... + (gimple_needing_rewrite_undefined): This. Return true for VCE with integral + types of smaller precision. + (rewrite_to_defined_overflow): Rename to ... + (rewrite_to_defined_unconditional): This. Handle VCE rewriting to a cast. + * tree-if-conv.cc: s/gimple_with_undefined_signed_overflow/gimple_needing_rewrite_undefined/ + s/rewrite_to_defined_overflow/rewrite_to_defined_unconditional. + * tree-scalar-evolution.cc: Likewise + * tree-ssa-ifcombine.cc: Likewise. + * tree-ssa-loop-im.cc: Likewise. + * tree-ssa-loop-split.cc: Likewise. + * tree-ssa-reassoc.cc: Likewise. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR ipa/120146 + * tree-ssa-structalias.cc (create_variable_info_for): If + the symtab cannot tell us whether all refs to a variable + are explicit assume they are not. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/119589 + PR tree-optimization/119586 + PR tree-optimization/119155 + * tree-vect-stmts.cc (vectorizable_store): Verify + DR_STEP_ALIGNMENT preserves DR_TARGET_ALIGNMENT when + VF > 1 and VMAT_STRIDED_SLP. Use vector aligned accesses when + we can. + (vectorizable_load): Likewise. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120143 + * tree-vect-data-refs.cc (vect_analyze_early_break_dependences): + Move/update the original stmts, not the pattern stmts which + lack virtual operands and are not in the IL. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120089 + * tree-vect-stmts.cc (vect_stmt_relevant_p): Mark all + PHIs live when not already so and doing early-break + vectorization. + (vect_mark_stmts_to_be_vectorized): Skip virtual PHIs. + * tree-vect-slp.cc (vect_analyze_slp): Robustify handling + of early-break forced IVs. + +2025-05-08 Pengxuan Zheng <quic_pzheng@quicinc.com> + + * config/aarch64/aarch64-protos.h (aarch64_exact_log2_inverse): New. + * config/aarch64/aarch64-simd.md (aarch64_simd_vec_set_zero<mode>): + Update pattern accordingly. + * config/aarch64/aarch64.cc (aarch64_exact_log2_inverse): New. + * simplify-rtx.cc (simplify_context::simplify_ternary_operation): + Canonicalize vec_merge. + +2025-05-07 Jeff Law <jlaw@ventanamicro.com> + + PR target/120137 + PR target/120154 + * config/riscv/riscv-vect-permconst.cc (process_bb): Verify each + canonicalized element fits into the vector element mode. + +2025-05-07 Dongyan Chen <chendongyan@isrc.iscas.ac.cn> + + * common/config/riscv/riscv-common.cc: New extension. + * config/riscv/riscv.opt: Ditto. + +2025-05-07 Richard Earnshaw <rearnsha@arm.com> + + PR target/91323 + * config/arm/arm.cc (arm_select_cc_mode): Use CCFPEmode for LTGT. + +2025-05-07 Richard Earnshaw <rearnsha@arm.com> + + PR target/110796 + PR target/118446 + * config/arm/arm.h (REVERSIBLE_CC_MODE): FP modes are only + reversible if flag_finite_math_only. + * config/arm/arm.cc (arm_select_cc_mode): Return CCFPmode for all + FP comparisons if flag_finite_math_only. + +2025-05-07 Andrew Pinski <quic_apinski@quicinc.com> + + PR tree-optimization/111276 + * gimple-fold.cc (arith_code_with_undefined_signed_overflow): Make static. + (gimple_with_undefined_signed_overflow): New function. + * gimple-fold.h (arith_code_with_undefined_signed_overflow): Remove. + (gimple_with_undefined_signed_overflow): Add declaration. + * tree-if-conv.cc (if_convertible_gimple_assign_stmt_p): Use + gimple_with_undefined_signed_overflow instead of manually + checking lhs and the code of the stmt. + (predicate_statements): Likewise. + * tree-ssa-ifcombine.cc (ifcombine_rewrite_to_defined_overflow): Likewise. + * tree-ssa-loop-im.cc (move_computations_worker): Likewise. + * tree-ssa-reassoc.cc (update_range_test): Likewise. Reformat. + * tree-scalar-evolution.cc (final_value_replacement_loop): Use + gimple_with_undefined_signed_overflow instead of + arith_code_with_undefined_signed_overflow. + * tree-ssa-loop-split.cc (split_loop): Likewise. + +2025-05-07 Andrew Pinski <quic_apinski@quicinc.com> + + * tree-ssa-loop-im.cc (compute_invariantness): Hoist to the always executed point + if ignorning the cost. + +2025-05-07 Jan Hubicka <hubicka@ucw.cz> + + * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): Add FLOAT_EXPR; + FIX_TRUNC_EXPR and vec_promote_demote costs. + +2025-05-07 Jennifer Schmitz <jschmitz@nvidia.com> + + PR target/117978 + * config/aarch64/aarch64-protos.h: Declare + aarch64_emit_load_store_through_mode and aarch64_sve_maskloadstore. + * config/aarch64/aarch64-sve.md + (maskload<mode><vpred>): New define_expand folding maskloads with + certain predicate patterns to ASIMD loads. + (*aarch64_maskload<mode><vpred>): Renamed from maskload<mode><vpred>. + (maskstore<mode><vpred>): New define_expand folding maskstores with + certain predicate patterns to ASIMD stores. + (*aarch64_maskstore<mode><vpred>): Renamed from maskstore<mode><vpred>. + * config/aarch64/aarch64.cc + (aarch64_emit_load_store_through_mode): New function emitting a + load/store through subregs of a given mode. + (aarch64_emit_sve_pred_move): Refactor to use + aarch64_emit_load_store_through_mode. + (aarch64_expand_maskloadstore): New function to emit ASIMD loads/stores + for maskloads/stores with SVE predicates with VL1, VL2, VL4, VL8, or + VL16 patterns. + (aarch64_partial_ptrue_length): New function returning number of leading + set bits in a predicate. + +2025-05-07 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * config/s390/s390-protos.h (s390_expand_cstoreti4): New + function. + * config/s390/s390.cc (s390_expand_cstoreti4): New function. + * config/s390/s390.md (CC_SUZ): New mode iterator. + (l): New mode attribute. + (cc_tolower): New mode attribute. + * config/s390/vector.md (cstoreti4): New expander. + (*vec_cmpv2di_lane0_<cc_tolower>): New insn. + (*vec_cmpti_<cc_tolower>): New insn. + +2025-05-07 H.J. Lu <hjl.tools@gmail.com> + + PR target/120036 + * config/i386/i386-features.cc (ix86_get_vector_load_mode): + Handle 8/4/2 bytes. + (remove_redundant_vector_load): If the mode size is smaller than + its natural size, first insert an extra move with a QI vector + SUBREG of the same size to avoid validate_subreg failure. + +2025-05-07 hongtao.liu <hongtao.liu@intel.com> + + PR gcov-profile/118508 + * auto-profile.cc + (autofdo_source_profile::get_callsite_total_count): Fix name + mismatch for fortran. + +2025-05-07 Jeff Law <jlaw@ventanamicro.com> + + * config/riscv/riscv.md (*branch<ANYI:mode>_shiftedarith_equals_zero): + Avoid generating unnecessary andi. Fix formatting. + 2025-05-06 Dongyan Chen <chendongyan@isrc.iscas.ac.cn> * common/config/riscv/riscv-common.cc: New extension. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 9687431..21a86ae 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250507 +20250510 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 55b4cd7..e3af923 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1850,6 +1850,7 @@ OBJS = \ # Objects in libcommon.a, potentially used by all host binaries and with # no target dependencies. OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \ + diagnostic-format-html.o \ diagnostic-format-json.o \ diagnostic-format-sarif.o \ diagnostic-format-text.o \ diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog index c2bf3f3..9f6a58c 100644 --- a/gcc/cobol/ChangeLog +++ b/gcc/cobol/ChangeLog @@ -1,3 +1,19 @@ +2025-05-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR cobol/119217 + * symbols.h (NAME_MAX): Define fallback. + +2025-05-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR cobol/119217 + * dts.h (csub_match): Initialize rm_so, rm_eo fields explicitly. + +2025-05-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR cobol/119217 + * cdf-copy.cc (GLOB_BRACE): Define fallback. + (GLOB_TILDE): Likewise. + 2025-05-05 Robert Dubner <rdubner@symas.com> * cdf.y: Exceptions. diff --git a/gcc/cobol/cdf-copy.cc b/gcc/cobol/cdf-copy.cc index 2e4bfb6..059596c 100644 --- a/gcc/cobol/cdf-copy.cc +++ b/gcc/cobol/cdf-copy.cc @@ -42,6 +42,16 @@ #include "util.h" #include "copybook.h" +// GLOB_BRACE and GLOB_TILDE are BSD extensions. Provide fallback definitions +// if necessary. +#ifndef GLOB_BRACE +#define GLOB_BRACE 0 +#endif + +#ifndef GLOB_TILDE +#define GLOB_TILDE 0 +#endif + #define COUNT_OF(X) (sizeof(X) / sizeof(X[0])) /* diff --git a/gcc/cobol/dts.h b/gcc/cobol/dts.h index c345dc7..dfd7c4c 100644 --- a/gcc/cobol/dts.h +++ b/gcc/cobol/dts.h @@ -33,7 +33,8 @@ namespace dts { : input(input) , first(NULL), second(NULL), matched(false) { - static regmatch_t empty = { -1, -1 }; + static regmatch_t empty; + empty.rm_so = empty.rm_eo = -1; regmatch_t& self(*this); self = empty; } diff --git a/gcc/cobol/symbols.h b/gcc/cobol/symbols.h index adfa8d9..50c5d48 100644 --- a/gcc/cobol/symbols.h +++ b/gcc/cobol/symbols.h @@ -46,6 +46,11 @@ #include <string> #include <vector> +// Provide fallback definition. +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif + #define PICTURE_MAX 64 extern const char *numed_message; diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 0233e1a..ca14eb9 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -327,6 +327,7 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"zalrsc", ISA_SPEC_CLASS_NONE, 1, 0}, {"zabha", ISA_SPEC_CLASS_NONE, 1, 0}, {"zacas", ISA_SPEC_CLASS_NONE, 1, 0}, + {"zama16b", ISA_SPEC_CLASS_NONE, 1, 0}, {"zba", ISA_SPEC_CLASS_NONE, 1, 0}, {"zbb", ISA_SPEC_CLASS_NONE, 1, 0}, @@ -1657,6 +1658,7 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = RISCV_EXT_FLAG_ENTRY ("zalrsc", x_riscv_za_subext, MASK_ZALRSC), RISCV_EXT_FLAG_ENTRY ("zabha", x_riscv_za_subext, MASK_ZABHA), RISCV_EXT_FLAG_ENTRY ("zacas", x_riscv_za_subext, MASK_ZACAS), + RISCV_EXT_FLAG_ENTRY ("zama16b", x_riscv_za_subext, MASK_ZAMA16B), RISCV_EXT_FLAG_ENTRY ("zba", x_riscv_zb_subext, MASK_ZBA), RISCV_EXT_FLAG_ENTRY ("zbb", x_riscv_zb_subext, MASK_ZBB), diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index c83c35c..c935e7b 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -1055,6 +1055,7 @@ void aarch64_subvti_scratch_regs (rtx, rtx, rtx *, rtx *, rtx *, rtx *); void aarch64_expand_subvti (rtx, rtx, rtx, rtx, rtx, rtx, rtx, bool); +int aarch64_exact_log2_inverse (unsigned int, rtx); /* Initialize builtins for SIMD intrinsics. */ diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index e2afe87..1099e74 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -1193,12 +1193,14 @@ (define_insn "aarch64_simd_vec_set_zero<mode>" [(set (match_operand:VALL_F16 0 "register_operand" "=w") (vec_merge:VALL_F16 - (match_operand:VALL_F16 1 "aarch64_simd_imm_zero" "") - (match_operand:VALL_F16 3 "register_operand" "0") + (match_operand:VALL_F16 1 "register_operand" "0") + (match_operand:VALL_F16 3 "aarch64_simd_imm_zero" "") (match_operand:SI 2 "immediate_operand" "i")))] - "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0" + "TARGET_SIMD && aarch64_exact_log2_inverse (<nunits>, operands[2]) >= 0" { - int elt = ENDIAN_LANE_N (<nunits>, exact_log2 (INTVAL (operands[2]))); + int elt = ENDIAN_LANE_N (<nunits>, + aarch64_exact_log2_inverse (<nunits>, + operands[2])); operands[2] = GEN_INT ((HOST_WIDE_INT) 1 << elt); return "ins\\t%0.<Vetype>[%p2], <vwcore>zr"; } diff --git a/gcc/config/aarch64/aarch64-sve.md b/gcc/config/aarch64/aarch64-sve.md index f39af6e..bf7569f 100644 --- a/gcc/config/aarch64/aarch64-sve.md +++ b/gcc/config/aarch64/aarch64-sve.md @@ -702,6 +702,23 @@ } ) +;; Fold predicated loads/stores with a PTRUE predicate to unpredicated +;; loads/stores after RA. +(define_insn_and_split "*aarch64_sve_ptrue<mode>_ldr_str" + [(set (match_operand:SVE_FULL 0 "aarch64_sve_nonimmediate_operand" "=Utr,w") + (unspec:SVE_FULL + [(match_operand:<VPRED> 1 "aarch64_simd_imm_one") + (match_operand:SVE_FULL 2 "aarch64_sve_nonimmediate_operand" "w,Utr")] + UNSPEC_PRED_X))] + "TARGET_SVE && reload_completed + && (<MODE>mode == VNx16QImode || !BYTES_BIG_ENDIAN) + && ((REG_P (operands[0]) && MEM_P (operands[2])) + || (REG_P (operands[2]) && MEM_P (operands[0])))" + "#" + "&& 1" + [(set (match_dup 0) + (match_dup 2))]) + ;; Unpredicated moves that cannot use LDR and STR, i.e. partial vectors ;; or vectors for which little-endian ordering isn't acceptable. Memory ;; accesses require secondary reloads. @@ -3984,8 +4001,8 @@ (match_operand:SVE_I_SIMD_DI 3 "aarch64_sve_<sve_imm_con>_operand"))] UNSPEC_PRED_X))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , <sve_imm_con> ; * ] # + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , <sve_imm_con> ; * ] # [ w , Upl , 0 , w ; * ] <sve_int_op>\t%Z0.<Vetype>, %1/m, %Z0.<Vetype>, %Z3.<Vetype> [ ?&w , Upl , w , <sve_imm_con> ; yes ] # [ ?&w , Upl , w , w ; yes ] movprfx\t%Z0, %Z2\;<sve_int_op>\t%Z0.<Vetype>, %1/m, %Z0.<Vetype>, %Z3.<Vetype> @@ -4114,8 +4131,8 @@ (match_operand:SVE_I 1 "register_operand") (match_operand:SVE_I 2 "aarch64_sve_add_operand")))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 ; attrs: movprfx ] - [ w , %0 , vsa ; * ] add\t%0.<Vetype>, %0.<Vetype>, #%D2 + {@ [ cons: =0 , %1 , 2 ; attrs: movprfx ] + [ w , 0 , vsa ; * ] add\t%0.<Vetype>, %0.<Vetype>, #%D2 [ w , 0 , vsn ; * ] sub\t%0.<Vetype>, %0.<Vetype>, #%N2 [ w , 0 , vsi ; * ] << aarch64_output_sve_vector_inc_dec ("%0.<Vetype>", operands[2]); [ ?w , w , vsa ; yes ] movprfx\t%0, %1\;add\t%0.<Vetype>, %0.<Vetype>, #%D2 @@ -4333,8 +4350,8 @@ (match_dup 3))] UNSPEC_PRED_X)))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , w ; * ] <su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , w ; * ] <su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } ) @@ -4548,8 +4565,8 @@ MUL_HIGHPART)] UNSPEC_PRED_X))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , w ; * ] <su>mulh\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , w ; * ] <su>mulh\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;<su>mulh\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } ) @@ -4603,8 +4620,8 @@ (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_zero")] UNSPEC_SEL))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ] - [ &w , Upl , %0 , w ] movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ] + [ &w , Upl , 0 , w ] movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ &w , Upl , w , w ] movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } [(set_attr "movprfx" "yes")]) @@ -4748,8 +4765,8 @@ (match_operand:SVE_I 1 "register_operand") (match_operand:SVE_I 2 "aarch64_sve_logical_operand")))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 ; attrs: movprfx ] - [ w , %0 , vsl ; * ] <logical>\t%0.<Vetype>, %0.<Vetype>, #%C2 + {@ [ cons: =0 , %1 , 2 ; attrs: movprfx ] + [ w , 0 , vsl ; * ] <logical>\t%0.<Vetype>, %0.<Vetype>, #%C2 [ ?w , w , vsl ; yes ] movprfx\t%0, %1\;<logical>\t%0.<Vetype>, %0.<Vetype>, #%C2 [ w , w , w ; * ] <logical>\t%0.d, %1.d, %2.d } @@ -5788,8 +5805,8 @@ (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_operand")] SVE_COND_FP_ADD))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 , 4 ; attrs: movprfx ] - [ w , Upl , %0 , vsA , i ; * ] fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 + {@ [ cons: =0 , 1 , %2 , 3 , 4 ; attrs: movprfx ] + [ w , Upl , 0 , vsA , i ; * ] fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 [ w , Upl , 0 , vsN , i ; * ] fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3 [ w , Upl , w , w , Z ; * ] # [ w , Upl , 0 , w , Ui1 ; * ] fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> @@ -6263,8 +6280,8 @@ UNSPEC_COND_FSUB)] UNSPEC_COND_FABS))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , w ; * ] fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , w ; * ] fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } "&& !rtx_equal_p (operands[1], operands[5])" @@ -6286,8 +6303,8 @@ UNSPEC_COND_FSUB)] UNSPEC_COND_FABS))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , w ; * ] fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , w ; * ] fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } ) @@ -6527,8 +6544,8 @@ (match_operand:SVE_FULL_F 3 "aarch64_sve_float_mul_operand")] SVE_COND_FP_MUL))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 , 4 ; attrs: movprfx ] - [ w , Upl , %0 , vsM , i ; * ] fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 + {@ [ cons: =0 , 1 , %2 , 3 , 4 ; attrs: movprfx ] + [ w , Upl , 0 , vsM , i ; * ] fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 [ w , Upl , w , w , Z ; * ] # [ w , Upl , 0 , w , Ui1 ; * ] fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , vsM , i ; yes ] movprfx\t%0, %2\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 @@ -6761,8 +6778,8 @@ (match_operand:SVE_FULL_F 3 "aarch64_sve_float_maxmin_operand")] SVE_COND_FP_MAXMIN))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , vsB ; * ] <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , vsB ; * ] <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 [ w , Upl , 0 , w ; * ] <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , vsB ; yes ] movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> @@ -7070,8 +7087,8 @@ UNSPEC_PRED_X) (match_operand:SVE_I 4 "register_operand")))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 , 4 ; attrs: movprfx ] - [ w , Upl , %0 , w , w ; * ] mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 , 4 ; attrs: movprfx ] + [ w , Upl , 0 , w , w ; * ] mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype> [ w , Upl , w , w , 0 ; * ] mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w , w ; yes ] movprfx\t%0, %4\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> } @@ -7212,8 +7229,8 @@ (match_operand:SVE_I 3 "register_operand"))] UNSPEC_PRED_X)))] "TARGET_SVE" - {@ [ cons: =0 , 1 , 2 , 3 , 4 ; attrs: movprfx ] - [ w , Upl , %0 , w , w ; * ] msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 , 4 ; attrs: movprfx ] + [ w , Upl , 0 , w , w ; * ] msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype> [ w , Upl , w , w , 0 ; * ] mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w , w ; yes ] movprfx\t%0, %4\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> } @@ -7494,8 +7511,8 @@ (match_operand:SVE_FULL_F_BF 4 "register_operand")] SVE_COND_FP_TERNARY))] "TARGET_SVE && (<supports_bf16> || !<is_bf16>)" - {@ [ cons: =0 , 1 , 2 , 3 , 4 ; attrs: movprfx , is_rev ] - [ w , Upl , %w , w , 0 ; * , * ] <b><sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 , 4 ; attrs: movprfx , is_rev ] + [ w , Upl , w , w , 0 ; * , * ] <b><sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> [ w , Upl , 0 , w , w ; * , true ] <b><sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype> [ ?&w , Upl , w , w , w ; yes , * ] movprfx\t%0, %4\;<b><sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype> } diff --git a/gcc/config/aarch64/aarch64-sve2.md b/gcc/config/aarch64/aarch64-sve2.md index 3e08e09..871cf0b 100644 --- a/gcc/config/aarch64/aarch64-sve2.md +++ b/gcc/config/aarch64/aarch64-sve2.md @@ -784,8 +784,8 @@ (match_operand:SVE_FULL_I 2 "register_operand")) (match_operand:SVE_FULL_I 3 "register_operand")))] "TARGET_SVE2p1_OR_SME" - {@ [cons: =0, 1, 2, 3; attrs: movprfx] - [ w, %0, w, w; * ] <su>clamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> + {@ [cons: =0, %1, 2, 3; attrs: movprfx] + [ w, 0, w, w; * ] <su>clamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> [ ?&w, w, w, w; yes ] movprfx\t%0, %1\;<su>clamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> } ) @@ -804,8 +804,8 @@ (match_operand:SVE_FULL_I 3 "register_operand"))] UNSPEC_PRED_X))] "TARGET_SVE2p1_OR_SME" - {@ [cons: =0, 1, 2, 3; attrs: movprfx] - [ w, %0, w, w; * ] # + {@ [cons: =0, %1, 2, 3; attrs: movprfx] + [ w, 0, w, w; * ] # [ ?&w, w, w, w; yes ] # } "&& true" @@ -1373,8 +1373,8 @@ (match_operand:SVE_CLAMP_F 3 "register_operand")] UNSPEC_FMINNM))] "" - {@ [cons: =0, 1, 2, 3; attrs: movprfx] - [ w, %0, w, w; * ] <b>fclamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> + {@ [cons: =0, %1, 2, 3; attrs: movprfx] + [ w, 0, w, w; * ] <b>fclamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> [ ?&w, w, w, w; yes ] movprfx\t%0, %1\;<b>fclamp\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype> } ) @@ -1393,8 +1393,8 @@ (match_operand:SVE_CLAMP_F 3 "register_operand")] UNSPEC_COND_FMINNM))] "" - {@ [cons: =0, 1, 2, 3; attrs: movprfx] - [ w, %0, w, w; * ] # + {@ [cons: =0, %1, 2, 3; attrs: movprfx] + [ w, 0, w, w; * ] # [ ?&w, w, w, w; yes ] # } "&& true" @@ -1626,8 +1626,8 @@ (match_operand:SVE_FULL_I 2 "register_operand")))] UNSPEC_PRED_X))] "TARGET_SVE2" - {@ [ cons: =0 , 1 , 2 ; attrs: movprfx ] - [ w , %0 , w ; * ] nbsl\t%0.d, %0.d, %2.d, %0.d + {@ [ cons: =0 , %1 , 2 ; attrs: movprfx ] + [ w , 0 , w ; * ] nbsl\t%0.d, %0.d, %2.d, %0.d [ ?&w , w , w ; yes ] movprfx\t%0, %1\;nbsl\t%0.d, %0.d, %2.d, %0.d } "&& !CONSTANT_P (operands[3])" @@ -1648,8 +1648,8 @@ (match_operand:SVE_FULL_I 2 "register_operand")))] UNSPEC_PRED_X))] "TARGET_SVE2" - {@ [ cons: =0 , 1 , 2 ; attrs: movprfx ] - [ w , %0 , w ; * ] nbsl\t%0.d, %0.d, %2.d, %2.d + {@ [ cons: =0 , %1 , 2 ; attrs: movprfx ] + [ w , 0 , w ; * ] nbsl\t%0.d, %0.d, %2.d, %2.d [ ?&w , w , w ; yes ] movprfx\t%0, %1\;nbsl\t%0.d, %0.d, %2.d, %2.d } "&& !CONSTANT_P (operands[3])" @@ -2951,8 +2951,8 @@ UNSPEC_COND_FABS)] SVE_COND_SMAXMIN))] "TARGET_FAMINMAX && TARGET_SVE2_OR_SME2" - {@ [ cons: =0 , 1 , 2 , 3 ; attrs: movprfx ] - [ w , Upl , %0 , w ; * ] <faminmax_cond_uns_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> + {@ [ cons: =0 , 1 , %2 , 3 ; attrs: movprfx ] + [ w , Upl , 0 , w ; * ] <faminmax_cond_uns_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> [ ?&w , Upl , w , w ; yes ] movprfx\t%0, %2\;<faminmax_cond_uns_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> } "&& (!rtx_equal_p (operands[1], operands[5]) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 2dc5f4c..9e3f288 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -23914,6 +23914,16 @@ aarch64_strided_registers_p (rtx *operands, unsigned int num_operands, return true; } +/* Return the base 2 logarithm of the bit inverse of OP masked by the lowest + NELTS bits, if OP is a power of 2. Otherwise, returns -1. */ + +int +aarch64_exact_log2_inverse (unsigned int nelts, rtx op) +{ + return exact_log2 ((~INTVAL (op)) + & ((HOST_WIDE_INT_1U << nelts) - 1)); +} + /* Bounds-check lanes. Ensure OPERAND lies between LOW (inclusive) and HIGH (exclusive). */ void diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index c678f7a..5c30484 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -2182,9 +2182,9 @@ "aarch64_mem_pair_offset (operands[4], <MODE>mode) && known_eq (INTVAL (operands[5]), INTVAL (operands[4]) + GET_MODE_SIZE (<MODE>mode))" - {@ [cons: =&0, 1, =2, =3; attrs: type ] - [ rk, 0, r, r; load_<ldpstp_sz>] ldp\t%<w>2, %<w>3, [%0, %4]! - [ rk, 0, w, w; neon_load1_2reg ] ldp\t%<v>2, %<v>3, [%0, %4]! + {@ [cons: =0, 1, =2, =3; attrs: type ] + [ &rk, 0, r, r; load_<ldpstp_sz>] ldp\t%<w>2, %<w>3, [%0, %4]! + [ rk, 0, w, w; neon_load1_2reg ] ldp\t%<v>2, %<v>3, [%0, %4]! } ) @@ -2238,9 +2238,9 @@ INTVAL (operands[4]) + GET_MODE_SIZE (<MODE>mode)) && !reg_overlap_mentioned_p (operands[0], operands[2]) && !reg_overlap_mentioned_p (operands[0], operands[3])" - {@ [cons: =&0, 1, 2, 3; attrs: type ] - [ rk, 0, rYZ, rYZ; store_<ldpstp_sz>] stp\t%<w>2, %<w>3, [%0, %4]! - [ rk, 0, w, w; neon_store1_2reg ] stp\t%<v>2, %<v>3, [%0, %4]! + {@ [cons: =0, 1, 2, 3; attrs: type ] + [ &rk, 0, rYZ, rYZ; store_<ldpstp_sz>] stp\t%<w>2, %<w>3, [%0, %4]! + [ rk, 0, w, w; neon_store1_2reg ] stp\t%<v>2, %<v>3, [%0, %4]! } ) @@ -2486,15 +2486,15 @@ (match_operand:GPI 1 "register_operand") (match_operand:GPI 2 "aarch64_pluslong_operand")))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type , arch ] - [ rk , %rk , I ; alu_imm , * ] add\t%<w>0, %<w>1, %2 - [ rk , rk , r ; alu_sreg , * ] add\t%<w>0, %<w>1, %<w>2 - [ w , w , w ; neon_add , simd ] add\t%<rtn>0<vas>, %<rtn>1<vas>, %<rtn>2<vas> - [ rk , rk , J ; alu_imm , * ] sub\t%<w>0, %<w>1, #%n2 - [ r , rk , Uaa ; multiple , * ] # - [ r , 0 , Uai ; alu_imm , sve ] << aarch64_output_sve_scalar_inc_dec (operands[2]); - [ rk , rk , Uav ; alu_imm , sve ] << aarch64_output_sve_addvl_addpl (operands[2]); - [ rk , rk , UaV ; alu_imm , sme ] << aarch64_output_addsvl_addspl (operands[2]); + {@ [ cons: =0 , %1 , 2 ; attrs: type , arch ] + [ rk , rk , I ; alu_imm , * ] add\t%<w>0, %<w>1, %2 + [ rk , rk , r ; alu_sreg , * ] add\t%<w>0, %<w>1, %<w>2 + [ w , w , w ; neon_add , simd ] add\t%<rtn>0<vas>, %<rtn>1<vas>, %<rtn>2<vas> + [ rk , rk , J ; alu_imm , * ] sub\t%<w>0, %<w>1, #%n2 + [ r , rk , Uaa ; multiple , * ] # + [ r , 0 , Uai ; alu_imm , sve ] << aarch64_output_sve_scalar_inc_dec (operands[2]); + [ rk , rk , Uav ; alu_imm , sve ] << aarch64_output_sve_addvl_addpl (operands[2]); + [ rk , rk , UaV ; alu_imm , sme ] << aarch64_output_addsvl_addspl (operands[2]); } ;; The "alu_imm" types for INC/DEC and ADDVL/ADDPL are just placeholders. ) @@ -2507,11 +2507,11 @@ (plus:SI (match_operand:SI 1 "register_operand") (match_operand:SI 2 "aarch64_pluslong_operand"))))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ rk , %rk , I ; alu_imm ] add\t%w0, %w1, %2 - [ rk , rk , r ; alu_sreg ] add\t%w0, %w1, %w2 - [ rk , rk , J ; alu_imm ] sub\t%w0, %w1, #%n2 - [ r , rk , Uaa ; multiple ] # + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ rk , rk , I ; alu_imm ] add\t%w0, %w1, %2 + [ rk , rk , r ; alu_sreg ] add\t%w0, %w1, %w2 + [ rk , rk , J ; alu_imm ] sub\t%w0, %w1, #%n2 + [ r , rk , Uaa ; multiple ] # } ) @@ -2580,14 +2580,14 @@ (match_operand:GPI 1 "register_operand") (match_operand:GPI 2 "aarch64_pluslong_or_poly_operand")))] "TARGET_SVE && operands[0] != stack_pointer_rtx" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %rk , I ; alu_imm ] add\t%<w>0, %<w>1, %2 - [ r , rk , r ; alu_sreg ] add\t%<w>0, %<w>1, %<w>2 - [ r , rk , J ; alu_imm ] sub\t%<w>0, %<w>1, #%n2 - [ r , rk , Uaa ; multiple ] # - [ r , 0 , Uai ; alu_imm ] << aarch64_output_sve_scalar_inc_dec (operands[2]); - [ r , rk , Uav ; alu_imm ] << aarch64_output_sve_addvl_addpl (operands[2]); - [ &r , rk , Uat ; multiple ] # + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , rk , I ; alu_imm ] add\t%<w>0, %<w>1, %2 + [ r , rk , r ; alu_sreg ] add\t%<w>0, %<w>1, %<w>2 + [ r , rk , J ; alu_imm ] sub\t%<w>0, %<w>1, #%n2 + [ r , rk , Uaa ; multiple ] # + [ r , 0 , Uai ; alu_imm ] << aarch64_output_sve_scalar_inc_dec (operands[2]); + [ r , rk , Uav ; alu_imm ] << aarch64_output_sve_addvl_addpl (operands[2]); + [ &r , rk , Uat ; multiple ] # } "&& epilogue_completed && !reg_overlap_mentioned_p (operands[0], operands[1]) @@ -2759,10 +2759,10 @@ (set (match_operand:GPI 0 "register_operand") (plus:GPI (match_dup 1) (match_dup 2)))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %rk , r ; alus_sreg ] adds\t%<w>0, %<w>1, %<w>2 - [ r , rk , I ; alus_imm ] adds\t%<w>0, %<w>1, %2 - [ r , rk , J ; alus_imm ] subs\t%<w>0, %<w>1, #%n2 + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , rk , r ; alus_sreg ] adds\t%<w>0, %<w>1, %<w>2 + [ r , rk , I ; alus_imm ] adds\t%<w>0, %<w>1, %2 + [ r , rk , J ; alus_imm ] subs\t%<w>0, %<w>1, #%n2 } ) @@ -2776,10 +2776,10 @@ (set (match_operand:DI 0 "register_operand") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %rk , r ; alus_sreg ] adds\t%w0, %w1, %w2 - [ r , rk , I ; alus_imm ] adds\t%w0, %w1, %2 - [ r , rk , J ; alus_imm ] subs\t%w0, %w1, #%n2 + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , rk , r ; alus_sreg ] adds\t%w0, %w1, %w2 + [ r , rk , I ; alus_imm ] adds\t%w0, %w1, %2 + [ r , rk , J ; alus_imm ] subs\t%w0, %w1, #%n2 } ) @@ -2980,10 +2980,10 @@ (match_operand:GPI 1 "aarch64_plus_operand")) (const_int 0)))] "" - {@ [ cons: 0 , 1 ; attrs: type ] - [ %r , r ; alus_sreg ] cmn\t%<w>0, %<w>1 - [ r , I ; alus_imm ] cmn\t%<w>0, %1 - [ r , J ; alus_imm ] cmp\t%<w>0, #%n1 + {@ [ cons: %0 , 1 ; attrs: type ] + [ r , r ; alus_sreg ] cmn\t%<w>0, %<w>1 + [ r , I ; alus_imm ] cmn\t%<w>0, %1 + [ r , J ; alus_imm ] cmp\t%<w>0, #%n1 } ) @@ -5091,8 +5091,8 @@ (LOGICAL:GPI (match_operand:GPI 1 "register_operand") (match_operand:GPI 2 "aarch64_logical_operand")))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type , arch ] - [ r , %r , r ; logic_reg , * ] <logical>\t%<w>0, %<w>1, %<w>2 + {@ [ cons: =0 , %1 , 2 ; attrs: type , arch ] + [ r , r , r ; logic_reg , * ] <logical>\t%<w>0, %<w>1, %<w>2 [ rk , r , <lconst> ; logic_imm , * ] <logical>\t%<w>0, %<w>1, %2 [ w , 0 , <lconst> ; * , sve ] <logical>\t%Z0.<s>, %Z0.<s>, #%2 [ w , w , w ; neon_logic , simd ] <logical>\t%0.<Vbtype>, %1.<Vbtype>, %2.<Vbtype> @@ -5106,8 +5106,8 @@ (LOGICAL:SI (match_operand:SI 1 "register_operand") (match_operand:SI 2 "aarch64_logical_operand"))))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %r , r ; logic_reg ] <logical>\t%w0, %w1, %w2 + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , r , r ; logic_reg ] <logical>\t%w0, %w1, %w2 [ rk , r , K ; logic_imm ] <logical>\t%w0, %w1, %2 } ) @@ -5121,8 +5121,8 @@ (set (match_operand:GPI 0 "register_operand") (and:GPI (match_dup 1) (match_dup 2)))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %r , r ; logics_reg ] ands\t%<w>0, %<w>1, %<w>2 + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , r , r ; logics_reg ] ands\t%<w>0, %<w>1, %<w>2 [ r , r , <lconst> ; logics_imm ] ands\t%<w>0, %<w>1, %2 } ) @@ -5137,8 +5137,8 @@ (set (match_operand:DI 0 "register_operand") (zero_extend:DI (and:SI (match_dup 1) (match_dup 2))))] "" - {@ [ cons: =0 , 1 , 2 ; attrs: type ] - [ r , %r , r ; logics_reg ] ands\t%w0, %w1, %w2 + {@ [ cons: =0 , %1 , 2 ; attrs: type ] + [ r , r , r ; logics_reg ] ands\t%w0, %w1, %w2 [ r , r , K ; logics_imm ] ands\t%w0, %w1, %2 } ) @@ -5722,9 +5722,9 @@ (match_operand:GPI 1 "aarch64_logical_operand")) (const_int 0)))] "" - {@ [ cons: 0 , 1 ; attrs: type ] - [ %r , r ; logics_reg ] tst\t%<w>0, %<w>1 - [ r , <lconst> ; logics_imm ] tst\t%<w>0, %1 + {@ [ cons: %0 , 1 ; attrs: type ] + [ r , r ; logics_reg ] tst\t%<w>0, %<w>1 + [ r , <lconst> ; logics_imm ] tst\t%<w>0, %1 } ) diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index d587d25..743cc38 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -28,16 +28,15 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_SEH #define TARGET_SEH (TARGET_64BIT_MS_ABI && flag_unwind_tables) +#undef PREFERRED_STACK_BOUNDARY_DEFAULT +#define PREFERRED_STACK_BOUNDARY_DEFAULT \ + (TARGET_64BIT ? 128 : MIN_STACK_BOUNDARY) + /* Win64 with SEH cannot represent DRAP stack frames. Disable its use. Force the use of different mechanisms to allocate aligned local data. */ #undef MAX_STACK_ALIGNMENT #define MAX_STACK_ALIGNMENT (TARGET_SEH ? 128 : MAX_OFILE_ALIGNMENT) -/* 32-bit Windows aligns the stack on a 4-byte boundary but SSE instructions - may require 16-byte alignment. */ -#undef STACK_REALIGN_DEFAULT -#define STACK_REALIGN_DEFAULT (TARGET_64BIT ? 0 : 1) - /* Support hooks for SEH. */ #undef TARGET_ASM_UNWIND_EMIT #define TARGET_ASM_UNWIND_EMIT i386_pe_seh_unwind_emit diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index fd36ea8..9c24a92 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -7942,6 +7942,15 @@ ix86_update_stack_boundary (void) if (ix86_tls_descriptor_calls_expanded_in_cfun && crtl->preferred_stack_boundary < 128) crtl->preferred_stack_boundary = 128; + + /* For 32-bit MS ABI, both the incoming and preferred stack boundaries + are 32 bits, but if force_align_arg_pointer is specified, it should + prefer 128 bits for a backward-compatibility reason, which is also + what the doc suggests. */ + if (lookup_attribute ("force_align_arg_pointer", + TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))) + && crtl->preferred_stack_boundary < 128) + crtl->preferred_stack_boundary = 128; } /* Handle the TARGET_GET_DRAP_RTX hook. Return NULL if no DRAP is diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 95df533..c226c39 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -1222,7 +1222,7 @@ we can't keep it in 64 bit variable.) then use clmul instruction to implement the CRC, otherwise (TARGET_ZBKB) generate table based using brev. */ - if ((TARGET_ZBKC || TARGET_ZBC) && <ANYI:MODE>mode < word_mode) + if ((TARGET_ZBKC || TARGET_ZBC || TARGET_ZVBC) && <ANYI:MODE>mode < word_mode) expand_reversed_crc_using_clmul (<ANYI:MODE>mode, <ANYI1:MODE>mode, operands); else if (TARGET_ZBKB) @@ -1254,7 +1254,8 @@ (match_operand:SUBX 3)] UNSPEC_CRC))] /* We don't support the case when data's size is bigger than CRC's size. */ - "(TARGET_ZBKC || TARGET_ZBC) && <SUBX:MODE>mode >= <SUBX1:MODE>mode" + "(TARGET_ZBKC || TARGET_ZBC || TARGET_ZVBC) + && <SUBX:MODE>mode >= <SUBX1:MODE>mode" { /* If we have the ZBC or ZBKC extension (ie, clmul) and it is possible to store the quotient within a single variable diff --git a/gcc/config/riscv/iterators.md b/gcc/config/riscv/iterators.md index 214c20b..584b345 100644 --- a/gcc/config/riscv/iterators.md +++ b/gcc/config/riscv/iterators.md @@ -262,6 +262,9 @@ (define_code_attr fix_uns [(fix "fix") (unsigned_fix "fixuns")]) +(define_code_attr OPTAB [(ior "IOR") + (xor "XOR")]) + ;; ------------------------------------------------------------------- ;; Code Attributes diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md index c9a638c..23690792 100644 --- a/gcc/config/riscv/predicates.md +++ b/gcc/config/riscv/predicates.md @@ -380,14 +380,6 @@ (and (match_code "const_int") (match_test "SINGLE_BIT_MASK_OPERAND (UINTVAL (op))"))) -;; Register, small constant or single bit constant for use in -;; bseti/binvi. -(define_predicate "arith_or_zbs_operand" - (ior (match_operand 0 "const_arith_operand") - (match_operand 0 "register_operand") - (and (match_test "TARGET_ZBS") - (match_operand 0 "single_bit_mask_operand")))) - (define_predicate "not_single_bit_mask_operand" (and (match_code "const_int") (match_test "SINGLE_BIT_MASK_OPERAND (~UINTVAL (op))"))) @@ -689,3 +681,7 @@ (define_predicate "bitpos_mask_operand" (and (match_code "const_int") (match_test "TARGET_64BIT ? INTVAL (op) == 63 : INTVAL (op) == 31"))) + +(define_predicate "reg_or_const_int_operand" + (ior (match_operand 0 "const_int_operand") + (match_operand 0 "register_operand"))) diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index b0d5bbb..271a9a3 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -140,6 +140,7 @@ extern void riscv_expand_sssub (rtx, rtx, rtx); extern void riscv_expand_ustrunc (rtx, rtx); extern void riscv_expand_sstrunc (rtx, rtx); extern int riscv_register_move_cost (machine_mode, reg_class_t, reg_class_t); +extern bool synthesize_ior_xor (rtx_code, rtx [3]); #ifdef RTX_CODE extern void riscv_expand_int_scc (rtx, enum rtx_code, rtx, rtx, bool *invert_ptr = 0); diff --git a/gcc/config/riscv/riscv-vect-permconst.cc b/gcc/config/riscv/riscv-vect-permconst.cc index feecc7e..8e13cf8 100644 --- a/gcc/config/riscv/riscv-vect-permconst.cc +++ b/gcc/config/riscv/riscv-vect-permconst.cc @@ -203,6 +203,24 @@ vector_permconst::process_bb (basic_block bb) if (bias < 0 || bias > 16384 / 8) continue; + /* We need to verify that each element would be a valid value + in the inner mode after applying the bias. */ + machine_mode inner = GET_MODE_INNER (GET_MODE (cvec)); + HOST_WIDE_INT precision = GET_MODE_PRECISION (inner).to_constant (); + int i; + for (i = 0; i < CONST_VECTOR_NUNITS (cvec).to_constant (); i++) + { + HOST_WIDE_INT val = INTVAL (CONST_VECTOR_ELT (cvec, i)) - bias; + if (val != sext_hwi (val, precision)) + break; + } + + /* If the loop terminated early, then we found a case where the + adjusted constant would not fit, so we can't record the constant + for this case (it's unlikely to be useful anyway. */ + if (i != CONST_VECTOR_NUNITS (cvec).to_constant ()) + continue; + /* At this point we have a load of a constant integer vector from the constant pool. That constant integer vector is hopefully a permutation constant. We need to make a copy of the vector and @@ -211,7 +229,7 @@ vector_permconst::process_bb (basic_block bb) XXX This violates structure sharing conventions. */ rtvec_def *nvec = gen_rtvec (CONST_VECTOR_NUNITS (cvec).to_constant ()); - for (int i = 0; i < CONST_VECTOR_NUNITS (cvec).to_constant (); i++) + for (i = 0; i < CONST_VECTOR_NUNITS (cvec).to_constant (); i++) nvec->elem[i] = GEN_INT (INTVAL (CONST_VECTOR_ELT (cvec, i)) - bias); rtx copy = gen_rtx_CONST_VECTOR (GET_MODE (cvec), nvec); diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 3ee88db..8b77a35 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -14035,17 +14035,53 @@ expand_crc_using_clmul (scalar_mode crc_mode, scalar_mode data_mode, rtx data = gen_rtx_ZERO_EXTEND (word_mode, operands[2]); riscv_expand_op (XOR, word_mode, a0, crc, data); - if (TARGET_64BIT) - emit_insn (gen_riscv_clmul_di (a0, a0, t0)); - else - emit_insn (gen_riscv_clmul_si (a0, a0, t0)); + if (TARGET_ZBKC || TARGET_ZBC) + { + if (TARGET_64BIT) + emit_insn (gen_riscv_clmul_di (a0, a0, t0)); + else + emit_insn (gen_riscv_clmul_si (a0, a0, t0)); - riscv_expand_op (LSHIFTRT, word_mode, a0, a0, - gen_int_mode (crc_size, word_mode)); - if (TARGET_64BIT) - emit_insn (gen_riscv_clmul_di (a0, a0, t1)); + riscv_expand_op (LSHIFTRT, word_mode, a0, a0, + gen_int_mode (crc_size, word_mode)); + if (TARGET_64BIT) + emit_insn (gen_riscv_clmul_di (a0, a0, t1)); + else + emit_insn (gen_riscv_clmul_si (a0, a0, t1)); + } else - emit_insn (gen_riscv_clmul_si (a0, a0, t1)); + { + machine_mode vmode; + if (!riscv_vector::get_vector_mode (DImode, 1).exists (&vmode)) + gcc_unreachable (); + + rtx vec = gen_reg_rtx (vmode); + + insn_code icode1 = code_for_pred_broadcast (vmode); + rtx ops1[] = {vec, a0}; + emit_nonvlmax_insn (icode1, UNARY_OP, ops1, CONST1_RTX (Pmode)); + + rtx rvv1di_reg = gen_rtx_SUBREG (RVVM1DImode, vec, 0); + insn_code icode2 = code_for_pred_vclmul_scalar (UNSPEC_VCLMUL, + E_RVVM1DImode); + rtx ops2[] = {rvv1di_reg, rvv1di_reg, t0}; + emit_nonvlmax_insn (icode2, riscv_vector::BINARY_OP, ops2, CONST1_RTX + (Pmode)); + + rtx shift_amount = gen_int_mode (data_size, Pmode); + insn_code icode3 = code_for_pred_scalar (LSHIFTRT, vmode); + rtx ops3[] = {vec, vec, shift_amount}; + emit_nonvlmax_insn (icode3, BINARY_OP, ops3, CONST1_RTX (Pmode)); + + insn_code icode4 = code_for_pred_vclmul_scalar (UNSPEC_VCLMULH, + E_RVVM1DImode); + rtx ops4[] = {rvv1di_reg, rvv1di_reg, t1}; + emit_nonvlmax_insn (icode4, riscv_vector::BINARY_OP, ops4, CONST1_RTX + (Pmode)); + + rtx vec_low_lane = gen_lowpart (DImode, vec); + riscv_emit_move (a0, vec_low_lane); + } if (crc_size > data_size) { @@ -14094,19 +14130,53 @@ expand_reversed_crc_using_clmul (scalar_mode crc_mode, scalar_mode data_mode, rtx a0 = gen_reg_rtx (word_mode); riscv_expand_op (XOR, word_mode, a0, crc, data); - if (TARGET_64BIT) - emit_insn (gen_riscv_clmul_di (a0, a0, t0)); - else - emit_insn (gen_riscv_clmul_si (a0, a0, t0)); + if (TARGET_ZBKC || TARGET_ZBC) + { + if (TARGET_64BIT) + emit_insn (gen_riscv_clmul_di (a0, a0, t0)); + else + emit_insn (gen_riscv_clmul_si (a0, a0, t0)); - rtx num_shift = gen_int_mode (GET_MODE_BITSIZE (word_mode) - data_size, - word_mode); - riscv_expand_op (ASHIFT, word_mode, a0, a0, num_shift); + rtx num_shift = gen_int_mode (BITS_PER_WORD - data_size, word_mode); + riscv_expand_op (ASHIFT, word_mode, a0, a0, num_shift); - if (TARGET_64BIT) - emit_insn (gen_riscv_clmulh_di (a0, a0, t1)); + if (TARGET_64BIT) + emit_insn (gen_riscv_clmulh_di (a0, a0, t1)); + else + emit_insn (gen_riscv_clmulh_si (a0, a0, t1)); + } else - emit_insn (gen_riscv_clmulh_si (a0, a0, t1)); + { + machine_mode vmode; + if (!riscv_vector::get_vector_mode (DImode, 1).exists (&vmode)) + gcc_unreachable (); + + rtx vec = gen_reg_rtx (vmode); + insn_code icode1 = code_for_pred_broadcast (vmode); + rtx ops1[] = {vec, a0}; + emit_nonvlmax_insn (icode1, UNARY_OP, ops1, CONST1_RTX (Pmode)); + + rtx rvv1di_reg = gen_rtx_SUBREG (RVVM1DImode, vec, 0); + insn_code icode2 = code_for_pred_vclmul_scalar (UNSPEC_VCLMUL, + E_RVVM1DImode); + rtx ops2[] = {rvv1di_reg, rvv1di_reg, t0}; + emit_nonvlmax_insn (icode2, riscv_vector::BINARY_OP, ops2, CONST1_RTX + (Pmode)); + + rtx shift_amount = gen_int_mode (BITS_PER_WORD - data_size, Pmode); + insn_code icode3 = code_for_pred_scalar (ASHIFT, vmode); + rtx ops3[] = {vec, vec, shift_amount}; + emit_nonvlmax_insn (icode3, BINARY_OP, ops3, CONST1_RTX (Pmode)); + + insn_code icode4 = code_for_pred_vclmul_scalar (UNSPEC_VCLMULH, + E_RVVM1DImode); + rtx ops4[] = {rvv1di_reg, rvv1di_reg, t1}; + emit_nonvlmax_insn (icode4, riscv_vector::BINARY_OP, ops4, CONST1_RTX + (Pmode)); + + rtx vec_low_lane = gen_lowpart (DImode, vec); + riscv_emit_move (a0, vec_low_lane); + } if (crc_size > data_size) { @@ -14140,6 +14210,205 @@ bool need_shadow_stack_push_pop_p () return is_zicfiss_p () && riscv_save_return_addr_reg_p (); } +/* Synthesize OPERANDS[0] = OPERANDS[1] CODE OPERANDS[2]. + + OPERANDS[0] and OPERANDS[1] will be a REG and may be the same + REG. + + OPERANDS[2] is a CONST_INT. + + CODE is IOR or XOR. + + Return TRUE if the operation was fully synthesized and the caller + need not generate additional code. Return FALSE if the operation + was not synthesized and the caller is responsible for emitting the + proper sequence. */ + +bool +synthesize_ior_xor (rtx_code code, rtx operands[3]) +{ + /* Trivial cases that don't need synthesis. */ + if (SMALL_OPERAND (INTVAL (operands[2])) + || ((TARGET_ZBS || TARGET_XTHEADBS || TARGET_ZBKB) + && single_bit_mask_operand (operands[2], word_mode))) + return false; + + /* The number of instructions to synthesize the constant is a good + estimate of the budget. That does not account for out of order + execution an fusion in the constant synthesis those would naturally + decrease the budget. It also does not account for the IOR/XOR at + the end of the sequence which would increase the budget. */ + int budget = (TARGET_ZBS ? riscv_const_insns (operands[2], true) : -1); + int original_budget = budget; + + /* Bits we need to set in operands[0]. As we synthesize the operation, + we clear bits in IVAL. Once IVAL is zero, then synthesis of the + operation is complete. */ + unsigned HOST_WIDE_INT ival = INTVAL (operands[2]); + + /* Check if we want to use [x]ori. Then get the remaining bits + and decrease the budget by one. */ + if ((ival & HOST_WIDE_INT_UC (0x7ff)) != 0) + { + ival &= ~HOST_WIDE_INT_UC (0x7ff); + budget--; + } + + /* Check for bseti cases. For each remaining bit in ival, + decrease the budget by one. */ + while (ival) + { + HOST_WIDE_INT tmpval = HOST_WIDE_INT_UC (1) << ctz_hwi (ival); + ival &= ~tmpval; + budget--; + } + + /* If we're flipping all but a small number of bits we can pre-flip + the outliers, then flip all the bits, which would restore those + bits that were pre-flipped. */ + if ((TARGET_ZBS || TARGET_XTHEADBS || TARGET_ZBKB) + && budget < 0 + && code == XOR + && popcount_hwi (~INTVAL (operands[2])) < original_budget) + { + /* Pre-flipping bits we want to preserve. */ + rtx input = operands[1]; + ival = ~INTVAL (operands[2]); + while (ival) + { + HOST_WIDE_INT tmpval = HOST_WIDE_INT_UC (1) << ctz_hwi (ival); + rtx x = GEN_INT (tmpval); + x = gen_rtx_XOR (word_mode, input, x); + emit_insn (gen_rtx_SET (operands[0], x)); + input = operands[0]; + ival &= ~tmpval; + } + + /* Now flip all the bits, which restores the bits we were + preserving. */ + rtx x = gen_rtx_NOT (word_mode, input); + emit_insn (gen_rtx_SET (operands[0], x)); + return true; + } + + /* One more approach we can try. If our budget is 3+ instructions, + then we can try to rotate the source so that the bits we want to + set are in the low 11 bits. We then use [x]ori to set those low + bits, then rotate things back into their proper place. */ + if ((TARGET_ZBB || TARGET_XTHEADBB || TARGET_ZBKB) + && budget < 0 + && popcount_hwi (INTVAL (operands[2])) <= 11 + && riscv_const_insns (operands[2], true) >= 3) + { + ival = INTVAL (operands[2]); + /* First see if the constant trivially fits into 11 bits in the LSB. */ + int lsb = ctz_hwi (ival); + int msb = BITS_PER_WORD - 1 - clz_hwi (ival); + if (msb - lsb + 1 <= 11) + { + /* Rotate the source right by LSB bits. */ + rtx x = GEN_INT (lsb); + x = gen_rtx_ROTATERT (word_mode, operands[1], x); + emit_insn (gen_rtx_SET (operands[0], x)); + + /* Shift the constant right by LSB bits. */ + x = GEN_INT (ival >> lsb); + + /* Perform the IOR/XOR operation. */ + x = gen_rtx_fmt_ee (code, word_mode, operands[0], x); + emit_insn (gen_rtx_SET (operands[0], x)); + + /* And rotate left to put everything back in place, we don't + have rotate left by a constant, so use rotate right by + an adjusted constant. */ + x = GEN_INT (BITS_PER_WORD - lsb); + x = gen_rtx_ROTATERT (word_mode, operands[1], x); + emit_insn (gen_rtx_SET (operands[0], x)); + return true; + } + + /* Maybe the bits are split between the high and low parts + of the constant. A bit more complex, but still manageable. + + Conceptually we want to rotate left the constant by the number + of leading zeros after masking off all but the low 11 bits. */ + int rotcount = clz_hwi (ival & 0x7ff) - (BITS_PER_WORD - 11); + + /* Rotate the constant left by MSB bits. */ + ival = (ival << rotcount) | (ival >> (BITS_PER_WORD - rotcount)); + + /* Now we can do the same tests as before. */ + lsb = ctz_hwi (ival); + msb = BITS_PER_WORD - clz_hwi (ival); + if ((INTVAL (operands[2]) & HOST_WIDE_INT_UC (0x7ff)) != 0 + && msb - lsb + 1 <= 11) + { + /* Rotate the source left by ROTCOUNT bits, we don't have + rotate left by a constant, so use rotate right by an + adjusted constant. */ + rtx x = GEN_INT (BITS_PER_WORD - rotcount); + x = gen_rtx_ROTATERT (word_mode, operands[1], x); + emit_insn (gen_rtx_SET (operands[0], x)); + + /* We've already rotated the constant. So perform the IOR/XOR + operation. */ + x = GEN_INT (ival); + x = gen_rtx_fmt_ee (code, word_mode, operands[0], x); + emit_insn (gen_rtx_SET (operands[0], x)); + + /* And rotate right to put everything into its proper place. */ + x = GEN_INT (rotcount); + x = gen_rtx_ROTATERT (word_mode, operands[0], x); + emit_insn (gen_rtx_SET (operands[0], x)); + return true; + } + } + + /* If after accounting for bseti the remaining budget has + gone to less than zero, it forces the value into a + register and performs the IOR operation. It returns + TRUE to the caller so the caller knows code generation + is complete. */ + if (budget < 0) + { + rtx x = force_reg (word_mode, operands[2]); + x = gen_rtx_fmt_ee (code, word_mode, operands[1], x); + emit_insn (gen_rtx_SET (operands[0], x)); + return true; + } + + /* Synthesis is better than loading the constant. */ + ival = INTVAL (operands[2]); + rtx input = operands[1]; + + /* Emit the [x]ori insn that sets the low 11 bits into + the proper state. */ + if ((ival & HOST_WIDE_INT_UC (0x7ff)) != 0) + { + rtx x = GEN_INT (ival & HOST_WIDE_INT_UC (0x7ff)); + x = gen_rtx_fmt_ee (code, word_mode, input, x); + emit_insn (gen_rtx_SET (operands[0], x)); + input = operands[0]; + ival &= ~HOST_WIDE_INT_UC (0x7ff); + } + + /* We figure out a single bit as a constant and + generate a CONST_INT node for that. Then we + construct the IOR node, then the SET node and + emit it. An IOR with a suitable constant that is + a single bit will be implemented with a bseti. */ + while (ival) + { + HOST_WIDE_INT tmpval = HOST_WIDE_INT_UC (1) << ctz_hwi (ival); + rtx x = GEN_INT (tmpval); + x = gen_rtx_fmt_ee (code, word_mode, input, x); + emit_insn (gen_rtx_SET (operands[0], x)); + input = operands[0]; + ival &= ~tmpval; + } + return true; +} + /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 259997f..154b49d 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -1767,8 +1767,15 @@ (define_expand "<optab><mode>3" [(set (match_operand:X 0 "register_operand") (any_or:X (match_operand:X 1 "register_operand" "") - (match_operand:X 2 "arith_or_zbs_operand" "")))] - "") + (match_operand:X 2 "reg_or_const_int_operand" "")))] + "" + +{ + /* If synthesis of the logical op is successful, then no further code + generation is necessary. Else just generate code normally. */ + if (CONST_INT_P (operands[2]) && synthesize_ior_xor (<OPTAB>, operands)) + DONE; +}) (define_insn "*<optab><mode>3" [(set (match_operand:X 0 "register_operand" "=r,r") diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt index 9e471be..80593ee 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -274,6 +274,8 @@ Mask(ZA64RS) Var(riscv_za_subext) Mask(ZA128RS) Var(riscv_za_subext) +Mask(ZAMA16B) Var(riscv_za_subext) + TargetVariable int riscv_zb_subext diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bcce377..51672a7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,22 @@ +2025-05-09 Jason Merrill <jason@redhat.com> + + * decl2.cc (determine_visibility): Ignore args for friend templates. + +2025-05-09 Jason Merrill <jason@redhat.com> + + PR c++/99599 + PR c++/120185 + * class.cc (type_has_converting_constructor): Handle null parm. + * pt.cc (fn_type_unification): Skip early non-dep checking if + no concepts. + +2025-05-08 Jason Merrill <jason@redhat.com> + + PR c++/99599 + * cp-tree.h (type_has_converting_constructor): Declare. + * class.cc (type_has_converting_constructor): New. + * pt.cc (conversion_may_instantiate_p): Don't check completeness. + 2025-05-05 Simon Martin <simon@nasilyan.com> * cp-tree.h (parsing_default_capturing_generic_lambda_in_template): diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index 6767ac1..2764bb5 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -5724,6 +5724,50 @@ type_has_user_provided_constructor (tree t) return false; } +/* Returns true iff class T has a constructor that accepts a single argument + and does not have a single parameter of type reference to T. + + This does not exclude explicit constructors because they are still + considered for conversions within { } even though choosing one is + ill-formed. */ + +bool +type_has_converting_constructor (tree t) +{ + if (!CLASS_TYPE_P (t)) + return false; + + if (!TYPE_HAS_USER_CONSTRUCTOR (t)) + return false; + + for (ovl_iterator iter (CLASSTYPE_CONSTRUCTORS (t)); iter; ++iter) + { + tree fn = *iter; + tree parm = FUNCTION_FIRST_USER_PARMTYPE (fn); + if (parm == NULL_TREE) + /* Varargs. */ + return true; + if (parm == void_list_node + || !sufficient_parms_p (TREE_CHAIN (parm))) + /* Can't accept a single argument, so won't be considered for + conversion. */ + continue; + if (TREE_CODE (fn) == TEMPLATE_DECL + || TREE_CHAIN (parm) != void_list_node) + /* Not a simple single parameter. */ + return true; + if (TYPE_MAIN_VARIANT (non_reference (TREE_VALUE (parm))) + != DECL_CONTEXT (fn)) + /* The single parameter has the wrong type. */ + return true; + if (get_constraints (fn)) + /* Constrained. */ + return true; + } + + return false; +} + /* Returns true iff class T has a user-provided or explicit constructor. */ bool diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index a42c07a..175ab28 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7056,6 +7056,7 @@ extern tree in_class_defaulted_default_constructor (tree); extern bool user_provided_p (tree); extern bool type_has_user_provided_constructor (tree); extern bool type_has_non_user_provided_default_constructor (tree); +extern bool type_has_converting_constructor (tree); extern bool vbase_has_user_provided_move_assign (tree); extern tree default_init_uninitialized_part (tree); extern bool trivial_default_constructor_is_constexpr (tree); diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 21156f1..15db1d6 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -3160,7 +3160,9 @@ determine_visibility (tree decl) && !attr) { int depth = TMPL_ARGS_DEPTH (args); - if (DECL_VISIBILITY_SPECIFIED (decl)) + if (DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P (TI_TEMPLATE (tinfo))) + /* Class template args don't affect template friends. */; + else if (DECL_VISIBILITY_SPECIFIED (decl)) { /* A class template member with explicit visibility overrides the class visibility, so we need to apply diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 7b296d1..0d64a1c 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -17477,10 +17477,18 @@ tsubst_baselink (tree baselink, tree object_type, if (!baselink) { - if ((complain & tf_error) - && constructor_name_p (name, qualifying_scope)) - error ("cannot call constructor %<%T::%D%> directly", - qualifying_scope, name); + if (complain & tf_error) + { + if (constructor_name_p (name, qualifying_scope)) + error ("cannot call constructor %<%T::%D%> directly", + qualifying_scope, name); + else + /* Lookup succeeded at parse time, but failed during + instantiation; must be because we're trying to refer to it + while forming its declaration (c++/120204). */ + error ("declaration of %<%T::%D%> depends on itself", + qualifying_scope, name); + } return error_mark_node; } @@ -23254,7 +23262,7 @@ fn_type_unification (tree fn, conversions that we know are not going to induce template instantiation (PR99599). */ if (strict == DEDUCE_CALL - && incomplete + && incomplete && flag_concepts && check_non_deducible_conversions (parms, args, nargs, fn, strict, flags, convs, explain_p, /*noninst_only_p=*/true)) @@ -23501,9 +23509,13 @@ maybe_adjust_types_for_deduction (tree tparms, return result; } -/* Return true if computing a conversion from FROM to TO might induce template - instantiation. Conversely, if this predicate returns false then computing - the conversion definitely won't induce template instantiation. */ +/* Return true if computing a conversion from FROM to TO might consider + user-defined conversions, which could lead to arbitrary template + instantiations (e.g. g++.dg/cpp2a/concepts-nondep1.C). If this predicate + returns false then computing the conversion definitely won't try UDCs. + + Note that this restriction parallels LOOKUP_DEFAULTED for CWG1092, but in + this case we want the early filter to pass instead of fail. */ static bool conversion_may_instantiate_p (tree to, tree from) @@ -23511,36 +23523,14 @@ conversion_may_instantiate_p (tree to, tree from) to = non_reference (to); from = non_reference (from); - bool ptr_conv_p = false; - if (TYPE_PTR_P (to) - && TYPE_PTR_P (from)) - { - to = TREE_TYPE (to); - from = TREE_TYPE (from); - ptr_conv_p = true; - } - - /* If one of the types is a not-yet-instantiated class template - specialization, then computing the conversion might instantiate - it in order to inspect bases, conversion functions and/or - converting constructors. */ - if ((CLASS_TYPE_P (to) - && !COMPLETE_TYPE_P (to) - && CLASSTYPE_TEMPLATE_INSTANTIATION (to)) - || (CLASS_TYPE_P (from) - && !COMPLETE_TYPE_P (from) - && CLASSTYPE_TEMPLATE_INSTANTIATION (from))) - return true; - - /* Converting from one pointer type to another, or between - reference-related types, always yields a standard conversion. */ - if (ptr_conv_p || reference_related_p (to, from)) + /* Converting between reference-related types is a standard conversion. */ + if (reference_related_p (to, from)) return false; /* Converting to a non-aggregate class type will consider its user-declared constructors, which might induce instantiation. */ if (CLASS_TYPE_P (to) - && CLASSTYPE_NON_AGGREGATE (to)) + && type_has_converting_constructor (to)) return true; /* Similarly, converting from a class type will consider its conversion @@ -23549,7 +23539,7 @@ conversion_may_instantiate_p (tree to, tree from) && TYPE_HAS_CONVERSION (from)) return true; - /* Otherwise, computing this conversion definitely won't induce + /* Otherwise, computing this conversion won't risk arbitrary template instantiation. */ return false; } diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc b/gcc/diagnostic-format-html.cc index 24c6f8c..2d642df 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc +++ b/gcc/diagnostic-format-html.cc @@ -1,6 +1,5 @@ -/* Verify that we can write a non-trivial diagnostic output format - as a plugin (XHTML). - Copyright (C) 2018-2024 Free Software Foundation, Inc. +/* HTML output for diagnostics. + Copyright (C) 2024-2025 Free Software Foundation, Inc. Contributed by David Malcolm <dmalcolm@redhat.com>. This file is part of GCC. @@ -19,35 +18,21 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ - #include "config.h" -#define INCLUDE_LIST #define INCLUDE_MAP -#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "diagnostic.h" #include "diagnostic-metadata.h" -#include "diagnostic-path.h" -#include "cpplib.h" -#include "logical-location.h" -#include "diagnostic-client-data-hooks.h" -#include "diagnostic-diagram.h" -#include "text-art/canvas.h" #include "diagnostic-format.h" +#include "diagnostic-format-html.h" +#include "diagnostic-output-file.h" #include "diagnostic-buffer.h" -#include "ordered-hash-map.h" -#include "sbitmap.h" #include "selftest.h" #include "selftest-diagnostic.h" -#include "selftest-diagnostic-show-locus.h" -#include "text-range-label.h" #include "pretty-print-format-impl.h" -#include "pretty-print-urlifier.h" #include "intl.h" -#include "gcc-plugin.h" -#include "plugin-version.h" namespace xml { @@ -58,8 +43,6 @@ namespace xml { # pragma GCC diagnostic ignored "-Wformat-diag" #endif -static void write_escaped_text (const char *text); - struct node { virtual ~node () {} @@ -246,17 +229,17 @@ element::set_attr (const char *name, label_text value) } // namespace xml -class xhtml_builder; +class html_builder; /* Concrete buffering implementation subclass for HTML output. */ -class diagnostic_xhtml_format_buffer : public diagnostic_per_format_buffer +class diagnostic_html_format_buffer : public diagnostic_per_format_buffer { public: - friend class xhtml_builder; - friend class xhtml_output_format; + friend class html_builder; + friend class html_output_format; - diagnostic_xhtml_format_buffer (xhtml_builder &builder) + diagnostic_html_format_buffer (html_builder &builder) : m_builder (builder) {} @@ -272,11 +255,11 @@ public: } private: - xhtml_builder &m_builder; + html_builder &m_builder; std::vector<std::unique_ptr<xml::element>> m_results; }; -/* A class for managing XHTML output of diagnostics. +/* A class for managing HTML output of diagnostics. Implemented: - message text @@ -291,18 +274,18 @@ private: - paths */ -class xhtml_builder +class html_builder { public: - friend class diagnostic_xhtml_format_buffer; + friend class diagnostic_html_format_buffer; - xhtml_builder (diagnostic_context &context, + html_builder (diagnostic_context &context, pretty_printer &pp, const line_maps *line_maps); void on_report_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind, - diagnostic_xhtml_format_buffer *buffer); + diagnostic_html_format_buffer *buffer); void emit_diagram (const diagnostic_diagram &diagram); void end_group (); @@ -350,12 +333,12 @@ make_span (label_text class_) return span; } -/* class diagnostic_xhtml_format_buffer : public diagnostic_per_format_buffer. */ +/* class diagnostic_html_format_buffer : public diagnostic_per_format_buffer. */ void -diagnostic_xhtml_format_buffer::dump (FILE *out, int indent) const +diagnostic_html_format_buffer::dump (FILE *out, int indent) const { - fprintf (out, "%*sdiagnostic_xhtml_format_buffer:\n", indent, ""); + fprintf (out, "%*sdiagnostic_html_format_buffer:\n", indent, ""); int idx = 0; for (auto &result : m_results) { @@ -367,40 +350,40 @@ diagnostic_xhtml_format_buffer::dump (FILE *out, int indent) const } bool -diagnostic_xhtml_format_buffer::empty_p () const +diagnostic_html_format_buffer::empty_p () const { return m_results.empty (); } void -diagnostic_xhtml_format_buffer::move_to (diagnostic_per_format_buffer &base) +diagnostic_html_format_buffer::move_to (diagnostic_per_format_buffer &base) { - diagnostic_xhtml_format_buffer &dest - = static_cast<diagnostic_xhtml_format_buffer &> (base); + diagnostic_html_format_buffer &dest + = static_cast<diagnostic_html_format_buffer &> (base); for (auto &&result : m_results) dest.m_results.push_back (std::move (result)); m_results.clear (); } void -diagnostic_xhtml_format_buffer::clear () +diagnostic_html_format_buffer::clear () { m_results.clear (); } void -diagnostic_xhtml_format_buffer::flush () +diagnostic_html_format_buffer::flush () { for (auto &&result : m_results) m_builder.m_diagnostics_element->add_child (std::move (result)); m_results.clear (); } -/* class xhtml_builder. */ +/* class html_builder. */ -/* xhtml_builder's ctor. */ +/* html_builder's ctor. */ -xhtml_builder::xhtml_builder (diagnostic_context &context, +html_builder::html_builder (diagnostic_context &context, pretty_printer &pp, const line_maps *line_maps) : m_context (context), @@ -440,12 +423,12 @@ xhtml_builder::xhtml_builder (diagnostic_context &context, } } -/* Implementation of "on_report_diagnostic" for XHTML output. */ +/* Implementation of "on_report_diagnostic" for HTML output. */ void -xhtml_builder::on_report_diagnostic (const diagnostic_info &diagnostic, - diagnostic_t orig_diag_kind, - diagnostic_xhtml_format_buffer *buffer) +html_builder::on_report_diagnostic (const diagnostic_info &diagnostic, + diagnostic_t orig_diag_kind, + diagnostic_html_format_buffer *buffer) { if (diagnostic.kind == DK_ICE || diagnostic.kind == DK_ICE_NOBT) { @@ -476,13 +459,13 @@ xhtml_builder::on_report_diagnostic (const diagnostic_info &diagnostic, } std::unique_ptr<xml::element> -xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, - diagnostic_t orig_diag_kind) +html_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, + diagnostic_t orig_diag_kind) { - class xhtml_token_printer : public token_printer + class html_token_printer : public token_printer { public: - xhtml_token_printer (xhtml_builder &builder, + html_token_printer (html_builder &builder, xml::element &parent_element) : m_builder (builder) { @@ -557,7 +540,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, m_open_elements.pop_back (); } - xhtml_builder &m_builder; + html_builder &m_builder; /* We maintain a stack of currently "open" elements. Children are added to the topmost open element. */ std::vector<xml::element *> m_open_elements; @@ -568,7 +551,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, // TODO: might be nice to emulate the text output format, but colorize it auto message_span = make_span (label_text::borrow ("gcc-message")); - xhtml_token_printer tok_printer (*this, *message_span.get ()); + html_token_printer tok_printer (*this, *message_span.get ()); m_printer->set_token_printer (&tok_printer); pp_output_formatted_text (m_printer, m_context.get_urlifier ()); m_printer->set_token_printer (nullptr); @@ -642,10 +625,10 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, } /* Implementation of diagnostic_context::m_diagrams.m_emission_cb - for XHTML output. */ + for HTML output. */ void -xhtml_builder::emit_diagram (const diagnostic_diagram &/*diagram*/) +html_builder::emit_diagram (const diagnostic_diagram &/*diagram*/) { /* We must be within the emission of a top-level diagnostic. */ gcc_assert (m_cur_diagnostic_element); @@ -653,10 +636,10 @@ xhtml_builder::emit_diagram (const diagnostic_diagram &/*diagram*/) // TODO } -/* Implementation of "end_group_cb" for XHTML output. */ +/* Implementation of "end_group_cb" for HTML output. */ void -xhtml_builder::end_group () +html_builder::end_group () { if (m_cur_diagnostic_element) m_diagnostics_element->add_child (std::move (m_cur_diagnostic_element)); @@ -668,17 +651,17 @@ xhtml_builder::end_group () Flush it all to OUTF. */ void -xhtml_builder::flush_to_file (FILE *outf) +html_builder::flush_to_file (FILE *outf) { auto top = m_document.get (); top->dump (outf); fprintf (outf, "\n"); } -class xhtml_output_format : public diagnostic_output_format +class html_output_format : public diagnostic_output_format { public: - ~xhtml_output_format () + ~html_output_format () { /* Any diagnostics should have been handled by now. If not, then something's gone wrong with diagnostic @@ -690,19 +673,19 @@ public: void dump (FILE *out, int indent) const override { - fprintf (out, "%*sxhtml_output_format\n", indent, ""); + fprintf (out, "%*shtml_output_format\n", indent, ""); diagnostic_output_format::dump (out, indent); } std::unique_ptr<diagnostic_per_format_buffer> make_per_format_buffer () final override { - return std::make_unique<diagnostic_xhtml_format_buffer> (m_builder); + return std::make_unique<diagnostic_html_format_buffer> (m_builder); } void set_buffer (diagnostic_per_format_buffer *base_buffer) final override { - diagnostic_xhtml_format_buffer *buffer - = static_cast<diagnostic_xhtml_format_buffer *> (base_buffer); + diagnostic_html_format_buffer *buffer + = static_cast<diagnostic_html_format_buffer *> (base_buffer); m_buffer = buffer; } @@ -752,66 +735,39 @@ public: } protected: - xhtml_output_format (diagnostic_context &context, - const line_maps *line_maps) + html_output_format (diagnostic_context &context, + const line_maps *line_maps) : diagnostic_output_format (context), m_builder (context, *get_printer (), line_maps), m_buffer (nullptr) {} - xhtml_builder m_builder; - diagnostic_xhtml_format_buffer *m_buffer; + html_builder m_builder; + diagnostic_html_format_buffer *m_buffer; }; -class xhtml_stream_output_format : public xhtml_output_format +class html_file_output_format : public html_output_format { public: - xhtml_stream_output_format (diagnostic_context &context, - const line_maps *line_maps, - FILE *stream) - : xhtml_output_format (context, line_maps), - m_stream (stream) - { - } - ~xhtml_stream_output_format () + html_file_output_format (diagnostic_context &context, + const line_maps *line_maps, + diagnostic_output_file output_file) + : html_output_format (context, line_maps), + m_output_file (std::move (output_file)) { - m_builder.flush_to_file (m_stream); + gcc_assert (m_output_file.get_open_file ()); + gcc_assert (m_output_file.get_filename ()); } - bool machine_readable_stderr_p () const final override + ~html_file_output_format () { - return m_stream == stderr; + m_builder.flush_to_file (m_output_file.get_open_file ()); } -private: - FILE *m_stream; -}; - -class xhtml_file_output_format : public xhtml_output_format -{ -public: - xhtml_file_output_format (diagnostic_context &context, - const line_maps *line_maps, - const char *base_file_name) - : xhtml_output_format (context, line_maps), - m_base_file_name (xstrdup (base_file_name)) - { - } - ~xhtml_file_output_format () + void dump (FILE *out, int indent) const override { - char *filename = concat (m_base_file_name, ".xhtml", nullptr); - free (m_base_file_name); - m_base_file_name = nullptr; - FILE *outf = fopen (filename, "w"); - if (!outf) - { - const char *errstr = xstrerror (errno); - fnotice (stderr, "error: unable to open '%s' for writing: %s\n", - filename, errstr); - free (filename); - return; - } - m_builder.flush_to_file (outf); - fclose (outf); - free (filename); + fprintf (out, "%*shtml_file_output_format: %s\n", + indent, "", + m_output_file.get_filename ()); + diagnostic_output_format::dump (out, indent); } bool machine_readable_stderr_p () const final override { @@ -819,68 +775,76 @@ public: } private: - char *m_base_file_name; + diagnostic_output_file m_output_file; }; -/* Populate CONTEXT in preparation for XHTML output (either to stderr, or - to a file). */ +/* Attempt to open BASE_FILE_NAME.html for writing. + Return a non-null diagnostic_output_file, + or return a null diagnostic_output_file and complain to CONTEXT + using LINE_MAPS. */ -static void -diagnostic_output_format_init_xhtml (diagnostic_context &context, - std::unique_ptr<xhtml_output_format> fmt) +diagnostic_output_file +diagnostic_output_format_open_html_file (diagnostic_context &context, + line_maps *line_maps, + const char *base_file_name) { - /* Don't colorize the text. */ - pp_show_color (fmt->get_printer ()) = false; - context.set_show_highlight_colors (false); - - context.set_output_format (std::move (fmt)); -} - -/* Populate CONTEXT in preparation for XHTML output to stderr. */ + if (!base_file_name) + { + rich_location richloc (line_maps, UNKNOWN_LOCATION); + context.emit_diagnostic_with_group + (DK_ERROR, richloc, nullptr, 0, + "unable to determine filename for HTML output"); + return diagnostic_output_file (); + } -void -diagnostic_output_format_init_xhtml_stderr (diagnostic_context &context, - const line_maps *line_maps) -{ - gcc_assert (line_maps); - auto format = std::make_unique<xhtml_stream_output_format> (context, - line_maps, - stderr); - diagnostic_output_format_init_xhtml (context, std::move (format)); + label_text filename = label_text::take (concat (base_file_name, + ".html", + nullptr)); + FILE *outf = fopen (filename.get (), "w"); + if (!outf) + { + rich_location richloc (line_maps, UNKNOWN_LOCATION); + context.emit_diagnostic_with_group + (DK_ERROR, richloc, nullptr, 0, + "unable to open %qs for HTML output: %m", + filename.get ()); + return diagnostic_output_file (); + } + return diagnostic_output_file (outf, true, std::move (filename)); } -/* Populate CONTEXT in preparation for XHTML output to a file named - BASE_FILE_NAME.xhtml. */ - -void -diagnostic_output_format_init_xhtml_file (diagnostic_context &context, - const line_maps *line_maps, - const char *base_file_name) -{ - gcc_assert (line_maps); - auto format = std::make_unique<xhtml_file_output_format> (context, - line_maps, - base_file_name); - diagnostic_output_format_init_xhtml (context, std::move (format)); +std::unique_ptr<diagnostic_output_format> +make_html_sink (diagnostic_context &context, + const line_maps &line_maps, + diagnostic_output_file output_file) +{ + auto sink + = std::make_unique<html_file_output_format> (context, + &line_maps, + std::move (output_file)); + sink->update_printer (); + return sink; } #if CHECKING_P namespace selftest { -/* A subclass of xhtml_output_format for writing selftests. +/* A subclass of html_output_format for writing selftests. The XML output is cached internally, rather than written out to a file. */ -class test_xhtml_diagnostic_context : public test_diagnostic_context +class test_html_diagnostic_context : public test_diagnostic_context { public: - test_xhtml_diagnostic_context () + test_html_diagnostic_context () { - auto format = std::make_unique<xhtml_buffered_output_format> (*this, - line_table); - m_format = format.get (); // borrowed - diagnostic_output_format_init_xhtml (*this, std::move (format)); + auto sink = std::make_unique<html_buffered_output_format> (*this, + line_table); + sink->update_printer (); + m_format = sink.get (); // borrowed + + set_output_format (std::move (sink)); } const xml::document &get_document () const @@ -889,12 +853,12 @@ public: } private: - class xhtml_buffered_output_format : public xhtml_output_format + class html_buffered_output_format : public html_output_format { public: - xhtml_buffered_output_format (diagnostic_context &context, - const line_maps *line_maps) - : xhtml_output_format (context, line_maps) + html_buffered_output_format (diagnostic_context &context, + const line_maps *line_maps) + : html_output_format (context, line_maps) { } bool machine_readable_stderr_p () const final override @@ -903,17 +867,17 @@ private: } }; - xhtml_output_format *m_format; // borrowed + html_output_format *m_format; // borrowed }; - /* Test of reporting a diagnostic at UNKNOWN_LOCATION to a - diagnostic_context and examining the generated XML document. - Verify various basic properties. */ +/* Test of reporting a diagnostic at UNKNOWN_LOCATION to a + diagnostic_context and examining the generated XML document. + Verify various basic properties. */ static void test_simple_log () { - test_xhtml_diagnostic_context dc; + test_html_diagnostic_context dc; rich_location richloc (line_table, UNKNOWN_LOCATION); dc.report (DK_ERROR, richloc, nullptr, 0, "this is a test: %i", 42); @@ -945,8 +909,8 @@ test_simple_log () /* Run all of the selftests within this file. */ -static void -xhtml_format_selftests () +void +diagnostic_format_html_cc_tests () { test_simple_log (); } @@ -954,32 +918,3 @@ xhtml_format_selftests () } // namespace selftest #endif /* CHECKING_P */ - -/* Plugin hooks. */ - -int plugin_is_GPL_compatible; - -/* Entrypoint for the plugin. */ - -int -plugin_init (struct plugin_name_args *plugin_info, - struct plugin_gcc_version *version) -{ - const char *plugin_name = plugin_info->base_name; - int argc = plugin_info->argc; - struct plugin_argument *argv = plugin_info->argv; - - if (!plugin_default_version_check (version, &gcc_version)) - return 1; - - global_dc->set_output_format - (std::make_unique<xhtml_stream_output_format> (*global_dc, - line_table, - stderr)); - -#if CHECKING_P - selftest::xhtml_format_selftests (); -#endif - - return 0; -} diff --git a/gcc/diagnostic-format-html.h b/gcc/diagnostic-format-html.h new file mode 100644 index 0000000..ff5edca --- /dev/null +++ b/gcc/diagnostic-format-html.h @@ -0,0 +1,37 @@ +/* HTML output for diagnostics. + Copyright (C) 2024-2025 Free Software Foundation, Inc. + Contributed by David Malcolm <dmalcolm@redhat.com>. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#ifndef GCC_DIAGNOSTIC_FORMAT_HTML_H +#define GCC_DIAGNOSTIC_FORMAT_HTML_H + +#include "diagnostic-format.h" +#include "diagnostic-output-file.h" + +extern diagnostic_output_file +diagnostic_output_format_open_html_file (diagnostic_context &context, + line_maps *line_maps, + const char *base_file_name); + +extern std::unique_ptr<diagnostic_output_format> +make_html_sink (diagnostic_context &context, + const line_maps &line_maps, + diagnostic_output_file output_file); + +#endif /* ! GCC_DIAGNOSTIC_FORMAT_HTML_H */ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b1964b3..f31d504 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -6072,6 +6072,22 @@ in this release. @end table +@item experimental-html +Emit diagnostics to a file in HTML format. This scheme is experimental, +and may go away in future GCC releases. The details of the output are +also subject to change. + +Supported keys are: + +@table @gcctabopt + +@item file=@var{FILENAME} +Specify the filename to write the HTML output to, potentially with a +leading absolute or relative path. If not specified, it defaults to +@file{@var{source}.html}. + +@end table + @end table For example, @@ -6091,7 +6107,7 @@ In EBNF: @var{diagnostics-output-specifier} = @var{diagnostics-output-name} | @var{diagnostics-output-name}, ":", @var{key-value-pairs}; -@var{diagnostics-output-name} = "text" | "sarif"; +@var{diagnostics-output-name} = "text" | "sarif" | "experimental-html"; @var{key-value-pairs} = @var{key-value-pair} | @var{key-value-pair} "," @var{key-value-pairs}; @@ -1190,7 +1190,10 @@ canon_address (rtx mem, address = strip_offset_and_add (address, offset); if (ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (mem)) - && const_or_frame_p (address)) + && const_or_frame_p (address) + /* Literal addresses can alias any base, avoid creating a + group for them. */ + && ! CONST_SCALAR_INT_P (address)) { group_info *group = get_group_info (address); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e6d9fa6..7298ffc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,17 @@ +2025-05-08 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120179 + * match.cc (gfc_match_do): Do not attempt to match end-of-statement + twice. + +2025-05-07 Paul Thomas <pault@gcc.gnu.org> + and Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/119948 + * primary.cc (match_variable): Module procedures with sym the + same as result can be treated as variables, although marked + external. + 2025-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/120049 diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index 474ba81..a99a757 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -2892,7 +2892,7 @@ gfc_match_do (void) locus where = gfc_current_locus; if (gfc_match_eos () == MATCH_YES) - break; + goto concurr_ok; else if (gfc_match ("local ( ") == MATCH_YES) { @@ -3141,6 +3141,7 @@ gfc_match_do (void) if (gfc_match_eos () != MATCH_YES) goto concurr_cleanup; +concurr_ok: if (label != NULL && !gfc_reference_st_label (label, ST_LABEL_DO_TARGET)) goto concurr_cleanup; diff --git a/gcc/gcov.cc b/gcc/gcov.cc index e1ad801..0dfe513 100644 --- a/gcc/gcov.cc +++ b/gcc/gcov.cc @@ -3591,7 +3591,7 @@ print_source_line (FILE *f, const vector<const char *> &source_lines, Returns 1 if the path was printed, 0 otherwise. */ static unsigned print_prime_path_lines (FILE *gcov_file, const function_info &fn, - const vector<unsigned> &path, size_t pathno) + const vector<unsigned> &path, unsigned pathno) { const bool is_covered = fn.paths.covered_p (pathno); if (is_covered && !flag_prime_paths_lines_covered) @@ -3600,9 +3600,9 @@ print_prime_path_lines (FILE *gcov_file, const function_info &fn, return 0; if (is_covered) - fprintf (gcov_file, "path %zu covered: lines", pathno); + fprintf (gcov_file, "path %u covered: lines", pathno); else - fprintf (gcov_file, "path %zu not covered: lines", pathno); + fprintf (gcov_file, "path %u not covered: lines", pathno); for (size_t k = 0; k != path.size (); ++k) { @@ -3658,7 +3658,7 @@ print_inlined_separator (FILE *gcov_file, unsigned current_index, const Returns 1 if the path was printed, 0 otherwise. */ static unsigned print_prime_path_source (FILE *gcov_file, const function_info &fn, - const vector<unsigned> &path, size_t pathno) + const vector<unsigned> &path, unsigned pathno) { const bool is_covered = fn.paths.covered_p (pathno); if (is_covered && !flag_prime_paths_source_covered) @@ -3667,9 +3667,9 @@ print_prime_path_source (FILE *gcov_file, const function_info &fn, return 0; if (is_covered) - fprintf (gcov_file, "path %zu covered:\n", pathno); + fprintf (gcov_file, "path %u covered:\n", pathno); else - fprintf (gcov_file, "path %zu not covered:\n", pathno); + fprintf (gcov_file, "path %u not covered:\n", pathno); unsigned current = fn.src; for (size_t k = 0; k != path.size (); ++k) { @@ -3728,19 +3728,19 @@ output_path_coverage (FILE *gcov_file, const function_info *fn) if (fn->paths.paths.empty ()) fnotice (gcov_file, "path coverage omitted\n"); else - fnotice (gcov_file, "paths covered %u of %zu\n", - fn->paths.covered_paths (), fn->paths.paths.size ()); + fnotice (gcov_file, "paths covered %u of " HOST_SIZE_T_PRINT_UNSIGNED "\n", + fn->paths.covered_paths (), (fmt_size_t)fn->paths.paths.size ()); if (flag_prime_paths_lines_uncovered || flag_prime_paths_lines_covered) { - size_t pathno = 0; + unsigned pathno = 0; for (const vector<unsigned> &path : fn->paths.paths) print_prime_path_lines (gcov_file, *fn, path, pathno++); } if (flag_prime_paths_source_uncovered || flag_prime_paths_source_covered) { - size_t pathno = 0; + unsigned pathno = 0; for (const vector<unsigned> &path : fn->paths.paths) print_prime_path_source (gcov_file, *fn, path, pathno++); } diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc index 80f1976..ac01328 100644 --- a/gcc/gensupport.cc +++ b/gcc/gensupport.cc @@ -656,7 +656,7 @@ public: i.e. if rtx is the relevant match_operand or match_scratch then [ns..ns + len) should equal itoa (XINT (rtx, 0)), and if set_attr then [ns..ns + len) should equal XSTR (rtx, 0). */ - conlist (const char *ns, unsigned int len, bool numeric) + conlist (const char *ns, unsigned int len, bool numeric, file_location loc) { /* Trim leading whitespaces. */ while (len > 0 && ISBLANK (*ns)) @@ -670,16 +670,26 @@ public: if (!ISBLANK (ns[i])) break; - /* Parse off any modifiers. */ - while (len > 0 && !ISALNUM (*ns)) - { - con += *(ns++); - len--; - } + /* Only numeric values can have modifiers. */ + if (numeric) + /* Parse off any modifiers. */ + while (len > 0 && !ISALNUM (*ns)) + { + if (*ns != '=' && *ns != '+' && *ns != '%') + error_at (loc, "`%c` is not a valid operand modifier", *ns); + con += *(ns++); + len--; + } name.assign (ns, len); if (numeric) - idx = strtol (name.c_str (), (char **)NULL, 10); + { + char *endstr; + /* There should only be a numeric value now... */ + idx = strtol (name.c_str (), &endstr, 10); + if (*endstr != '\0') + error_at (loc, "operand number expected, found %s", name.c_str ()); + } } /* Adds a character to the end of the string. */ @@ -832,7 +842,7 @@ parse_section_layout (file_location loc, const char **templ, const char *label, *templ += len; if (val == ',') (*templ)++; - list.push_back (conlist (name_start, len, numeric)); + list.push_back (conlist (name_start, len, numeric, loc)); } } } @@ -845,7 +855,8 @@ parse_section_layout (file_location loc, const char **templ, const char *label, static void parse_section (const char **templ, unsigned int n_elems, unsigned int alt_no, - vec_conlist &list, file_location loc, const char *name) + vec_conlist &list, file_location loc, const char *name, + const char *invalid_chars = NULL) { unsigned int i; @@ -856,6 +867,10 @@ parse_section (const char **templ, unsigned int n_elems, unsigned int alt_no, { if (**templ == 0 || **templ == '\n') fatal_at (loc, "missing ']'"); + if (invalid_chars + && strchr (invalid_chars, **templ)) + error_at (loc, "'%c' is not permitted in an alternative for a %s", + **templ, name); list[i].add (**templ); if (**templ == ',') { @@ -981,7 +996,7 @@ convert_syntax (rtx x, file_location loc) /* Parse the constraint list, then the attribute list. */ if (tconvec.size () > 0) parse_section (&templ, tconvec.size (), alt_no, tconvec, loc, - "constraint"); + "constraint", "=+%"); if (attrvec.size () > 0) { diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index 7721795..e63fd6f 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -6246,14 +6246,33 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi, false, NULL_TREE))) gimple_cond_set_condition (cond_stmt, code, ops[0], ops[1]); else if (code == SSA_NAME) - gimple_cond_set_condition (cond_stmt, NE_EXPR, ops[0], - build_zero_cst (TREE_TYPE (ops[0]))); + { + /* If setting the gimple cond to the same thing, + return false as nothing changed. */ + if (gimple_cond_code (cond_stmt) == NE_EXPR + && operand_equal_p (gimple_cond_lhs (cond_stmt), ops[0]) + && integer_zerop (gimple_cond_rhs (cond_stmt))) + return false; + gimple_cond_set_condition (cond_stmt, NE_EXPR, ops[0], + build_zero_cst (TREE_TYPE (ops[0]))); + } else if (code == INTEGER_CST) { + /* Make into the canonical form `1 != 0` and `0 != 0`. + If already in the canonical form return false + saying nothing has been done. */ if (integer_zerop (ops[0])) - gimple_cond_make_false (cond_stmt); + { + if (gimple_cond_false_canonical_p (cond_stmt)) + return false; + gimple_cond_make_false (cond_stmt); + } else - gimple_cond_make_true (cond_stmt); + { + if (gimple_cond_true_canonical_p (cond_stmt)) + return false; + gimple_cond_make_true (cond_stmt); + } } else if (!inplace) { @@ -10592,10 +10611,12 @@ arith_code_with_undefined_signed_overflow (tree_code code) /* Return true if STMT has an operation that operates on a signed integer types involves undefined behavior on overflow and the - operation can be expressed with unsigned arithmetic. */ + operation can be expressed with unsigned arithmetic. + Also returns true if STMT is a VCE that needs to be rewritten + if moved to be executed unconditionally. */ bool -gimple_with_undefined_signed_overflow (gimple *stmt) +gimple_needing_rewrite_undefined (gimple *stmt) { if (!is_gimple_assign (stmt)) return false; @@ -10606,6 +10627,16 @@ gimple_with_undefined_signed_overflow (gimple *stmt) if (!INTEGRAL_TYPE_P (lhs_type) && !POINTER_TYPE_P (lhs_type)) return false; + tree rhs = gimple_assign_rhs1 (stmt); + /* VCE from integral types to a integral types but with + a smaller precision need to be changed into casts + to be well defined. */ + if (gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR + && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0))) + && is_gimple_val (TREE_OPERAND (rhs, 0)) + && TYPE_PRECISION (lhs_type) + < TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (rhs, 0)))) + return true; if (!TYPE_OVERFLOW_UNDEFINED (lhs_type)) return false; if (!arith_code_with_undefined_signed_overflow @@ -10625,19 +10656,39 @@ gimple_with_undefined_signed_overflow (gimple *stmt) contain a modified form of STMT itself. */ static gimple_seq -rewrite_to_defined_overflow (gimple_stmt_iterator *gsi, gimple *stmt, - bool in_place) +rewrite_to_defined_unconditional (gimple_stmt_iterator *gsi, gimple *stmt, + bool in_place) { + gcc_assert (gimple_needing_rewrite_undefined (stmt)); if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, "rewriting stmt with undefined signed " - "overflow "); + fprintf (dump_file, "rewriting stmt for being uncondtional defined"); print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); } - + gimple_seq stmts = NULL; + /* VCE from integral types to another integral types but with + smaller precisions need to be changed into casts + to be well defined. */ + if (gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR) + { + tree rhs = gimple_assign_rhs1 (stmt); + tree new_rhs = TREE_OPERAND (rhs, 0); + gcc_assert (TYPE_PRECISION (TREE_TYPE (rhs)) + < TYPE_PRECISION (TREE_TYPE (new_rhs))); + gcc_assert (is_gimple_val (new_rhs)); + gimple_assign_set_rhs_code (stmt, NOP_EXPR); + gimple_assign_set_rhs1 (stmt, new_rhs); + if (in_place) + update_stmt (stmt); + else + { + gimple_set_modified (stmt, true); + gimple_seq_add_stmt (&stmts, stmt); + } + return stmts; + } tree lhs = gimple_assign_lhs (stmt); tree type = unsigned_type_for (TREE_TYPE (lhs)); - gimple_seq stmts = NULL; if (gimple_assign_rhs_code (stmt) == ABS_EXPR) gimple_assign_set_rhs_code (stmt, ABSU_EXPR); else @@ -10672,15 +10723,15 @@ rewrite_to_defined_overflow (gimple_stmt_iterator *gsi, gimple *stmt, } void -rewrite_to_defined_overflow (gimple_stmt_iterator *gsi) +rewrite_to_defined_unconditional (gimple_stmt_iterator *gsi) { - rewrite_to_defined_overflow (gsi, gsi_stmt (*gsi), true); + rewrite_to_defined_unconditional (gsi, gsi_stmt (*gsi), true); } gimple_seq -rewrite_to_defined_overflow (gimple *stmt) +rewrite_to_defined_unconditional (gimple *stmt) { - return rewrite_to_defined_overflow (nullptr, stmt, false); + return rewrite_to_defined_unconditional (nullptr, stmt, false); } /* The valueization hook we use for the gimple_build API simplification. diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h index 5fcfdcd..afecbb8 100644 --- a/gcc/gimple-fold.h +++ b/gcc/gimple-fold.h @@ -59,9 +59,9 @@ extern tree gimple_get_virt_method_for_vtable (HOST_WIDE_INT, tree, extern tree gimple_fold_indirect_ref (tree); extern bool gimple_fold_builtin_sprintf (gimple_stmt_iterator *); extern bool gimple_fold_builtin_snprintf (gimple_stmt_iterator *); -extern bool gimple_with_undefined_signed_overflow (gimple *); -extern void rewrite_to_defined_overflow (gimple_stmt_iterator *); -extern gimple_seq rewrite_to_defined_overflow (gimple *); +extern bool gimple_needing_rewrite_undefined (gimple *); +extern void rewrite_to_defined_unconditional (gimple_stmt_iterator *); +extern gimple_seq rewrite_to_defined_unconditional (gimple *); extern void replace_call_with_value (gimple_stmt_iterator *, tree); extern tree tree_vec_extract (gimple_stmt_iterator *, tree, tree, tree, tree); extern void gsi_replace_with_seq_vops (gimple_stmt_iterator *, gimple_seq); diff --git a/gcc/gimple.h b/gcc/gimple.h index 032365f..977ff1c 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -3875,6 +3875,21 @@ gimple_cond_true_p (const gcond *gs) return false; } +/* Check if conditional statement GS is in the caonical form of 'if (1 != 0)'. */ + +inline bool +gimple_cond_true_canonical_p (const gcond *gs) +{ + tree lhs = gimple_cond_lhs (gs); + tree rhs = gimple_cond_rhs (gs); + tree_code code = gimple_cond_code (gs); + if (code == NE_EXPR + && lhs == boolean_true_node + && rhs == boolean_false_node) + return true; + return false; +} + /* Check if conditional statement GS is of the form 'if (1 != 1)', 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */ @@ -3900,6 +3915,21 @@ gimple_cond_false_p (const gcond *gs) return false; } +/* Check if conditional statement GS is in the caonical form of 'if (0 != 0)'. */ + +inline bool +gimple_cond_false_canonical_p (const gcond *gs) +{ + tree lhs = gimple_cond_lhs (gs); + tree rhs = gimple_cond_rhs (gs); + tree_code code = gimple_cond_code (gs); + if (code == NE_EXPR + && lhs == boolean_false_node + && rhs == boolean_false_node) + return true; + return false; +} + /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */ inline void diff --git a/gcc/opts-diagnostic.cc b/gcc/opts-diagnostic.cc index 1eec010..34c3906 100644 --- a/gcc/opts-diagnostic.cc +++ b/gcc/opts-diagnostic.cc @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "diagnostic-color.h" #include "diagnostic-format.h" +#include "diagnostic-format-html.h" #include "diagnostic-format-text.h" #include "diagnostic-format-sarif.h" #include "selftest.h" @@ -217,6 +218,17 @@ public: const scheme_name_and_params &parsed_arg) const final override; }; +class html_scheme_handler : public output_factory::scheme_handler +{ +public: + html_scheme_handler () : scheme_handler ("experimental-html") {} + + std::unique_ptr<diagnostic_output_format> + make_sink (const context &ctxt, + const char *unparsed_arg, + const scheme_name_and_params &parsed_arg) const final override; +}; + /* struct context. */ void @@ -318,6 +330,7 @@ output_factory::output_factory () { m_scheme_handlers.push_back (std::make_unique<text_scheme_handler> ()); m_scheme_handlers.push_back (std::make_unique<sarif_scheme_handler> ()); + m_scheme_handlers.push_back (std::make_unique<html_scheme_handler> ()); } const output_factory::scheme_handler * @@ -525,6 +538,53 @@ sarif_scheme_handler::make_sink (const context &ctxt, return sink; } +/* class html_scheme_handler : public output_factory::scheme_handler. */ + +std::unique_ptr<diagnostic_output_format> +html_scheme_handler::make_sink (const context &ctxt, + const char *unparsed_arg, + const scheme_name_and_params &parsed_arg) const +{ + label_text filename; + for (auto& iter : parsed_arg.m_kvs) + { + const std::string &key = iter.first; + const std::string &value = iter.second; + if (key == "file") + { + filename = label_text::take (xstrdup (value.c_str ())); + continue; + } + + /* Key not found. */ + auto_vec<const char *> known_keys; + known_keys.safe_push ("file"); + ctxt.report_unknown_key (unparsed_arg, key, get_scheme_name (), known_keys); + return nullptr; + } + + diagnostic_output_file output_file; + if (filename.get ()) + output_file = ctxt.open_output_file (std::move (filename)); + else + // Default filename + { + const char *basename = (ctxt.m_opts.x_dump_base_name + ? ctxt.m_opts.x_dump_base_name + : ctxt.m_opts.x_main_input_basename); + output_file = diagnostic_output_format_open_html_file (ctxt.m_dc, + line_table, + basename); + } + if (!output_file) + return nullptr; + + auto sink = make_html_sink (ctxt.m_dc, + *line_table, + std::move (output_file)); + return sink; +} + } // namespace diagnostics_output_spec } // namespace gcc diff --git a/gcc/selftest-run-tests.cc b/gcc/selftest-run-tests.cc index 3c12e8a..959e5d0 100644 --- a/gcc/selftest-run-tests.cc +++ b/gcc/selftest-run-tests.cc @@ -98,6 +98,7 @@ selftest::run_tests () rely on. */ diagnostic_color_cc_tests (); diagnostic_show_locus_cc_tests (); + diagnostic_format_html_cc_tests (); diagnostic_format_json_cc_tests (); diagnostic_format_sarif_cc_tests (); edit_context_cc_tests (); diff --git a/gcc/selftest.h b/gcc/selftest.h index a0d2473..7e1d94c 100644 --- a/gcc/selftest.h +++ b/gcc/selftest.h @@ -221,6 +221,7 @@ extern void bitmap_cc_tests (); extern void cgraph_cc_tests (); extern void convert_cc_tests (); extern void diagnostic_color_cc_tests (); +extern void diagnostic_format_html_cc_tests (); extern void diagnostic_format_json_cc_tests (); extern void diagnostic_format_sarif_cc_tests (); extern void diagnostic_path_cc_tests (); diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc index 7bcbe11..b34fd2f 100644 --- a/gcc/simplify-rtx.cc +++ b/gcc/simplify-rtx.cc @@ -7387,6 +7387,13 @@ simplify_context::simplify_ternary_operation (rtx_code code, machine_mode mode, return gen_rtx_CONST_VECTOR (mode, v); } + if (swap_commutative_operands_p (op0, op1) + /* Two operands have same precedence, then first bit of mask + select first operand. */ + || (!swap_commutative_operands_p (op1, op0) && !(sel & 1))) + return simplify_gen_ternary (code, mode, mode, op1, op0, + GEN_INT (~sel & mask)); + /* Replace (vec_merge (vec_merge a b m) c n) with (vec_merge b c n) if no element from a appears in the result. */ if (GET_CODE (op0) == VEC_MERGE) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2ebcef..ce230e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,288 @@ +2025-05-09 Jason Merrill <jason@redhat.com> + + PR c++/99599 + PR c++/120185 + * g++.dg/cpp2a/concepts-nondep6.C: New test. + +2025-05-09 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/opt106.adb: New test. + * gnat.dg/opt106_pkg1.ads, gnat.dg/opt106_pkg1.adb: New helper. + * gnat.dg/opt106_pkg2.ads, gnat.dg/opt106_pkg2.adb: Likewise. + +2025-05-09 Richard Biener <rguenther@suse.de> + + PR rtl-optimization/120182 + * gcc.dg/torture/pr120182.c: New testcase. + +2025-05-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/119960 + * gcc.dg/vect/bb-slp-pr119960-1.c: New testcase. + +2025-05-09 Christophe Lyon <christophe.lyon@linaro.org> + + * g++.dg/cpp2a/constinit16.C: Require tls. + +2025-05-09 Christophe Lyon <christophe.lyon@linaro.org> + + * g++.dg/cpp2a/decomp2.C: Require tls_runtime. + +2025-05-09 Jiawei <jiawei@iscas.ac.cn> + + * gcc.dg/pr119160.c: Limit backends. + +2025-05-09 Jennifer Schmitz <jschmitz@nvidia.com> + + * gcc.target/aarch64/sve/ptrue_ldr_str.c: New test. + * gcc.target/aarch64/sve/acle/general/attributes_6.c: Adjust + expected outcome. + * gcc.target/aarch64/sve/cost_model_14.c: Adjust expected outcome. + * gcc.target/aarch64/sve/cost_model_4.c: Adjust expected outcome. + * gcc.target/aarch64/sve/cost_model_5.c: Adjust expected outcome. + * gcc.target/aarch64/sve/cost_model_6.c: Adjust expected outcome. + * gcc.target/aarch64/sve/cost_model_7.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_f16.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_f32.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_f64.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_mf8.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_s16.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_s32.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_s64.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_s8.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_u16.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_u32.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_u64.c: Adjust expected outcome. + * gcc.target/aarch64/sve/pcs/varargs_2_u8.c: Adjust expected outcome. + * gcc.target/aarch64/sve/peel_ind_2.c: Adjust expected outcome. + * gcc.target/aarch64/sve/single_1.c: Adjust expected outcome. + * gcc.target/aarch64/sve/single_2.c: Adjust expected outcome. + * gcc.target/aarch64/sve/single_3.c: Adjust expected outcome. + * gcc.target/aarch64/sve/single_4.c: Adjust expected outcome. + +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc: Move to + gcc/diagnostic-format-html.cc. + * gcc.dg/html-output/html-output.exp: New support script. + * gcc.dg/html-output/missing-semicolon.c: New test. + * gcc.dg/html-output/missing-semicolon.py: New test script. + * gcc.dg/plugin/diagnostic-test-xhtml-1.c: Deleted test. + * gcc.dg/plugin/plugin.exp (plugin_test_list): Drop moved plugin + and its deleted test. + * lib/gcc-dg.exp (load_lib): Add load_lib of scanhtml.exp. + * lib/htmltest.py: New support script. + * lib/scanhtml.exp: New support script, based on scansarif.exp. + +2025-05-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i8.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u8.c: New test. + +2025-05-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i8.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u8.c: New test. + +2025-05-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test + helper macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i8.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u8.c: New test. + +2025-05-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Rename VX_BINARY + to VX_BINARY_CASE_0 for underlying case 1. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i16.c: Take the + new name for test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i8.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u16.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u32.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u64.c: Ditto + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u8.c: Ditto + +2025-05-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/rvv.exp: Separate test running of + rvv vx_vf. + +2025-05-08 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120179 + * gfortran.dg/do_concurrent_basic.f90: Extend testcase. + +2025-05-08 Jason Merrill <jason@redhat.com> + + PR c++/99599 + * g++.dg/cpp2a/concepts-recursive-sat4.C: Adjust again. + * g++.dg/cpp2a/concepts-nondep5.C: New test. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + PR testsuite/120168 + * gcc.dg/tree-ssa/pr31261.c: Use `signed char` instead + of plain char. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120043 + * gcc.dg/torture/pr120043.c: New testcase. + +2025-05-08 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120152 + PR libfortran/120153 + PR libfortran/120158 + * gfortran.dg/pr120152_1.f90: New test. + * gfortran.dg/pr120152_2.f90: New test. + * gfortran.dg/pr120153.f90: New test. + * gfortran.dg/pr120158.f90: New test. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + PR tree-optimization/116938 + * gcc.dg/tree-ssa/phi-opt-40.c: Update to expect ABSU_EXPR. + * gcc.dg/tree-ssa/phi-opt-41.c: Likewise. + +2025-05-08 Andrew Pinski <quic_apinski@quicinc.com> + + PR tree-optimization/120122 + PR tree-optimization/116939 + * gcc.dg/torture/pr120122-1.c: New test. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR ipa/120146 + * g++.dg/ipa/pr120146.C: New testcase. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120143 + * gcc.dg/vect/vect-early-break_135-pr120143.c: New testcase. + +2025-05-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120089 + * gcc.dg/vect/vect-early-break_134-pr120089.c: New testcase. + +2025-05-07 Jeff Law <jlaw@ventanamicro.com> + + PR target/120137 + PR target/120154 + * gcc.target/riscv/pr120137.c: New test. + * gcc.target/riscv/pr120154.c: New test. + +2025-05-07 Dongyan Chen <chendongyan@isrc.iscas.ac.cn> + + * gcc.target/riscv/arch-48.c: New test. + +2025-05-07 Richard Earnshaw <rearnsha@arm.com> + + PR target/110796 + PR target/118446 + * gcc.target/arm/armv8_2-fp16-arith-1.c: Adjust due to no-longer + emitting VCMPE when -ffast-math.. + +2025-05-07 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/108900 + PR preprocessor/116047 + PR preprocessor/120061 + * gcc.dg/plugin/plugin.exp: Add location-overflow-test-pr116047.c + and location-overflow-test-pr120061.c. + * gcc.dg/plugin/location_overflow_plugin.cc (plugin_init): Don't error + on unknown values, instead just break. Handle 0x4fHHHHHH arguments + differently. + * gcc.dg/plugin/location-overflow-test-pr116047.c: New test. + * gcc.dg/plugin/location-overflow-test-pr116047-1.h: New test. + * gcc.dg/plugin/location-overflow-test-pr116047-2.h: New test. + * gcc.dg/plugin/location-overflow-test-pr120061.c: New test. + * gcc.dg/plugin/location-overflow-test-pr120061-1.h: New test. + * gcc.dg/plugin/location-overflow-test-pr120061-2.h: New test. + +2025-05-07 Jan Hubicka <hubicka@ucw.cz> + + * gcc.target/i386/pr119919.c: Add -mtune=znver1 + +2025-05-07 Jennifer Schmitz <jschmitz@nvidia.com> + + PR target/117978 + * gcc.target/aarch64/sve/acle/general/whilelt_5.c: Adjust expected + outcome. + * gcc.target/aarch64/sve/ldst_ptrue_pat_128_to_neon.c: New test. + * gcc.target/aarch64/sve/while_7.c: Adjust expected outcome. + * gcc.target/aarch64/sve/while_9.c: Adjust expected outcome. + +2025-05-07 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.target/s390/vector/cstoreti-1.c: New test. + * gcc.target/s390/vector/cstoreti-2.c: New test. + +2025-05-07 H.J. Lu <hjl.tools@gmail.com> + + PR target/120036 + * g++.target/i386/pr120036.C: New test. + * gcc.target/i386/pr117839-3a.c: Likewise. + * gcc.target/i386/pr117839-3b.c: Likewise. + +2025-05-07 Paul Thomas <pault@gcc.gnu.org> + and Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/119948 + * gfortran.dg/pr119948.f90: Update to incorporate failing test, + where module procedure is the result. Test submodule cases. + +2025-05-07 Jeff Law <jlaw@ventanamicro.com> + + * g++.target/riscv/redundant-andi.C: New test. + 2025-05-06 Dongyan Chen <chendongyan@isrc.iscas.ac.cn> * gcc.target/riscv/arch-47.c: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-recursion3.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-recursion3.C new file mode 100644 index 0000000..cadbdf0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-recursion3.C @@ -0,0 +1,15 @@ +// PR c++/120204 +// { dg-do compile { target c++14 } } + +template<class T, int t> +struct array{}; + +template <typename... TArgs> struct ILEArglist { + using Sizes = array<int, sizeof...(TArgs)>; + static constexpr int size() { // { dg-bogus "not usable" } + Sizes &offsets_c = offsets; // { dg-error "depends on itself" } + return 0; + } + array<char, size()> offsets(); // { dg-error "constant expression" } +}; +auto arglist = ILEArglist<>(); diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-nondep5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-nondep5.C new file mode 100644 index 0000000..f08d4d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-nondep5.C @@ -0,0 +1,34 @@ +// The from_range_t default ctor should not break the PR99599 workaround +// { dg-do compile { target c++20 } } + +template<typename T> +struct S { T t; }; + +template<typename T> +concept C = sizeof(S<T>) > 0; + +struct I; + +struct from_range_t { + explicit from_range_t() = default; +}; +inline constexpr from_range_t from_range; + +template<typename T> +concept FromRange = __is_same_as (T, from_range_t); + +//#define WORKAROUND +#ifdef WORKAROUND +template<FromRange U, C T> +void f(U, T*); +#else +template<C T> +void f(from_range_t, T*); +#endif + +void f(...); + +void g(I* p) +{ + ::f(0, p); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-nondep6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-nondep6.C new file mode 100644 index 0000000..7adf6ec --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-nondep6.C @@ -0,0 +1,12 @@ +// PR c++/120185 + +struct A { + A(...); +}; + +template <class T> void f(A, T) { } + +int main() +{ + f(42, 24); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat4.C index 08f206d..41364f7 100644 --- a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat4.C +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat4.C @@ -7,7 +7,7 @@ template <class T, class U> concept C = requires(T t, U u) { t * u; }; // { dg-error "depends on itself" "" { target *-*-* } .-2 } template <class Rep> struct Int { - Int(); // make the class non-aggregate in light of PR99599 fix + Int(int = 0); // make the class ineligible for PR99599 workaround template <class T> requires C<T, Rep> friend void operator*(T, Int) { } template <class T> requires C<T, Rep> friend void operator*(Int, T) { } }; diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit16.C b/gcc/testsuite/g++.dg/cpp2a/constinit16.C index dda81d5..046e9aa 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constinit16.C +++ b/gcc/testsuite/g++.dg/cpp2a/constinit16.C @@ -2,7 +2,7 @@ // { dg-do compile { target c++20 } } // { dg-add-options tls } // { dg-require-alias "" } -// { dg-require-effective-target tls_runtime } +// { dg-require-effective-target tls } // { dg-final { scan-assembler-not "_ZTH17mythreadlocalvar1" } } // { dg-final { scan-assembler "_ZTH17mythreadlocalvar2" } } // { dg-final { scan-assembler-not "_ZTH17mythreadlocalvar3" } } diff --git a/gcc/testsuite/g++.dg/cpp2a/decomp2.C b/gcc/testsuite/g++.dg/cpp2a/decomp2.C index c2bfe46..d13f424 100644 --- a/gcc/testsuite/g++.dg/cpp2a/decomp2.C +++ b/gcc/testsuite/g++.dg/cpp2a/decomp2.C @@ -1,7 +1,7 @@ // P1091R3 // { dg-do run { target c++11 } } // { dg-options "" } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_runtime } // { dg-add-options tls } namespace std { diff --git a/gcc/testsuite/g++.dg/ipa/pr120146.C b/gcc/testsuite/g++.dg/ipa/pr120146.C new file mode 100644 index 0000000..33644b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr120146.C @@ -0,0 +1,12 @@ +// { dg-do compile } +// { dg-options "-O -fipa-pta" } + +struct basic_ios { + ~basic_ios(); +}; +struct basic_istream : virtual basic_ios {}; +template <typename> struct basic_ifstream : basic_istream { + template <typename _Path> basic_ifstream(_Path, int); +}; +extern template class basic_ifstream<char>; +void CompareFiles_path2() { basic_ifstream<char>(CompareFiles_path2, 0); } diff --git a/gcc/testsuite/gcc.dg/html-output/html-output.exp b/gcc/testsuite/gcc.dg/html-output/html-output.exp new file mode 100644 index 0000000..1f977ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/html-output/html-output.exp @@ -0,0 +1,31 @@ +# Copyright (C) 2012-2024 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Load support procs. +load_lib gcc-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" "" + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.dg/html-output/missing-semicolon.c b/gcc/testsuite/gcc.dg/html-output/missing-semicolon.c new file mode 100644 index 0000000..c211f4f --- /dev/null +++ b/gcc/testsuite/gcc.dg/html-output/missing-semicolon.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fdiagnostics-add-output=experimental-html" } */ + +/* Verify that basics of HTML output work. */ + +int missing_semicolon (void) +{ + return 42 /* { dg-error "expected ';' before '.' token" } */ +} + +/* Use a Python script to verify various properties about the generated + .html file: + { dg-final { run-html-pytest missing-semicolon.c "missing-semicolon.py" } } */ diff --git a/gcc/testsuite/gcc.dg/html-output/missing-semicolon.py b/gcc/testsuite/gcc.dg/html-output/missing-semicolon.py new file mode 100644 index 0000000..8687168 --- /dev/null +++ b/gcc/testsuite/gcc.dg/html-output/missing-semicolon.py @@ -0,0 +1,84 @@ +# Verify that basics of HTML output work. +# +# For reference, we expect this textual output: +# +# PATH/missing-semicolon.c: In function ‘missing_semicolon’: +# PATH/missing-semicolon.c:8:12: error: expected ‘;’ before ‘}’ token +# 8 | return 42 /* { dg-error "expected ';' before '.' token" } */ +# | ^ +# | ; +# 9 | } +# | ~ + +from htmltest import * + +import pytest + +@pytest.fixture(scope='function', autouse=True) +def html_tree(): + return html_tree_from_env() + +XHTML = 'http://www.w3.org/1999/xhtml' +ns = {'xhtml': XHTML} + +def make_tag(local_name): + return f'{{{XHTML}}}' + local_name + +def test_basics(html_tree): + root = html_tree.getroot () + assert root.tag == make_tag('html') + + head = root.find('xhtml:head', ns) + assert head is not None + + title = head.find('xhtml:title', ns) + assert title.text == 'Title goes here' + + body = root.find('xhtml:body', ns) + assert body is not None + + diag_list = body.find('xhtml:div', ns) + assert diag_list is not None + assert diag_list.attrib['class'] == 'gcc-diagnostic-list' + + diag = diag_list.find('xhtml:div', ns) + assert diag is not None + assert diag.attrib['class'] == 'gcc-diagnostic' + + message = diag.find('xhtml:span', ns) + assert message is not None + assert message.attrib['class'] == 'gcc-message' + assert message.text == "expected '" + assert message[0].tag == make_tag('span') + assert message[0].attrib['class'] == 'gcc-quoted-text' + assert message[0].text == ';' + assert message[0].tail == "' before '" + assert message[1].tag == make_tag('span') + assert message[1].attrib['class'] == 'gcc-quoted-text' + assert message[1].text == '}' + assert message[1].tail == "' token" + + pre = diag.find('xhtml:pre', ns) + assert pre is not None + assert pre.attrib['class'] == 'gcc-annotated-source' + +# For reference, here's the generated HTML: +""" +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Title goes here</title> + </head> + <body> + <div class="gcc-diagnostic-list"> + <div class="gcc-diagnostic"> + <span class="gcc-message">expected '<span class="gcc-quoted-text">;</span>' before '<span class="gcc-quoted-text">}</span>' token</span> + <pre class="gcc-annotated-source"></pre> + </div> + </div> + </body> +</html> +""" diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-xhtml-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-xhtml-1.c deleted file mode 100644 index da069ff..0000000 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-xhtml-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do compile } */ - -int missing_semicolon (void) -{ - return 42 -} - -/* Verify some properties of the generated HTML. */ - -/* { dg-begin-multiline-output "" } -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - { dg-end-multiline-output "" } */ - -/* { dg-excess-errors "" } */ diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp index 96e76d2..a84fbae 100644 --- a/gcc/testsuite/gcc.dg/plugin/plugin.exp +++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp @@ -76,8 +76,6 @@ set plugin_test_list [list \ crash-test-ice-in-header-sarif-2.1.c \ crash-test-ice-in-header-sarif-2.2.c \ crash-test-write-though-null-sarif.c } \ - { diagnostic_plugin_xhtml_format.cc \ - diagnostic-test-xhtml-1.c } \ { diagnostic_group_plugin.cc \ diagnostic-group-test-1.c } \ { diagnostic_plugin_test_show_locus.cc \ diff --git a/gcc/testsuite/gcc.dg/pr119160.c b/gcc/testsuite/gcc.dg/pr119160.c index b4629a1..5743b3b 100644 --- a/gcc/testsuite/gcc.dg/pr119160.c +++ b/gcc/testsuite/gcc.dg/pr119160.c @@ -1,5 +1,6 @@ /* { dg-do run } */ -/* { dg-options "-O2 -finstrument-functions-once -favoid-store-forwarding -fnon-call-exceptions -fschedule-insns -mgeneral-regs-only -Wno-psabi" } */ +/* { dg-options "-O2 -finstrument-functions-once -favoid-store-forwarding -fnon-call-exceptions -fschedule-insns -Wno-psabi" } */ +/* { dg-additional-options "-mgeneral-regs-only" { target { x86_64-*-* i?86-*-* arm*-*-* aarch64*-*-* } } } */ typedef __attribute__((__vector_size__ (32))) int V; diff --git a/gcc/testsuite/gcc.dg/pr87600.h b/gcc/testsuite/gcc.dg/pr87600.h index af91f63..c89071eb 100644 --- a/gcc/testsuite/gcc.dg/pr87600.h +++ b/gcc/testsuite/gcc.dg/pr87600.h @@ -7,7 +7,7 @@ #elif defined (__i386__) # define REG1 "%eax" # define REG2 "%edx" -#elif defined (__powerpc__) || defined (__POWERPC__) +#elif defined (__powerpc__) || defined (__POWERPC__) || defined (__PPC__) # define REG1 "r3" # define REG2 "r4" #elif defined (__s390__) diff --git a/gcc/testsuite/gcc.dg/pr89313.c b/gcc/testsuite/gcc.dg/pr89313.c index 76cb091..7de64da 100644 --- a/gcc/testsuite/gcc.dg/pr89313.c +++ b/gcc/testsuite/gcc.dg/pr89313.c @@ -8,7 +8,7 @@ # define REG "r0" #elif defined (__i386__) # define REG "%eax" -#elif defined (__powerpc__) || defined (__POWERPC__) +#elif defined (__powerpc__) || defined (__POWERPC__) || defined (__PPC__) # define REG "r3" #elif defined (__s390__) # define REG "0" diff --git a/gcc/testsuite/gcc.dg/torture/pr120043.c b/gcc/testsuite/gcc.dg/torture/pr120043.c new file mode 100644 index 0000000..ae27468 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr120043.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-additional-options "-fallow-store-data-races" } */ + +const int a; +int *b; +int main() +{ + &a != b || (*b = 1); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr120122-1.c b/gcc/testsuite/gcc.dg/torture/pr120122-1.c new file mode 100644 index 0000000..dde41d8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr120122-1.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* PR tree-optimization/120122 */ + +#include <stdbool.h> + +struct Value { + int type; + union { + bool boolean; + long long t; + }; +}; + +static struct Value s_item_mem; + +/* truthy was being miscompiled for the value.type==2 case, + because we would have a VCE from unsigned char to bool + that went from being conditional in the value.type==1 case + to unconditional when `value.type!=0`. + The move of the VCE from conditional to unconditional, + needs to changed into a convert (NOP_EXPR). */ +static bool truthy(void) __attribute__((noipa)); +static bool +truthy(void) +{ + bool tt = false; + for(int i = 0; i < 10; i++) + { + struct Value value = s_item_mem; + if (value.type == 0) + tt = tt | 0; + else if (value.type == 1) + tt = tt | value.boolean; + else + tt = tt | 1; + } + return tt; +} + +int +main(void) +{ + s_item_mem.type = 2; + s_item_mem.t = -1; + bool b1 = !truthy(); + s_item_mem.type = 1; + s_item_mem.boolean = b1; + bool b = truthy(); + if (b1 != b) __builtin_abort(); + if (b) __builtin_abort(); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr120182.c b/gcc/testsuite/gcc.dg/torture/pr120182.c new file mode 100644 index 0000000..5e2d171 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr120182.c @@ -0,0 +1,42 @@ +/* { dg-do run { target { { *-*-linux* *-*-gnu* *-*-uclinux* } && mmap } } } */ + +#include <unistd.h> +#include <stdlib.h> +#include <sys/mman.h> + +struct S +{ + struct S *next; +}; + +static void __attribute__((noipa)) +allocate(void *addr, unsigned long long size) +{ + void *ptr = mmap((void *)addr, size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED_NOREPLACE, + -1, 0); + if(ptr != addr) + exit(0); +} + +int main (void) +{ + int size = 0x8000; + char *ptr = (char *)0x288000ull; + allocate((void *)ptr, size); + + struct S *s1 = (struct S *)ptr; + struct S *s2 = (struct S *)256; + for (int i = 0; i < 3; i++) + { + for(char *addr = (char *)s1; addr < (char *)s1 + sizeof(*s1); ++addr) + *addr = 0; + + if(s1->next) + s1->next = s1->next->next = s2; + else + s1->next = s2; + } + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-40.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-40.c index a9011ce..7062916 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-40.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-40.c @@ -20,6 +20,7 @@ int f1(int x) /* { dg-final { scan-tree-dump-times "if " 1 "phiopt1" } } */ /* { dg-final { scan-tree-dump-not "if " "phiopt2" } } */ -/* { dg-final { scan-tree-dump-times "ABS_EXPR <" 2 "phiopt1" } } */ -/* { dg-final { scan-tree-dump-times "ABS_EXPR <" 1 "phiopt2" } } */ -/* { dg-final { scan-tree-dump-times "ABSU_EXPR <" 1 "phiopt2" } } */ +/* The ABS_EXPR in f gets rewritten to ABSU_EXPR as phiopt can't prove it was not undefined when moving it. */ +/* { dg-final { scan-tree-dump-times "ABS_EXPR <" 1 "phiopt1" } } */ +/* { dg-final { scan-tree-dump-times "ABSU_EXPR <" 1 "phiopt1" } } */ +/* { dg-final { scan-tree-dump-times "ABSU_EXPR <" 2 "phiopt2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-41.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-41.c index 9774e28..817d4fe 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-41.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-41.c @@ -29,6 +29,6 @@ int fge(int a, unsigned char b) return a > 0 ? a : -a; } - +/* The ABS_EXPR gets rewritten to ABSU_EXPR as phiopt can't prove it was not undefined when moving it. */ /* { dg-final { scan-tree-dump-not "if " "phiopt1" } } */ -/* { dg-final { scan-tree-dump-times "ABS_EXPR <" 4 "phiopt1" } } */ +/* { dg-final { scan-tree-dump-times "ABSU_EXPR <" 4 "phiopt1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr120080.c b/gcc/testsuite/gcc.dg/tree-ssa/pr120080.c new file mode 100644 index 0000000..d71ef5e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr120080.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple -O2" } */ + +void __GIMPLE (ssa,startwith("switchlower1")) +foo (int b) +{ + __BB(2): + switch (b) {default: L9; case 0: L5; case 5: L5; case 101: L5; } + + __BB(3): +L9: + switch (b) {default: L7; case 5: L6; case 101: L6; } + + __BB(4): +L6: + __builtin_unreachable (); + + __BB(5): +L7: + __builtin_trap (); + + __BB(6): +L5: + return; + +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c b/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c index 127300f..dafb4c4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c @@ -14,8 +14,8 @@ f2 (long int b) return (16 + (b & 7)) & 15; } -char -f3 (char c) +signed char +f3 (signed char c) { return -(c & 63) & 31; } @@ -34,7 +34,7 @@ f5 (int e) /* { dg-final { scan-tree-dump-times "return -a \& 7;" 1 "original" } } */ /* { dg-final { scan-tree-dump-times "return b \& 7;" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "return \\(char\\) -\\(unsigned char\\) c \& 31;" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "return \\(signed char\\) -\\(unsigned char\\) c \& 31;" 1 "original" } } */ /* { dg-final { scan-tree-dump-times "return \\(int\\) \\(12 - \\(unsigned int\\) d\\) \& 7;" 1 "original" { target { ! int16 } } } } */ /* { dg-final { scan-tree-dump-times "return \\(int\\) \\(12 - \\(unsigned short\\) d\\) \& 7;" 1 "original" { target { int16 } } } } */ /* { dg-final { scan-tree-dump-times "return 12 - \\(e \& 7\\) \& 15;" 1 "original" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr119960-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr119960-1.c new file mode 100644 index 0000000..955fc7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr119960-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_double } */ + +double foo (double *dst, double *src, int b) +{ + double y = src[1]; + if (b) + { + dst[0] = src[0]; + dst[1] = y; + } + return y; +} + +/* { dg-final { scan-tree-dump "optimized: basic block part vectorized" "slp2" { target vect_double } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_134-pr120089.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_134-pr120089.c new file mode 100644 index 0000000..4d8199c --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_134-pr120089.c @@ -0,0 +1,66 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-additional-options "-funswitch-loops" } */ + +#include "tree-vect.h" + +typedef int type; +typedef type Vec2[2]; + +struct BytesVec { + type d[100]; +}; + +__attribute__((noipa)) struct BytesVec +buildVertexBufferData(const Vec2 *origVertices, bool needsZW, + unsigned paddingSize, unsigned long t) { + const unsigned vertexCount = t; + struct BytesVec data = (struct BytesVec){.d = {0}}; + type *nextVertexPtr = data.d; + + for (unsigned vertexIdx = 0u; vertexIdx < vertexCount; ++vertexIdx) { + + if (vertexIdx > t) + __builtin_trap(); + __builtin_memcpy(nextVertexPtr, &origVertices[vertexIdx], + 2 * sizeof(type)); + nextVertexPtr += 2; + + if (needsZW) { + nextVertexPtr += 2; + } + + nextVertexPtr += paddingSize; + } + + return data; +} +Vec2 origVertices[] = { + {0, 1}, {2, 3}, {4, 5}, {6, 7}, + {8, 9}, {10, 11}, {12, 13}, {14, 15}, + {16, 17}, {18, 19}, {20, 21}, {22, 23}, + {24, 25}, {26, 27}, {27, 28}, {29, 30}, +}; + +int main() +{ + check_vect (); + struct BytesVec vec + = buildVertexBufferData(origVertices, false, 0, + sizeof(origVertices) / sizeof(origVertices[0])); + + int errors = 0; + for (unsigned i = 0; i < 100; i++) { + if (i / 2 < sizeof(origVertices) / sizeof(origVertices[0])) { + int ii = i; + int e = origVertices[ii / 2][ii % 2]; + if (vec.d[i] != e) + errors++; + } else { + if (vec.d[i] != 0) + errors++; + } + } + if (errors) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_135-pr120143.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_135-pr120143.c new file mode 100644 index 0000000..1ee30a8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_135-pr120143.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-add-options vect_early_break } */ +/* { dg-additional-options "-O3 -fwhole-program" } */ + +short a; +extern _Bool b[][23]; +short g = 6; +int v[4]; +int x[3]; +void c(short g, int v[], int x[]) { + for (;;) + for (unsigned y = 0; y < 023; y++) { + b[y][y] = v[y]; + for (_Bool aa = 0; aa < (_Bool)g; aa = x[y]) + a = a > 0; + } +} +int main() { c(g, v, x); } diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_6.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_6.c index 907637f..eeba533 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_6.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_6.c @@ -29,7 +29,7 @@ test_add (fixed_int8_t x, fixed_int8_t y) } /* -** test_add_gnu: +** test_add_gnu: {target aarch64_big_endian } ** ( ** add (z[0-9]+\.b), (?:z0\.b, z1\.b|z1\.b, z0\.b) ** ptrue (p[0-7])\.b, vl32 @@ -41,6 +41,12 @@ test_add (fixed_int8_t x, fixed_int8_t y) ** ) ** ret */ +/* +** test_add_gnu: {target aarch64_little_endian } +** add (z[0-9]+)\.b, (?:z0\.b, z1\.b|z1\.b, z0\.b) +** str \1, \[x8\] +** ret +*/ gnu_int8_t test_add_gnu (fixed_int8_t x, fixed_int8_t y) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_14.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_14.c index b65826b..d423dcf 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_14.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_14.c @@ -9,5 +9,7 @@ uint64_t f2(uint64_t *ptr, int n) { return res; } -/* { dg-final { scan-assembler-times {\tld1d\tz[0-9]+\.d,} 5 } } */ +/* { dg-final { scan-assembler-times {\tld1d\tz[0-9]+\.d,} 5 {target aarch64_big_endian} } } */ +/* { dg-final { scan-assembler-times {\tld1d\tz[0-9]+\.d,} 1 {target aarch64_little_endian} } } */ +/* { dg-final { scan-assembler-times {\tldr\tz[0-9]+,} 4 {target aarch64_little_endian} } } */ /* { dg-final { scan-assembler-times {\tadd\tz[0-9]+\.d,} 8 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_4.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_4.c index a7ecfe3..93af4c1 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_4.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_4.c @@ -9,4 +9,5 @@ vset (int *restrict dst, int *restrict src, int count) *dst++ = 1; } -/* { dg-final { scan-assembler-times {\tst1w\tz} 1 } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz} 1 {target aarch64_big_endian} } } */ +/* { dg-final { scan-assembler-times {\tstr\tz} 1 {target aarch64_little_endian} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_5.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_5.c index f3a29fc..fab49ed 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_5.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_5.c @@ -9,5 +9,6 @@ vset (int *restrict dst, int *restrict src, int count) *dst++ = 1; } -/* { dg-final { scan-assembler-times {\tst1w\tz} 2 } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz} 2 {target aarch64_big_endian} } } */ +/* { dg-final { scan-assembler-times {\tstr\tz} 2 {target aarch64_little_endian} } } */ /* { dg-final { scan-assembler-not {\tstp\tq} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_6.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_6.c index 565e1e3..160667b 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_6.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_6.c @@ -9,4 +9,5 @@ vset (int *restrict dst, int *restrict src, int count) *dst++ = 1; } -/* { dg-final { scan-assembler-times {\tst1w\tz} 1 } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz} 1 {target aarch64_big_endian} } } */ +/* { dg-final { scan-assembler-times {\tstr\tz} 1 {target aarch64_little_endian} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_7.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_7.c index 31057c0..b71c673 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_7.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_7.c @@ -9,4 +9,5 @@ vset (int *restrict dst, int *restrict src, int count) *dst++ = 1; } -/* { dg-final { scan-assembler-times {\tst1w\tz} 2 } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz} 2 {target aarch64_big_endian} } } */ +/* { dg-final { scan-assembler-times {\tstr\tz} 2 {target aarch64_little_endian} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f16.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f16.c index 50e77f9..8d480a8 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f16.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f16.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int16_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int16_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.h), #9\.0[^\n]* ** ... @@ -35,6 +44,15 @@ callee_0 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.h, #9\.0[^\n]* +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int16_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int16_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int16_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int16_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int16_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.h), #9\.0[^\n]* ** ... @@ -72,6 +99,15 @@ callee_1 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.h, #9\.0[^\n]* +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int16_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int16_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int16_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int16_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int16_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.h), #9\.0[^\n]* ** ... @@ -114,6 +159,15 @@ callee_7 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.h, #9\.0[^\n]* +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int16_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int16_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int16_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int16_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int16_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.h), #9\.0[^\n]* ** ... @@ -163,6 +229,17 @@ callee_8 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.h, #9\.0[^\n]* +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int16_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f32.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f32.c index e7b092a..b3c699d 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f32.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f32.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int32_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int32_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.s), #9\.0[^\n]* ** ... @@ -35,6 +44,15 @@ callee_0 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.s, #9\.0[^\n]* +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int32_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int32_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int32_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int32_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int32_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.s), #9\.0[^\n]* ** ... @@ -72,6 +99,15 @@ callee_1 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.s, #9\.0[^\n]* +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int32_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int32_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int32_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int32_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int32_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.s), #9\.0[^\n]* ** ... @@ -114,6 +159,15 @@ callee_7 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.s, #9\.0[^\n]* +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int32_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int32_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int32_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int32_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int32_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.s), #9\.0[^\n]* ** ... @@ -163,6 +229,17 @@ callee_8 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.s, #9\.0[^\n]* +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int32_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f64.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f64.c index c3389a8..7078afc 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f64.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_f64.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int64_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int64_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.d), #9\.0[^\n]* ** ... @@ -35,6 +44,15 @@ callee_0 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.d, #9\.0[^\n]* +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int64_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int64_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int64_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int64_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int64_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.d), #9\.0[^\n]* ** ... @@ -72,6 +99,15 @@ callee_1 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.d, #9\.0[^\n]* +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int64_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int64_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int64_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int64_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int64_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.d), #9\.0[^\n]* ** ... @@ -114,6 +159,15 @@ callee_7 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.d, #9\.0[^\n]* +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int64_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int64_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int64_t *ptr) ** ... ** ret */ +/* +** callee_8: +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int64_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int64_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** fmov (z[0-9]+\.d), #9\.0[^\n]* ** ... @@ -163,6 +229,17 @@ callee_8 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** fmov (z[0-9]+)\.d, #9\.0[^\n]* +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int64_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_mf8.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_mf8.c index 2877787..fcbac37 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_mf8.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_mf8.c @@ -8,9 +8,9 @@ /* ** callee_0: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x1\] +** ldr (z[0-9]+), \[x1\] ** ... -** st1b \1, \2, \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -32,9 +32,9 @@ callee_0 (mfloat8_t *ptr, ...) ** ... ** umov (w[0-9]+), v0.b\[0\] ** ... -** mov (z[0-9]+\.b), \1 +** mov (z[0-9]+)\.b, \1 ** ... -** st1b \2, p[0-7], \[x1\] +** str \2, \[x1\] ** ... ** ret */ @@ -47,9 +47,9 @@ caller_0 (mfloat8_t *ptr, mfloat8_t in) /* ** callee_1: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x2\] +** ldr (z[0-9]+), \[x2\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -72,9 +72,9 @@ callee_1 (mfloat8_t *ptr, ...) ** ... ** umov (w[0-9]+), v0.b\[0\] ** ... -** mov (z[0-9]+\.b), \1 +** mov (z[0-9]+)\.b, \1 ** ... -** st1b \2, p[0-7], \[x2\] +** str \2, \[x2\] ** ... ** ret */ @@ -87,9 +87,9 @@ caller_1 (mfloat8_t *ptr, mfloat8_t in) /* ** callee_7: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x7\] +** ldr (z[0-9]+), \[x7\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -117,9 +117,9 @@ callee_7 (mfloat8_t *ptr, ...) ** ... ** umov (w[0-9]+), v0.b\[0\] ** ... -** mov (z[0-9]+\.b), \1 +** mov (z[0-9]+)\.b, \1 ** ... -** st1b \2, p[0-7], \[x7\] +** str \2, \[x7\] ** ... ** ret */ @@ -136,9 +136,9 @@ caller_7 (mfloat8_t *ptr, mfloat8_t in) ** ... ** ldr (x[0-9]+), \[sp, \1\] ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[\2\] +** ldr (z[0-9]+), \[\2\] ** ... -** st1b \3, \4, \[x0\] +** str \3, \[x0\] ** ... ** ret */ @@ -167,9 +167,9 @@ callee_8 (mfloat8_t *ptr, ...) ** ... ** umov (w[0-9]+), v0.b\[0\] ** ... -** mov (z[0-9]+\.b), \1 +** mov (z[0-9]+)\.b, \1 ** ... -** st1b \2, p[0-7], \[(x[0-9]+)\] +** str \2, \[(x[0-9]+)\] ** ... ** str \3, \[sp\] ** ... diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s16.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s16.c index 3c644e1..e65e64f 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s16.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s16.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int16_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int16_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int16_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int16_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int16_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int16_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int16_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int16_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int16_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int16_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int16_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int16_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int16_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int16_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int16_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int16_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int16_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int16_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s32.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s32.c index 652d609..6488a5f 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s32.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s32.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int32_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int32_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int32_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int32_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int32_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int32_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int32_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int32_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int32_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int32_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int32_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int32_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int32_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int32_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int32_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int32_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int32_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int32_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s64.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s64.c index 72ea6a3..4b77b4f 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s64.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s64.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int64_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int64_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int64_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int64_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int64_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int64_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int64_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int64_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int64_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int64_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int64_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int64_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int64_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int64_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int64_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int64_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int64_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int64_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s8.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s8.c index 02f4bec..e686b3e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s8.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_s8.c @@ -8,9 +8,9 @@ /* ** callee_0: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x1\] +** ldr (z[0-9]+), \[x1\] ** ... -** st1b \1, \2, \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -29,9 +29,9 @@ callee_0 (int8_t *ptr, ...) /* ** caller_0: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x1\] +** str \1, \[x1\] ** ... ** ret */ @@ -44,9 +44,9 @@ caller_0 (int8_t *ptr) /* ** callee_1: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x2\] +** ldr (z[0-9]+), \[x2\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -66,9 +66,9 @@ callee_1 (int8_t *ptr, ...) /* ** caller_1: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x2\] +** str \1, \[x2\] ** ... ** ret */ @@ -81,9 +81,9 @@ caller_1 (int8_t *ptr) /* ** callee_7: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x7\] +** ldr (z[0-9]+), \[x7\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -108,9 +108,9 @@ callee_7 (int8_t *ptr, ...) /* ** caller_7: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x7\] +** str \1, \[x7\] ** ... ** ret */ @@ -127,9 +127,9 @@ caller_7 (int8_t *ptr) ** ... ** ldr (x[0-9]+), \[sp, \1\] ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[\2\] +** ldr (z[0-9]+), \[\2\] ** ... -** st1b \3, \4, \[x0\] +** str \3, \[x0\] ** ... ** ret */ @@ -155,9 +155,9 @@ callee_8 (int8_t *ptr, ...) /* ** caller_8: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[(x[0-9]+)\] +** str \1, \[(x[0-9]+)\] ** ... ** str \2, \[sp\] ** ... diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u16.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u16.c index b60d448..74ef4da 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u16.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u16.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int16_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int16_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int16_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int16_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int16_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int16_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int16_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int16_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int16_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1h (z[0-9]+\.h), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int16_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int16_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int16_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int16_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int16_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int16_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int16_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int16_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.h), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int16_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.h, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int16_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u32.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u32.c index 5f01464..4f9ff78 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u32.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u32.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int32_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int32_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int32_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int32_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int32_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int32_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int32_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int32_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int32_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1w (z[0-9]+\.s), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int32_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int32_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int32_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int32_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int32_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int32_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int32_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int32_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.s), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int32_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.s, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int32_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u64.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u64.c index 986739f..27e437b 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u64.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u64.c @@ -6,7 +6,7 @@ #include <stdarg.h> /* -** callee_0: +** callee_0: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x1\] ** ... @@ -14,6 +14,15 @@ ** ... ** ret */ +/* +** callee_0: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x1\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_0 (int64_t *ptr, ...) { @@ -27,7 +36,7 @@ callee_0 (int64_t *ptr, ...) } /* -** caller_0: +** caller_0: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -35,6 +44,15 @@ callee_0 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_0: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x1\] +** ... +** ret +*/ void __attribute__((noipa)) caller_0 (int64_t *ptr) { @@ -42,7 +60,7 @@ caller_0 (int64_t *ptr) } /* -** callee_1: +** callee_1: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x2\] ** ... @@ -50,6 +68,15 @@ caller_0 (int64_t *ptr) ** ... ** ret */ +/* +** callee_1: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x2\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_1 (int64_t *ptr, ...) { @@ -64,7 +91,7 @@ callee_1 (int64_t *ptr, ...) } /* -** caller_1: +** caller_1: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -72,6 +99,15 @@ callee_1 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_1: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x2\] +** ... +** ret +*/ void __attribute__((noipa)) caller_1 (int64_t *ptr) { @@ -79,7 +115,7 @@ caller_1 (int64_t *ptr) } /* -** callee_7: +** callee_7: {target aarch64_big_endian} ** ... ** ld1d (z[0-9]+\.d), (p[0-7])/z, \[x7\] ** ... @@ -87,6 +123,15 @@ caller_1 (int64_t *ptr) ** ... ** ret */ +/* +** callee_7: {target aarch64_little_endian} +** ... +** ldr (z[0-9]+), \[x7\] +** ... +** str \1, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_7 (int64_t *ptr, ...) { @@ -106,7 +151,7 @@ callee_7 (int64_t *ptr, ...) } /* -** caller_7: +** caller_7: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -114,6 +159,15 @@ callee_7 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_7: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[x7\] +** ... +** ret +*/ void __attribute__((noipa)) caller_7 (int64_t *ptr) { @@ -122,7 +176,7 @@ caller_7 (int64_t *ptr) /* FIXME: We should be able to get rid of the va_list object. */ /* -** callee_8: +** callee_8: {target aarch64_big_endian} ** sub sp, sp, #([0-9]+) ** ... ** ldr (x[0-9]+), \[sp, \1\] @@ -133,6 +187,18 @@ caller_7 (int64_t *ptr) ** ... ** ret */ +/* +** callee_8: {target aarch64_little_endian} +** sub sp, sp, #([0-9]+) +** ... +** ldr (x[0-9]+), \[sp, \1\] +** ... +** ldr (z[0-9]+), \[\2\] +** ... +** str \3, \[x0\] +** ... +** ret +*/ void __attribute__((noipa)) callee_8 (int64_t *ptr, ...) { @@ -153,7 +219,7 @@ callee_8 (int64_t *ptr, ...) } /* -** caller_8: +** caller_8: {target aarch64_big_endian} ** ... ** mov (z[0-9]+\.d), #42 ** ... @@ -163,6 +229,17 @@ callee_8 (int64_t *ptr, ...) ** ... ** ret */ +/* +** caller_8: {target aarch64_little_endian} +** ... +** mov (z[0-9]+)\.d, #42 +** ... +** str \1, \[(x[0-9]+)\] +** ... +** str \2, \[sp\] +** ... +** ret +*/ void __attribute__((noipa)) caller_8 (int64_t *ptr) { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u8.c b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u8.c index 533cba67..d43a6da 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u8.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/varargs_2_u8.c @@ -8,9 +8,9 @@ /* ** callee_0: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x1\] +** ldr (z[0-9]+), \[x1\] ** ... -** st1b \1, \2, \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -29,9 +29,9 @@ callee_0 (int8_t *ptr, ...) /* ** caller_0: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x1\] +** str \1, \[x1\] ** ... ** ret */ @@ -44,9 +44,9 @@ caller_0 (int8_t *ptr) /* ** callee_1: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x2\] +** ldr (z[0-9]+), \[x2\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -66,9 +66,9 @@ callee_1 (int8_t *ptr, ...) /* ** caller_1: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x2\] +** str \1, \[x2\] ** ... ** ret */ @@ -81,9 +81,9 @@ caller_1 (int8_t *ptr) /* ** callee_7: ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[x7\] +** ldr (z[0-9]+), \[x7\] ** ... -** st1b \1, p[0-7], \[x0\] +** str \1, \[x0\] ** ... ** ret */ @@ -108,9 +108,9 @@ callee_7 (int8_t *ptr, ...) /* ** caller_7: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[x7\] +** str \1, \[x7\] ** ... ** ret */ @@ -127,9 +127,9 @@ caller_7 (int8_t *ptr) ** ... ** ldr (x[0-9]+), \[sp, \1\] ** ... -** ld1b (z[0-9]+\.b), (p[0-7])/z, \[\2\] +** ldr (z[0-9]+), \[\2\] ** ... -** st1b \3, \4, \[x0\] +** str \3, \[x0\] ** ... ** ret */ @@ -155,9 +155,9 @@ callee_8 (int8_t *ptr, ...) /* ** caller_8: ** ... -** mov (z[0-9]+\.b), #42 +** mov (z[0-9]+)\.b, #42 ** ... -** st1b \1, p[0-7], \[(x[0-9]+)\] +** str \1, \[(x[0-9]+)\] ** ... ** str \2, \[sp\] ** ... diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_2.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_2.c index 985cd0c..f07900b 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_2.c @@ -19,5 +19,7 @@ foo (void) /* We should operate on aligned vectors. */ /* { dg-final { scan-assembler {\t(adrp|adr)\tx[0-9]+, (x|\.LANCHOR0)\n} } } */ /* We should unroll the loop three times. */ -/* { dg-final { scan-assembler-times "\tst1w\t" 3 } } */ +/* { dg-final { scan-assembler-times "\tst1w\t" 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times "\tst1w\t" 2 { target aarch64_little_endian } } } */ +/* { dg-final { scan-assembler-times "\tstr\t" 1 { target aarch64_little_endian } } } */ /* { dg-final { scan-assembler {\tptrue\t(p[0-9]+)\.s, vl7\n.*\teor\tp[0-9]+\.b, (p[0-9]+)/z, (\1\.b, \2\.b|\2\.b, \1\.b)\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/ptrue_ldr_str.c b/gcc/testsuite/gcc.target/aarch64/sve/ptrue_ldr_str.c new file mode 100644 index 0000000..c3bfa98 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/ptrue_ldr_str.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-require-effective-target aarch64_little_endian } */ + +#include <arm_sve.h> + +#define TEST(TYPE, TY, B) \ + sv##TYPE ld_##TY (TYPE *x) \ + { \ + return svld1_##TY(svptrue_b##B (), x); \ + } \ + void st_##TY (TYPE *x, sv##TYPE data) \ + { \ + svst1_##TY(svptrue_b##B (), x, data); \ + } + +TEST(bfloat16_t, bf16, 16) +TEST(float16_t, f16, 16) +TEST(float32_t, f32, 32) +TEST(float64_t, f64, 64) +TEST(uint8_t, u8, 8) +TEST(uint16_t, u16, 16) +TEST(uint32_t, u32, 32) +TEST(uint64_t, u64, 64) +TEST(int8_t, s8, 8) +TEST(int16_t, s16, 16) +TEST(int32_t, s32, 32) +TEST(int64_t, s64, 64) + +/* { dg-final { scan-assembler-times {\tldr\tz0, \[x0\]} 12 } } */ +/* { dg-final { scan-assembler-times {\tstr\tz0, \[x0\]} 12 } } */
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/sve/single_1.c b/gcc/testsuite/gcc.target/aarch64/sve/single_1.c index d9bb97e..be71921 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/single_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/single_1.c @@ -40,12 +40,13 @@ TEST_LOOP (double, 3.0) /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.s, #2\.0e\+0\n} 1 } } */ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.d, #3\.0e\+0\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl32\n} 11 } } */ +/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl32\n} 9 { target aarch64_big_endian } } } */ -/* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.b,} 2 } } */ -/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 } } */ +/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 2 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 11 { target aarch64_little_endian } } } */ /* { dg-final { scan-assembler-not {\twhile} } } */ /* { dg-final { scan-assembler-not {\tb} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/single_2.c b/gcc/testsuite/gcc.target/aarch64/sve/single_2.c index d27eead..8692984 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/single_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/single_2.c @@ -16,12 +16,13 @@ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.s, #2\.0e\+0\n} 1 } } */ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.d, #3\.0e\+0\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl64\n} 11 } } */ +/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl64\n} 9 { target aarch64_big_endian } } } */ -/* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.b,} 2 } } */ -/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 } } */ +/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 2 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 11 { target aarch64_little_endian } } } */ /* { dg-final { scan-assembler-not {\twhile} } } */ /* { dg-final { scan-assembler-not {\tb} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/single_3.c b/gcc/testsuite/gcc.target/aarch64/sve/single_3.c index 313a72d..10799fd 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/single_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/single_3.c @@ -16,12 +16,13 @@ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.s, #2\.0e\+0\n} 1 } } */ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.d, #3\.0e\+0\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl128\n} 11 } } */ +/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl128\n} 9 { target aarch64_big_endian } } } */ -/* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.b,} 2 } } */ -/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 } } */ +/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 2 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 11 { target aarch64_little_endian } } } */ /* { dg-final { scan-assembler-not {\twhile} } } */ /* { dg-final { scan-assembler-not {\tb} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/single_4.c b/gcc/testsuite/gcc.target/aarch64/sve/single_4.c index 4f46654..53658a8 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/single_4.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/single_4.c @@ -16,12 +16,13 @@ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.s, #2\.0e\+0\n} 1 } } */ /* { dg-final { scan-assembler-times {\tfmov\tz[0-9]+\.d, #3\.0e\+0\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl256\n} 11 } } */ +/* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, vl256\n} 9 { target aarch64_big_endian } } } */ -/* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.b,} 2 } } */ -/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 } } */ -/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 } } */ +/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 3 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 2 { target aarch64_big_endian } } } */ +/* { dg-final { scan-assembler-times {\tstr\tz[0-9]+, \[x0\]} 11 { target aarch64_little_endian } } } */ /* { dg-final { scan-assembler-not {\twhile} } } */ /* { dg-final { scan-assembler-not {\tb} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c b/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c index 22a48c8..0f35ddd 100644 --- a/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c +++ b/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c @@ -1,6 +1,6 @@ /* { dg-do run { target ilp32 } } */ /* { dg-options "-O2 -mpowerpc64" } */ -/* { dg-require-effective-target has_arch_ppc64 } */ +/* { dg-require-effective-target powerpc64 } */ /* { dg-timeout-factor 2 } */ /* Verify memcmp on m32 mpowerpc64 */ diff --git a/gcc/testsuite/gcc.target/riscv/arch-48.c b/gcc/testsuite/gcc.target/riscv/arch-48.c new file mode 100644 index 0000000..58a558e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/arch-48.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc_zama16b -mabi=lp64" } */ +int foo() +{ +} diff --git a/gcc/testsuite/gcc.target/riscv/ior-synthesis-1.c b/gcc/testsuite/gcc.target/riscv/ior-synthesis-1.c new file mode 100644 index 0000000..04644cd --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/ior-synthesis-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gb -mabi=lp64d" } */ + +unsigned long foo(unsigned long src) { return src | 0x8c00000000000001; } + +/* { dg-final { scan-assembler-times "\\srori\t" 2 } } */ +/* { dg-final { scan-assembler-times "\\sori\t" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/ior-synthesis-2.c b/gcc/testsuite/gcc.target/riscv/ior-synthesis-2.c new file mode 100644 index 0000000..f28fe5e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/ior-synthesis-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gb -mabi=lp64d" } */ + +unsigned long foo(unsigned long src) { return src | 0x8800000000000007; } + +/* { dg-final { scan-assembler-times "\\sbseti\t" 2 } } */ +/* { dg-final { scan-assembler-times "\\sori\t" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/pr120137.c b/gcc/testsuite/gcc.target/riscv/pr120137.c new file mode 100644 index 0000000..c55a1c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr120137.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl256b -mrvv-vector-bits=zvl -mabi=lp64" } */ + +char b[13][13]; +void c() { + for (int d = 0; d < 13; ++d) + for (int e = 0; e < 13; ++e) + b[d][e] = e == 0 ? -98 : 38; +} + + + diff --git a/gcc/testsuite/gcc.target/riscv/pr120154.c b/gcc/testsuite/gcc.target/riscv/pr120154.c new file mode 100644 index 0000000..fd849ca --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr120154.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gv -mabi=lp64" } */ + + + +typedef __attribute__((__vector_size__(4))) char V; + +V g; + +V +bar(V a, V b) +{ + V s = a + b + g; + return s; +} + +V +foo() +{ + return bar((V){20}, (V){23, 150}); +} + diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h index 66654eb..db802bd 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h @@ -3,15 +3,59 @@ #include <stdint.h> -#define DEF_VX_BINARY(T, OP) \ -void \ -test_vx_binary (T * restrict out, T * restrict in, T x, unsigned n) \ -{ \ - for (unsigned i = 0; i < n; i++) \ - out[i] = in[i] OP x; \ +#define DEF_VX_BINARY_CASE_0(T, OP) \ +void \ +test_vx_binary_case_0 (T * restrict out, T * restrict in, T x, unsigned n) \ +{ \ + for (unsigned i = 0; i < n; i++) \ + out[i] = in[i] OP x; \ } -#define DEF_VX_BINARY_WRAP(T, OP) DEF_VX_BINARY(T, OP) -#define RUN_VX_BINARY(out, in, x, n) test_vx_binary(out, in, x, n) -#define RUN_VX_BINARY_WRAP(out, in, x, n) RUN_VX_BINARY(out, in, x, n) +#define DEF_VX_BINARY_CASE_0_WRAP(T, OP) DEF_VX_BINARY_CASE_0(T, OP) +#define RUN_VX_BINARY_CASE_0(out, in, x, n) test_vx_binary_case_0(out, in, x, n) +#define RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) RUN_VX_BINARY_CASE_0(out, in, x, n) + +#define VX_BINARY_BODY(op) \ + out[k + 0] = in[k + 0] op tmp; \ + out[k + 1] = in[k + 1] op tmp; \ + k += 2; + +#define VX_BINARY_BODY_X4(op) \ + VX_BINARY_BODY(op) \ + VX_BINARY_BODY(op) + +#define VX_BINARY_BODY_X8(op) \ + VX_BINARY_BODY_X4(op) \ + VX_BINARY_BODY_X4(op) + +#define VX_BINARY_BODY_X16(op) \ + VX_BINARY_BODY_X8(op) \ + VX_BINARY_BODY_X8(op) + +#define VX_BINARY_BODY_X32(op) \ + VX_BINARY_BODY_X16(op) \ + VX_BINARY_BODY_X16(op) + +#define VX_BINARY_BODY_X64(op) \ + VX_BINARY_BODY_X32(op) \ + VX_BINARY_BODY_X32(op) + +#define VX_BINARY_BODY_X128(op) \ + VX_BINARY_BODY_X64(op) \ + VX_BINARY_BODY_X64(op) + +#define DEF_VX_BINARY_CASE_1(T, OP, BODY) \ +void \ +test_vx_binary_case_1 (T * restrict out, T * restrict in, T x, unsigned n) \ +{ \ + unsigned k = 0; \ + T tmp = x + 3; \ + \ + while (k < n) \ + { \ + tmp = tmp ^ 0x3f; \ + BODY(OP) \ + } \ +} +#define DEF_VX_BINARY_CASE_1_WRAP(T, OP, BODY) DEF_VX_BINARY_CASE_1(T, OP, BODY) #endif diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i16.c index 488bc75..6de21a8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int16_t, +) +DEF_VX_BINARY_CASE_0(int16_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i32.c index aeba835..f46be7a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int32_t, +) +DEF_VX_BINARY_CASE_0(int32_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i64.c index ed0b937..2b57b28 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int64_t, +) +DEF_VX_BINARY_CASE_0(int64_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i8.c index 781d3c0..e139284 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-i8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int8_t, +) +DEF_VX_BINARY_CASE_0(int8_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u16.c index c01fc23..0266d44 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint16_t, +) +DEF_VX_BINARY_CASE_0(uint16_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u32.c index 63198492..c541733 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint32_t, +) +DEF_VX_BINARY_CASE_0(uint32_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u64.c index 36eec53..e9e2162 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint64_t, +) +DEF_VX_BINARY_CASE_0(uint64_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u8.c index 6bf4b61..da71fff 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-1-u8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint8_t, +) +DEF_VX_BINARY_CASE_0(uint8_t, +) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i16.c index eb19938..b40d0b8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int16_t, +) +DEF_VX_BINARY_CASE_0(int16_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i32.c index 24182c5..af3a40d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int32_t, +) +DEF_VX_BINARY_CASE_0(int32_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i64.c index b3d3d4b..5f7c51c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int64_t, +) +DEF_VX_BINARY_CASE_0(int64_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i8.c index fb35315..420cf0e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-i8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int8_t, +) +DEF_VX_BINARY_CASE_0(int8_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u16.c index 6ba2658..7741d06 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint16_t, +) +DEF_VX_BINARY_CASE_0(uint16_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u32.c index b60412c..10ff20e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint32_t, +) +DEF_VX_BINARY_CASE_0(uint32_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u64.c index a273294..fa5ab40 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint64_t, +) +DEF_VX_BINARY_CASE_0(uint64_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u8.c index f3c41f9..0374e1f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-2-u8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint8_t, +) +DEF_VX_BINARY_CASE_0(uint8_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i16.c index f3a2627..f766907 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int16_t, +) +DEF_VX_BINARY_CASE_0(int16_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i32.c index 490854c..1b47a59 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int32_t, +) +DEF_VX_BINARY_CASE_0(int32_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i64.c index a7448df..92ab1e8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int64_t, +) +DEF_VX_BINARY_CASE_0(int64_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i8.c index 72c7cd8..444707e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-i8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(int8_t, +) +DEF_VX_BINARY_CASE_0(int8_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u16.c index 552b4ed..e3fc112 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u16.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint16_t, +) +DEF_VX_BINARY_CASE_0(uint16_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u32.c index e319672..f76971b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u32.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint32_t, +) +DEF_VX_BINARY_CASE_0(uint32_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u64.c index 6e2a89e..09a4b42 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u64.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint64_t, +) +DEF_VX_BINARY_CASE_0(uint64_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u8.c index d3383e2..5a0679f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-3-u8.c @@ -3,6 +3,6 @@ #include "vx_binary.h" -DEF_VX_BINARY(uint8_t, +) +DEF_VX_BINARY_CASE_0(uint8_t, +) /* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i16.c new file mode 100644 index 0000000..9a26601 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i16.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int16_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i32.c new file mode 100644 index 0000000..55b51fc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i64.c new file mode 100644 index 0000000..8ad6098 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i8.c new file mode 100644 index 0000000..193e020 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-i8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u16.c new file mode 100644 index 0000000..a093fca --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u16.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint16_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u32.c new file mode 100644 index 0000000..9f5843b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u64.c new file mode 100644 index 0000000..0f00688 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u8.c new file mode 100644 index 0000000..47707e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-4-u8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i16.c new file mode 100644 index 0000000..e5ec888 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i16.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int16_t, +, VX_BINARY_BODY_X8) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i32.c new file mode 100644 index 0000000..ed6c22d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i64.c new file mode 100644 index 0000000..ef44012 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i8.c new file mode 100644 index 0000000..d61f9df --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-i8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u16.c new file mode 100644 index 0000000..3d1ba7f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u16.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint16_t, +, VX_BINARY_BODY_X8) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u32.c new file mode 100644 index 0000000..2e9862b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u64.c new file mode 100644 index 0000000..72e6786 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u8.c new file mode 100644 index 0000000..e935be1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-5-u8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=1" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i16.c new file mode 100644 index 0000000..d80f0c0 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i16.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int16_t, +, VX_BINARY_BODY_X8) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i32.c new file mode 100644 index 0000000..99f6614 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i64.c new file mode 100644 index 0000000..ab06c51 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i8.c new file mode 100644 index 0000000..7ead9d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-i8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(int8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u16.c new file mode 100644 index 0000000..79b754b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u16.c @@ -0,0 +1,9 @@ + +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint16_t, +, VX_BINARY_BODY_X8) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u32.c new file mode 100644 index 0000000..2f70dcd --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u32.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint32_t, +, VX_BINARY_BODY_X4) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u64.c new file mode 100644 index 0000000..8094a2c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u64.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint64_t, +, VX_BINARY_BODY) + +/* { dg-final { scan-assembler-not {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u8.c new file mode 100644 index 0000000..56d040b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-6-u8.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvl128b -mabi=lp64d --param=gpr2vr-cost=2" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_1(uint8_t, +, VX_BINARY_BODY_X16) + +/* { dg-final { scan-assembler {vadd.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i16.c index fb5375d..306ad76 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i16.c @@ -6,9 +6,9 @@ #define T int16_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i32.c index c2c79f5..6ccdf7a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i32.c @@ -6,9 +6,9 @@ #define T int32_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i64.c index 541ed21..9484aa8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i64.c @@ -6,9 +6,9 @@ #define T int64_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i8.c index d507bbb..aeb330e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-i8.c @@ -6,9 +6,9 @@ #define T int8_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u16.c index 52c0749..dafaa29 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u16.c @@ -6,9 +6,9 @@ #define T uint16_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u32.c index 70dc347..6b285c8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u32.c @@ -6,9 +6,9 @@ #define T uint32_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u64.c index 6ce0060..eeee4e1 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u64.c @@ -6,9 +6,9 @@ #define T uint64_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u8.c index a0e80b7..22d7a0e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vadd-run-1-u8.c @@ -6,9 +6,9 @@ #define T uint8_t -DEF_VX_BINARY_WRAP(T, +) +DEF_VX_BINARY_CASE_0_WRAP(T, +) #define TEST_DATA TEST_BINARY_DATA_WRAP(T, vadd) -#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_WRAP(out, in, x, n) +#define TEST_RUN(out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(out, in, x, n) #include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/crc-builtin-zvbc.c b/gcc/testsuite/gcc.target/riscv/rvv/base/crc-builtin-zvbc.c new file mode 100644 index 0000000..2d5fa88 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/crc-builtin-zvbc.c @@ -0,0 +1,66 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvbc -mabi=lp64d" } */ + +#include <stdint-gcc.h> + +int8_t crc8_data8 () +{ + return __builtin_crc8_data8 (0x34, 'a', 0x12); +} + +int16_t crc16_data8 () +{ + return __builtin_crc16_data8 (0x1234, 'a', 0x1021); +} + +int16_t crc16_data16 () +{ + return __builtin_crc16_data16 (0x1234, 0x3214, 0x1021); +} + +int32_t crc32_data8 () +{ + return __builtin_crc32_data8 (0xffffffff, 0x32, 0x4002123); +} + +int32_t crc32_data16 () +{ + return __builtin_crc32_data16 (0xffffffff, 0x3232, 0x4002123); +} + +int32_t crc32_data32 () +{ + return __builtin_crc32_data32 (0xffffffff, 0x123546ff, 0x4002123); +} + +int8_t rev_crc8_data8 () +{ + return __builtin_rev_crc8_data8 (0x34, 'a', 0x12); +} + +int16_t rev_crc16_data8 () +{ + return __builtin_rev_crc16_data8 (0x1234, 'a', 0x1021); +} + +int16_t rev_crc16_data16 () +{ + return __builtin_rev_crc16_data16 (0x1234, 0x3214, 0x1021); +} + +int32_t rev_crc32_data8 () +{ + return __builtin_rev_crc32_data8 (0xffffffff, 0x32, 0x4002123); +} + +int32_t rev_crc32_data16 () +{ + return __builtin_rev_crc32_data16 (0xffffffff, 0x3232, 0x4002123); +} + +int32_t rev_crc32_data32 () +{ + return __builtin_rev_crc32_data32 (0xffffffff, 0x123546ff, 0x4002123); +} +/* { dg-final { scan-assembler-times "vclmul.vx" 12 } } */ +/* { dg-final { scan-assembler-times "vclmulh.vx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp b/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp index 4283d12..d76a2d7 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp +++ b/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp @@ -130,6 +130,21 @@ foreach op $AUTOVEC_TEST_OPTS { "$op" "" dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/autovec/sat/*.\[cS\]]] \ "$op" "" +} + +# vx_vf tests +set AUTOVEC_TEST_OPTS [list \ + {-ftree-vectorize -O3 -mrvv-vector-bits=zvl -mrvv-max-lmul=m1 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=zvl -mrvv-max-lmul=m2 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=zvl -mrvv-max-lmul=m4 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=zvl -mrvv-max-lmul=m8 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=zvl -mrvv-max-lmul=dynamic -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=m1 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=m2 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=m4 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=m8 -ffast-math} \ + {-ftree-vectorize -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=dynamic -ffast-math} ] +foreach op $AUTOVEC_TEST_OPTS { dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/autovec/vx_vf/*.\[cS\]]] \ "$op" "" } diff --git a/gcc/testsuite/gcc.target/riscv/xor-synthesis-1.c b/gcc/testsuite/gcc.target/riscv/xor-synthesis-1.c new file mode 100644 index 0000000..c630a79 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/xor-synthesis-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gb -mabi=lp64d" } */ + +unsigned long foo(unsigned long src) { return src ^ 0xffffffffefffffffUL; } + +/* { dg-final { scan-assembler-times "\\sbinvi\t" 1 } } */ +/* { dg-final { scan-assembler-times "\\snot\t" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/xor-synthesis-2.c b/gcc/testsuite/gcc.target/riscv/xor-synthesis-2.c new file mode 100644 index 0000000..25457d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/xor-synthesis-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gb -mabi=lp64d" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Og" } } */ + +unsigned long foo(unsigned long src) { return src ^ 0x8800000000000007; } + +/* xfailed until we remove mvconst_internal. */ +/* { dg-final { scan-assembler-times "\\sbinvi\t" 2 { xfail *-*-* } } } */ +/* { dg-final { scan-assembler-times "\\sxori\t" 1 { xfail *-*-* } } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/xor-synthesis-3.c b/gcc/testsuite/gcc.target/riscv/xor-synthesis-3.c new file mode 100644 index 0000000..765904b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/xor-synthesis-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gb -mabi=lp64d" } */ + +unsigned long foo(unsigned long src) { return src ^ 0x8c00000000000001; } + +/* { dg-final { scan-assembler-times "\\srori\t" 2 } } */ +/* { dg-final { scan-assembler-times "\\sxori\t" 1 } } */ + diff --git a/gcc/testsuite/gfortran.dg/do_concurrent_basic.f90 b/gcc/testsuite/gfortran.dg/do_concurrent_basic.f90 index fe8723d..bdb6e0e 100644 --- a/gcc/testsuite/gfortran.dg/do_concurrent_basic.f90 +++ b/gcc/testsuite/gfortran.dg/do_concurrent_basic.f90 @@ -1,4 +1,4 @@ -! { dg-do run } +! { dg-do compile } program basic_do_concurrent implicit none integer :: i, arr(10) @@ -7,5 +7,8 @@ program basic_do_concurrent arr(i) = i end do + do concurrent (i=1:10);enddo + do,concurrent (i=1:10);arr(i)=i;enddo + print *, arr -end program basic_do_concurrent
\ No newline at end of file +end program basic_do_concurrent diff --git a/gcc/testsuite/gfortran.dg/pr120152_1.f90 b/gcc/testsuite/gfortran.dg/pr120152_1.f90 new file mode 100644 index 0000000..c49197d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120152_1.f90 @@ -0,0 +1,52 @@ +! PR libfortran/120152 +! { dg-do run } + +subroutine f1 + integer(kind=8) :: a (10, 10, 10), b (10, 10) + logical :: c (10, 10, 10) + a = 0 + c = .true. + b = maxloc (a, 2, c, 8, .true.) +end +subroutine f2 + integer(kind=8) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + logical :: c (10, 10, 10) + a = 0 + c = .true. + b = maxloc (a, 2, c, 4, .true.) +end +subroutine f3 + integer(kind=8) :: a (10, 10, 10), b (10, 10) + a = 0 + b = maxloc (a, 2, kind=8, back=.true.) +end +subroutine f4 + integer(kind=8) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + a = 0 + b = maxloc (a, 2, kind=4, back=.true.) +end +subroutine f5 + integer(kind=8) :: a (10, 10, 10), b (10, 10) + logical :: c + a = 0 + c = .false. + b = maxloc (a, 2, c, 8, .true.) +end +subroutine f6 + integer(kind=8) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + logical :: c + a = 0 + c = .false. + b = maxloc (a, 2, c, 4, .true.) +end +program pr120152 + call f1 + call f2 + call f3 + call f4 + call f5 + call f6 +end diff --git a/gcc/testsuite/gfortran.dg/pr120152_2.f90 b/gcc/testsuite/gfortran.dg/pr120152_2.f90 new file mode 100644 index 0000000..39cfb28 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120152_2.f90 @@ -0,0 +1,80 @@ +! PR libfortran/120152 +! { dg-do run { target fortran_large_int } } + +subroutine f1 + integer(kind=16) :: a (10, 10, 10) + integer(kind=8) :: b (10, 10) + logical :: c (10, 10, 10) + a = 0 + c = .true. + b = maxloc (a, 2, c, 8, .true.) +end +subroutine f2 + integer(kind=16) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + logical :: c (10, 10, 10) + a = 0 + c = .true. + b = maxloc (a, 2, c, 4, .true.) +end +subroutine f3 + integer(kind=16) :: a (10, 10, 10) + integer(kind=8) :: b (10, 10) + a = 0 + b = maxloc (a, 2, kind=8, back=.true.) +end +subroutine f4 + integer(kind=16) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + a = 0 + b = maxloc (a, 2, kind=4, back=.true.) +end +subroutine f5 + integer(kind=16) :: a (10, 10, 10) + integer(kind=8) :: b (10, 10) + logical :: c + a = 0 + c = .false. + b = maxloc (a, 2, c, 8, .true.) +end +subroutine f6 + integer(kind=16) :: a (10, 10, 10) + integer(kind=4) :: b (10, 10) + logical :: c + a = 0 + c = .false. + b = maxloc (a, 2, c, 4, .true.) +end +subroutine f7 + integer(kind=8) :: a (10, 10, 10) + integer(kind=16) :: b (10, 10) + logical :: c (10, 10, 10) + a = 0 + c = .true. + b = maxloc (a, 2, c, 16, .true.) +end +subroutine f8 + integer(kind=8) :: a (10, 10, 10) + integer(kind=16) :: b (10, 10) + a = 0 + b = maxloc (a, 2, kind=16, back=.true.) +end +subroutine f9 + integer(kind=8) :: a (10, 10, 10) + integer(kind=16) :: b (10, 10) + logical :: c + a = 0 + c = .false. + b = maxloc (a, 2, c, 16, .true.) +end +program pr120152 + call f1 + call f2 + call f3 + call f4 + call f5 + call f6 + call f7 + call f8 + call f9 +end diff --git a/gcc/testsuite/gfortran.dg/pr120153.f90 b/gcc/testsuite/gfortran.dg/pr120153.f90 new file mode 100644 index 0000000..22a7849 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120153.f90 @@ -0,0 +1,36 @@ +! PR libfortran/120153 +! { dg-do run { target fortran_large_int } } +! { dg-additional-options "-funsigned" } + +subroutine f1 + unsigned(kind=16) :: a (10, 10, 10) + integer(kind=16) :: b (10, 10) + logical :: c (10, 10, 10) + a = 0u_16 + c = .true. + b = maxloc (a, 2, c, 16, .true.) +end +subroutine f2 + unsigned(kind=16) :: a (10, 10, 10) + integer(kind=16) :: b (10, 10) + a = 0u_16 + b = maxloc (a, 2, kind=16, back=.true.) +end +subroutine f3 + unsigned(kind=16) :: a (10, 10, 10) + integer(kind=8) :: b (10, 10) + logical :: c + a = 0u_16 + c = .false. + b = maxloc (a, 2, c, 16, .true.) +end +subroutine f4 + unsigned(kind=16) :: a (5, 5, 5) + call random_number (a) +end +program pr120153 + call f1 + call f2 + call f3 + call f4 +end diff --git a/gcc/testsuite/gfortran.dg/pr120158.f90 b/gcc/testsuite/gfortran.dg/pr120158.f90 new file mode 100644 index 0000000..593f4bc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120158.f90 @@ -0,0 +1,15 @@ +! PR libfortran/120158 +! { dg-do run { target fortran_large_int } } +! { dg-additional-options "-funsigned" } + + unsigned(kind=8) :: a(10, 10, 10), b(10, 10) + integer(kind=8) :: c(10, 10), d(10, 10) + a = 0u_8 + if (maxval (a) .ne. 0u_8) stop 1 + b = maxval (a, 1) + if (any (b .ne. 0u_8)) stop 2 + c = maxloc (a, 1) + d = maxloc (a, 2, back=.true.) + if (any (c .ne. 1)) stop 3 + if (any (d .ne. 10)) stop 4 +end diff --git a/gcc/testsuite/gnat.dg/opt106.adb b/gcc/testsuite/gnat.dg/opt106.adb new file mode 100644 index 0000000..525930b --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt106.adb @@ -0,0 +1,11 @@ +-- { dg-do run } +-- { dg-options "-O2" } + +with Opt106_Pkg1; use Opt106_Pkg1; + +procedure Opt106 is + Obj : T := (False, 0, 0, 0, True); + +begin + Proc (Obj, 0, False, True); +end; diff --git a/gcc/testsuite/gnat.dg/opt106_pkg1.adb b/gcc/testsuite/gnat.dg/opt106_pkg1.adb new file mode 100644 index 0000000..154b13f --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt106_pkg1.adb @@ -0,0 +1,39 @@ +with Opt106_Pkg2; use Opt106_Pkg2; + +package body Opt106_Pkg1 is + + procedure Proc (Obj : in out T; + Data : Integer; + Last : Boolean; + Stretch : Boolean) is + + begin + if Stretch and then (Obj.Delayed /= 0 or else not Obj.Attach_Last) then + raise Program_Error; + end if; + + if Obj.Delayed /= 0 then + Stop (Obj.Delayed, Obj.Before, Data, False); + end if; + + if Last or (Obj.Delayed = 0 and not Stretch) then + Stop (Data, Obj.Before, 0, Last); + + if Last then + Obj.Initialized := False; + else + Obj.Next := 0; + Obj.Before := Data; + end if; + + else + if Stretch then + Obj.Next := 1; + else + Obj.Before := Obj.Delayed; + end if; + Obj.Delayed := Data; + end if; + end; + +end Opt106_Pkg1; diff --git a/gcc/testsuite/gnat.dg/opt106_pkg1.ads b/gcc/testsuite/gnat.dg/opt106_pkg1.ads new file mode 100644 index 0000000..85ac24d --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt106_pkg1.ads @@ -0,0 +1,16 @@ +package Opt106_Pkg1 is + + type T is record + Initialized : Boolean; + Before : Integer; + Delayed : Integer; + Next : Integer; + Attach_Last : Boolean; + end record; + + procedure Proc (Obj : in out T; + Data : Integer; + Last : Boolean; + Stretch : Boolean); + +end Opt106_Pkg1; diff --git a/gcc/testsuite/gnat.dg/opt106_pkg2.adb b/gcc/testsuite/gnat.dg/opt106_pkg2.adb new file mode 100644 index 0000000..cf63956 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt106_pkg2.adb @@ -0,0 +1,11 @@ +package body Opt106_Pkg2 is + + procedure Stop (Delayed : Integer; + Before : Integer; + After : Integer; + Last : Boolean) is + begin + raise Program_Error; + end; + +end Opt106_Pkg2; diff --git a/gcc/testsuite/gnat.dg/opt106_pkg2.ads b/gcc/testsuite/gnat.dg/opt106_pkg2.ads new file mode 100644 index 0000000..77e5b40 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt106_pkg2.ads @@ -0,0 +1,8 @@ +package Opt106_Pkg2 is + + procedure Stop (Delayed : Integer; + Before : Integer; + After : Integer; + Last : Boolean); + +end Opt106_Pkg2; diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 6dd8fa3..312c4b8 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -26,6 +26,7 @@ load_lib scanipa.exp load_lib scanwpaipa.exp load_lib scanlang.exp load_lib scansarif.exp +load_lib scanhtml.exp load_lib timeout.exp load_lib timeout-dg.exp load_lib prune.exp diff --git a/gcc/testsuite/lib/htmltest.py b/gcc/testsuite/lib/htmltest.py new file mode 100644 index 0000000..b249ea6 --- /dev/null +++ b/gcc/testsuite/lib/htmltest.py @@ -0,0 +1,9 @@ +import os +import xml.etree.ElementTree as ET + +def html_tree_from_env(): + # return parsed HTML content as an ET from an HTML_PATH file + html_filename = os.environ['HTML_PATH'] + html_filename += '.html' + print('html_filename: %r' % html_filename) + return ET.parse(html_filename) diff --git a/gcc/testsuite/lib/scanhtml.exp b/gcc/testsuite/lib/scanhtml.exp new file mode 100644 index 0000000..6d8f398 --- /dev/null +++ b/gcc/testsuite/lib/scanhtml.exp @@ -0,0 +1,90 @@ +# Copyright (C) 2000-2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Various utilities for scanning HTML output, used by gcc-dg.exp and +# g++-dg.exp. +# +# This is largely borrowed from scansarif.exp. + +proc html-pytest-format-line { args } { + global subdir + + set testcase [lindex $args 0] + set pytest_script [lindex $args 1] + set output_line [lindex $args 2] + + set index [string first "::" $output_line] + set test_output [string range $output_line [expr $index + 2] [string length $output_line]] + + return "$subdir/$testcase ${pytest_script}::${test_output}" +} + +# Call by dg-final to run a pytest Python script. +# We pass filename of a test via HTML_PATH environment variable. + +proc run-html-pytest { args } { + global srcdir subdir + # Extract the test file name from the arguments. + set testcase [lindex $args 0] + + verbose "Running HTML $testcase in $srcdir/$subdir" 2 + set testcase [remote_download host $testcase] + + set pytest_script [lindex $args 1] + if { ![check_effective_target_pytest3] } { + unsupported "$pytest_script pytest python3 is missing" + return + } + + setenv HTML_PATH $testcase + set libdir "${srcdir}/lib" + + # Set/prepend libdir to PYTHONPATH + if [info exists ::env(PYTHONPATH)] { + set old_PYTHONPATH $::env(PYTHONPATH) + setenv PYTHONPATH "${libdir}:${old_PYTHONPATH}" + } else { + setenv PYTHONPATH "${libdir}" + } + + verbose "PYTHONPATH=[getenv PYTHONPATH]" 2 + + spawn -noecho python3 -m pytest --color=no -rap -s --tb=no $srcdir/$subdir/$pytest_script + + if [info exists old_PYTHONPATH] { + setenv PYTHONPATH ${old_PYTHONPATH} + } + + set prefix "\[^\r\n\]*" + expect { + -re "FAILED($prefix)\[^\r\n\]+\r\n" { + set output [html-pytest-format-line $testcase $pytest_script $expect_out(1,string)] + fail $output + exp_continue + } + -re "ERROR($prefix)\[^\r\n\]+\r\n" { + set output [html-pytest-format-line $testcase $pytest_script $expect_out(1,string)] + fail $output + exp_continue + } + -re "PASSED($prefix)\[^\r\n\]+\r\n" { + set output [html-pytest-format-line $testcase $pytest_script $expect_out(1,string)] + pass $output + exp_continue + } + } +} + diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc index fe8aee0..636361e 100644 --- a/gcc/tree-if-conv.cc +++ b/gcc/tree-if-conv.cc @@ -1066,7 +1066,7 @@ if_convertible_gimple_assign_stmt_p (gimple *stmt, fprintf (dump_file, "tree could trap...\n"); return false; } - else if (gimple_with_undefined_signed_overflow (stmt)) + else if (gimple_needing_rewrite_undefined (stmt)) /* We have to rewrite stmts with undefined overflow. */ need_to_rewrite_undefined = true; @@ -2881,8 +2881,8 @@ predicate_statements (loop_p loop) gsi_replace (&gsi, new_stmt, true); } - else if (gimple_with_undefined_signed_overflow (stmt)) - rewrite_to_defined_overflow (&gsi); + else if (gimple_needing_rewrite_undefined (stmt)) + rewrite_to_defined_unconditional (&gsi); else if (gimple_vdef (stmt)) { tree lhs = gimple_assign_lhs (stmt); diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc index 9d64d3a..43311e5 100644 --- a/gcc/tree-scalar-evolution.cc +++ b/gcc/tree-scalar-evolution.cc @@ -3932,8 +3932,8 @@ final_value_replacement_loop (class loop *loop) gsi2 = gsi_start (stmts); while (!gsi_end_p (gsi2)) { - if (gimple_with_undefined_signed_overflow (gsi_stmt (gsi2))) - rewrite_to_defined_overflow (&gsi2); + if (gimple_needing_rewrite_undefined (gsi_stmt (gsi2))) + rewrite_to_defined_unconditional (&gsi2); gsi_next (&gsi2); } } diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc index 19990d6..1fff923 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.cc @@ -514,9 +514,9 @@ ifcombine_mark_ssa_name_walk (tree *t, int *, void *data_) static inline void ifcombine_rewrite_to_defined_overflow (gimple_stmt_iterator gsi) { - if (!gimple_with_undefined_signed_overflow (gsi_stmt (gsi))) + if (!gimple_needing_rewrite_undefined (gsi_stmt (gsi))) return; - rewrite_to_defined_overflow (&gsi); + rewrite_to_defined_unconditional (&gsi); } diff --git a/gcc/tree-ssa-loop-im.cc b/gcc/tree-ssa-loop-im.cc index ae2fd87..50d2ee9 100644 --- a/gcc/tree-ssa-loop-im.cc +++ b/gcc/tree-ssa-loop-im.cc @@ -1419,11 +1419,11 @@ move_computations_worker (basic_block bb) when the target loop header is executed and the stmt may invoke undefined integer or pointer overflow rewrite it to unsigned arithmetic. */ - if (gimple_with_undefined_signed_overflow (stmt) + if (gimple_needing_rewrite_undefined (stmt) && (!ALWAYS_EXECUTED_IN (bb) || !(ALWAYS_EXECUTED_IN (bb) == level || flow_loop_nested_p (ALWAYS_EXECUTED_IN (bb), level)))) - gsi_insert_seq_on_edge (e, rewrite_to_defined_overflow (stmt)); + gsi_insert_seq_on_edge (e, rewrite_to_defined_unconditional (stmt)); else gsi_insert_on_edge (e, stmt); } diff --git a/gcc/tree-ssa-loop-split.cc b/gcc/tree-ssa-loop-split.cc index 80f488a..492abf8 100644 --- a/gcc/tree-ssa-loop-split.cc +++ b/gcc/tree-ssa-loop-split.cc @@ -663,8 +663,8 @@ split_loop (class loop *loop1) gsi = gsi_start (stmts2); while (!gsi_end_p (gsi)) { - if (gimple_with_undefined_signed_overflow (gsi_stmt (gsi))) - rewrite_to_defined_overflow (&gsi); + if (gimple_needing_rewrite_undefined (gsi_stmt (gsi))) + rewrite_to_defined_unconditional (&gsi); gsi_next (&gsi); } } diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 54ecd93..9724040 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -838,33 +838,13 @@ move_stmt (gimple *stmt, gimple_stmt_iterator *gsi, auto_bitmap &inserted_exprs) // Mark the name to be renamed if there is one. bitmap_set_bit (inserted_exprs, SSA_NAME_VERSION (name)); gimple_stmt_iterator gsi1 = gsi_for_stmt (stmt); - gsi_move_before (&gsi1, gsi); + gsi_move_before (&gsi1, gsi, GSI_NEW_STMT); reset_flow_sensitive_info (name); /* Rewrite some code which might be undefined when unconditionalized. */ - if (gimple_assign_single_p (stmt)) - { - tree rhs = gimple_assign_rhs1 (stmt); - /* VCE from integral types to another integral types but with - different precisions need to be changed into casts - to be well defined when unconditional. */ - if (gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR - && INTEGRAL_TYPE_P (TREE_TYPE (name)) - && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0)))) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, "rewriting stmt with maybe undefined VCE "); - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); - } - tree new_rhs = TREE_OPERAND (rhs, 0); - gcc_assert (is_gimple_val (new_rhs)); - gimple_assign_set_rhs_code (stmt, NOP_EXPR); - gimple_assign_set_rhs1 (stmt, new_rhs); - update_stmt (stmt); - } - } + if (gimple_needing_rewrite_undefined (stmt)) + rewrite_to_defined_unconditional (gsi); } /* RAII style class to temporarily remove flow sensitive @@ -3546,8 +3526,14 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb, /* If LHS is an access to a local variable without address-taken (or when we allow data races) and known not to trap, we could always safely move down the store. */ + tree base; if (ref_can_have_store_data_races (lhs) - || tree_could_trap_p (lhs)) + || tree_could_trap_p (lhs) + /* tree_could_trap_p is a predicate for rvalues, so check + for readonly memory explicitly. */ + || ((base = get_base_address (lhs)) + && DECL_P (base) + && TREE_READONLY (base))) return false; } diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc index 13bb85c..3c38f3d 100644 --- a/gcc/tree-ssa-reassoc.cc +++ b/gcc/tree-ssa-reassoc.cc @@ -2925,13 +2925,13 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange, !gsi_end_p (gsi); gsi_next (&gsi)) { gimple *stmt = gsi_stmt (gsi); - if (gimple_with_undefined_signed_overflow (stmt)) + if (gimple_needing_rewrite_undefined (stmt)) { gimple_stmt_iterator gsip = gsi; gimple_stmt_iterator gsin = gsi; gsi_prev (&gsip); gsi_next (&gsin); - rewrite_to_defined_overflow (&gsi); + rewrite_to_defined_unconditional (&gsi); unsigned uid = gimple_uid (stmt); if (gsi_end_p (gsip)) gsip = gsi_after_labels (bb); diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 3ad0c69..deca44a 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -6562,7 +6562,7 @@ create_variable_info_for (tree decl, const char *name, bool add_id) varpool_node *vnode = varpool_node::get (decl); /* For escaped variables initialize them from nonlocal. */ - if (!vnode->all_refs_explicit_p ()) + if (!vnode || !vnode->all_refs_explicit_p ()) make_copy_constraint (vi, nonlocal_id); /* While we can in theory walk references for the varpool @@ -6581,7 +6581,7 @@ create_variable_info_for (tree decl, const char *name, bool add_id) process_constraint (new_constraint (lhs, *rhsp)); /* If this is a variable that escapes from the unit the initializer escapes as well. */ - if (!vnode->all_refs_explicit_p ()) + if (!vnode || !vnode->all_refs_explicit_p ()) { lhs.var = escaped_id; lhs.offset = 0; diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc index dea217a..bd4de96 100644 --- a/gcc/tree-switch-conversion.cc +++ b/gcc/tree-switch-conversion.cc @@ -1793,12 +1793,14 @@ bit_test_cluster::find_bit_tests (vec<cluster *> &clusters, int max_c) end up with as few clusters as possible. */ unsigned l = clusters.length (); - auto_vec<min_cluster_item> min; - min.reserve (l + 1); - gcc_checking_assert (l > 0); + if (l == 0) + return clusters.copy (); gcc_checking_assert (l <= INT_MAX); + auto_vec<min_cluster_item> min; + min.reserve (l + 1); + int bits_in_word = GET_MODE_BITSIZE (word_mode); /* First phase: Compute the minimum number of clusters for each prefix of the diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index 231a3ca..9fd1ef2 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -734,7 +734,6 @@ vect_analyze_early_break_dependences (loop_vec_info loop_vinfo) stmt_vec_info stmt_vinfo = vect_stmt_to_vectorize (loop_vinfo->lookup_stmt (stmt)); - stmt = STMT_VINFO_STMT (stmt_vinfo); auto dr_ref = STMT_VINFO_DATA_REF (stmt_vinfo); if (!dr_ref) continue; diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 3de1ea6..fe6f3cf 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -5470,76 +5470,6 @@ vect_emit_reduction_init_stmts (loop_vec_info loop_vinfo, } } -/* Function get_initial_def_for_reduction - - Input: - REDUC_INFO - the info_for_reduction - INIT_VAL - the initial value of the reduction variable - NEUTRAL_OP - a value that has no effect on the reduction, as per - neutral_op_for_reduction - - Output: - Return a vector variable, initialized according to the operation that - STMT_VINFO performs. This vector will be used as the initial value - of the vector of partial results. - - The value we need is a vector in which element 0 has value INIT_VAL - and every other element has value NEUTRAL_OP. */ - -static tree -get_initial_def_for_reduction (loop_vec_info loop_vinfo, - stmt_vec_info reduc_info, - tree init_val, tree neutral_op) -{ - class loop *loop = LOOP_VINFO_LOOP (loop_vinfo); - tree scalar_type = TREE_TYPE (init_val); - tree vectype = get_vectype_for_scalar_type (loop_vinfo, scalar_type); - tree init_def; - gimple_seq stmts = NULL; - - gcc_assert (vectype); - - gcc_assert (POINTER_TYPE_P (scalar_type) || INTEGRAL_TYPE_P (scalar_type) - || SCALAR_FLOAT_TYPE_P (scalar_type)); - - gcc_assert (nested_in_vect_loop_p (loop, reduc_info) - || loop == (gimple_bb (reduc_info->stmt))->loop_father); - - if (operand_equal_p (init_val, neutral_op)) - { - /* If both elements are equal then the vector described above is - just a splat. */ - neutral_op = gimple_convert (&stmts, TREE_TYPE (vectype), neutral_op); - init_def = gimple_build_vector_from_val (&stmts, vectype, neutral_op); - } - else - { - neutral_op = gimple_convert (&stmts, TREE_TYPE (vectype), neutral_op); - init_val = gimple_convert (&stmts, TREE_TYPE (vectype), init_val); - if (!TYPE_VECTOR_SUBPARTS (vectype).is_constant ()) - { - /* Construct a splat of NEUTRAL_OP and insert INIT_VAL into - element 0. */ - init_def = gimple_build_vector_from_val (&stmts, vectype, - neutral_op); - init_def = gimple_build (&stmts, CFN_VEC_SHL_INSERT, - vectype, init_def, init_val); - } - else - { - /* Build {INIT_VAL, NEUTRAL_OP, NEUTRAL_OP, ...}. */ - tree_vector_builder elts (vectype, 1, 2); - elts.quick_push (init_val); - elts.quick_push (neutral_op); - init_def = gimple_build_vector (&stmts, &elts); - } - } - - if (stmts) - vect_emit_reduction_init_stmts (loop_vinfo, reduc_info, stmts); - return init_def; -} - /* Get at the initial defs for the reduction PHIs for REDUC_INFO, which performs a reduction involving GROUP_SIZE scalar statements. NUMBER_OF_VECTORS is the number of vector defs to create. If NEUTRAL_OP @@ -5951,7 +5881,6 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, loop-closed PHI of the inner loop which we remember as def for the reduction PHI generation. */ bool double_reduc = false; - stmt_vec_info rdef_info = stmt_info; if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_double_reduction_def) { double_reduc = true; @@ -5981,20 +5910,18 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, auto_vec<tree> reduc_inputs; int j, i; vec<tree> &scalar_results = reduc_info->reduc_scalar_results; - unsigned int group_size = 1, k; + unsigned int k; /* SLP reduction without reduction chain, e.g., # a1 = phi <a2, a0> # b1 = phi <b2, b0> a2 = operation (a1) b2 = operation (b1) */ bool slp_reduc - = (slp_node - && !REDUC_GROUP_FIRST_ELEMENT (STMT_VINFO_REDUC_DEF (reduc_info))); + = !REDUC_GROUP_FIRST_ELEMENT (STMT_VINFO_REDUC_DEF (reduc_info)); bool direct_slp_reduc; tree induction_index = NULL_TREE; - if (slp_node) - group_size = SLP_TREE_LANES (slp_node); + unsigned int group_size = SLP_TREE_LANES (slp_node); if (nested_in_vect_loop_p (loop, stmt_info)) { @@ -6024,18 +5951,8 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, /* All statements produce live-out values. */ live_out_stmts = SLP_TREE_SCALAR_STMTS (slp_node); - unsigned vec_num; - int ncopies; - if (slp_node) - { - vec_num = SLP_TREE_VEC_DEFS (slp_node_instance->reduc_phis).length (); - ncopies = 1; - } - else - { - vec_num = 1; - ncopies = STMT_VINFO_VEC_STMTS (reduc_info).length (); - } + unsigned vec_num + = SLP_TREE_VEC_DEFS (slp_node_instance->reduc_phis).length (); /* For cond reductions we want to create a new vector (INDEX_COND_EXPR) which is updated with the current index of the loop for every match of @@ -6050,53 +5967,29 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, if (STMT_VINFO_REDUC_TYPE (reduc_info) == COND_REDUCTION) { auto_vec<std::pair<tree, bool>, 2> ccompares; - if (slp_node) + slp_tree cond_node = slp_node_instance->root; + while (cond_node != slp_node_instance->reduc_phis) { - slp_tree cond_node = slp_node_instance->root; - while (cond_node != slp_node_instance->reduc_phis) + stmt_vec_info cond_info = SLP_TREE_REPRESENTATIVE (cond_node); + int slp_reduc_idx; + if (gimple_assign_rhs_code (cond_info->stmt) == COND_EXPR) { - stmt_vec_info cond_info = SLP_TREE_REPRESENTATIVE (cond_node); - int slp_reduc_idx; - if (gimple_assign_rhs_code (cond_info->stmt) == COND_EXPR) - { - gimple *vec_stmt - = SSA_NAME_DEF_STMT (SLP_TREE_VEC_DEFS (cond_node)[0]); - gcc_assert (gimple_assign_rhs_code (vec_stmt) == VEC_COND_EXPR); - ccompares.safe_push - (std::make_pair (gimple_assign_rhs1 (vec_stmt), - STMT_VINFO_REDUC_IDX (cond_info) == 2)); - /* ??? We probably want to have REDUC_IDX on the SLP node? - We have both three and four children COND_EXPR nodes - dependent on whether the comparison is still embedded - as GENERIC. So work backwards. */ - slp_reduc_idx = (SLP_TREE_CHILDREN (cond_node).length () - 3 - + STMT_VINFO_REDUC_IDX (cond_info)); - } - else - slp_reduc_idx = STMT_VINFO_REDUC_IDX (cond_info); - cond_node = SLP_TREE_CHILDREN (cond_node)[slp_reduc_idx]; - } - } - else - { - stmt_vec_info cond_info = STMT_VINFO_REDUC_DEF (reduc_info); - cond_info = vect_stmt_to_vectorize (cond_info); - while (cond_info != reduc_info) - { - if (gimple_assign_rhs_code (cond_info->stmt) == COND_EXPR) - { - gimple *vec_stmt = STMT_VINFO_VEC_STMTS (cond_info)[0]; - gcc_assert (gimple_assign_rhs_code (vec_stmt) == VEC_COND_EXPR); - ccompares.safe_push - (std::make_pair (gimple_assign_rhs1 (vec_stmt), - STMT_VINFO_REDUC_IDX (cond_info) == 2)); - } - cond_info - = loop_vinfo->lookup_def (gimple_op (cond_info->stmt, - 1 + STMT_VINFO_REDUC_IDX - (cond_info))); - cond_info = vect_stmt_to_vectorize (cond_info); + gimple *vec_stmt + = SSA_NAME_DEF_STMT (SLP_TREE_VEC_DEFS (cond_node)[0]); + gcc_assert (gimple_assign_rhs_code (vec_stmt) == VEC_COND_EXPR); + ccompares.safe_push + (std::make_pair (gimple_assign_rhs1 (vec_stmt), + STMT_VINFO_REDUC_IDX (cond_info) == 2)); + /* ??? We probably want to have REDUC_IDX on the SLP node? + We have both three and four children COND_EXPR nodes + dependent on whether the comparison is still embedded + as GENERIC. So work backwards. */ + slp_reduc_idx = (SLP_TREE_CHILDREN (cond_node).length () - 3 + + STMT_VINFO_REDUC_IDX (cond_info)); } + else + slp_reduc_idx = STMT_VINFO_REDUC_IDX (cond_info); + cond_node = SLP_TREE_CHILDREN (cond_node)[slp_reduc_idx]; } gcc_assert (ccompares.length () != 0); @@ -6205,30 +6098,22 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, /* We need to reduce values in all exits. */ exit_bb = loop_exit->dest; exit_gsi = gsi_after_labels (exit_bb); - reduc_inputs.create (slp_node ? vec_num : ncopies); + reduc_inputs.create (vec_num); for (unsigned i = 0; i < vec_num; i++) { gimple_seq stmts = NULL; - if (slp_node) - def = vect_get_slp_vect_def (slp_node, i); + def = vect_get_slp_vect_def (slp_node, i); + tree new_def = copy_ssa_name (def); + phi = create_phi_node (new_def, exit_bb); + if (LOOP_VINFO_IV_EXIT (loop_vinfo) == loop_exit) + SET_PHI_ARG_DEF (phi, loop_exit->dest_idx, def); else - def = gimple_get_lhs (STMT_VINFO_VEC_STMTS (rdef_info)[0]); - for (j = 0; j < ncopies; j++) - { - tree new_def = copy_ssa_name (def); - phi = create_phi_node (new_def, exit_bb); - if (j) - def = gimple_get_lhs (STMT_VINFO_VEC_STMTS (rdef_info)[j]); - if (LOOP_VINFO_IV_EXIT (loop_vinfo) == loop_exit) - SET_PHI_ARG_DEF (phi, loop_exit->dest_idx, def); - else - { - for (unsigned k = 0; k < gimple_phi_num_args (phi); k++) - SET_PHI_ARG_DEF (phi, k, def); - } - new_def = gimple_convert (&stmts, vectype, new_def); - reduc_inputs.quick_push (new_def); + { + for (unsigned k = 0; k < gimple_phi_num_args (phi); k++) + SET_PHI_ARG_DEF (phi, k, def); } + new_def = gimple_convert (&stmts, vectype, new_def); + reduc_inputs.quick_push (new_def); gsi_insert_seq_before (&exit_gsi, stmts, GSI_SAME_STMT); } @@ -6284,8 +6169,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, if (REDUC_GROUP_FIRST_ELEMENT (STMT_VINFO_REDUC_DEF (reduc_info)) || direct_slp_reduc || (slp_reduc - && constant_multiple_p (TYPE_VECTOR_SUBPARTS (vectype), group_size)) - || ncopies > 1) + && constant_multiple_p (TYPE_VECTOR_SUBPARTS (vectype), group_size))) { gimple_seq stmts = NULL; tree single_input = reduc_inputs[0]; @@ -6579,7 +6463,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, is itself a neutral value. */ tree vector_identity = NULL_TREE; tree neutral_op = NULL_TREE; - if (slp_node) + if (1) { tree initial_value = NULL_TREE; if (REDUC_GROUP_FIRST_ELEMENT (STMT_VINFO_REDUC_DEF (reduc_info))) @@ -7088,10 +6972,10 @@ static bool vectorize_fold_left_reduction (loop_vec_info loop_vinfo, stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, - gimple **vec_stmt, slp_tree slp_node, + slp_tree slp_node, gimple *reduc_def_stmt, code_helper code, internal_fn reduc_fn, - tree *ops, int num_ops, tree vectype_in, + int num_ops, tree vectype_in, int reduc_index, vec_loop_masks *masks, vec_loop_lens *lens) { @@ -7099,14 +6983,7 @@ vectorize_fold_left_reduction (loop_vec_info loop_vinfo, tree vectype_out = STMT_VINFO_VECTYPE (stmt_info); internal_fn mask_reduc_fn = get_masked_reduction_fn (reduc_fn, vectype_in); - int ncopies; - if (slp_node) - ncopies = 1; - else - ncopies = vect_get_num_copies (loop_vinfo, vectype_in); - gcc_assert (!nested_in_vect_loop_p (loop, stmt_info)); - gcc_assert (ncopies == 1); bool is_cond_op = false; if (!code.is_tree_code ()) @@ -7118,9 +6995,8 @@ vectorize_fold_left_reduction (loop_vec_info loop_vinfo, gcc_assert (TREE_CODE_LENGTH (tree_code (code)) == binary_op); - if (slp_node) - gcc_assert (known_eq (TYPE_VECTOR_SUBPARTS (vectype_out), - TYPE_VECTOR_SUBPARTS (vectype_in))); + gcc_assert (known_eq (TYPE_VECTOR_SUBPARTS (vectype_out), + TYPE_VECTOR_SUBPARTS (vectype_in))); /* The operands either come from a binary operation or an IFN_COND operation. The former is a gimple assign with binary rhs and the latter is a @@ -7130,36 +7006,14 @@ vectorize_fold_left_reduction (loop_vec_info loop_vinfo, int group_size = 1; stmt_vec_info scalar_dest_def_info; auto_vec<tree> vec_oprnds0, vec_opmask; - if (slp_node) - { - vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[(is_cond_op ? 2 : 0) - + (1 - reduc_index)], - &vec_oprnds0); - group_size = SLP_TREE_SCALAR_STMTS (slp_node).length (); - scalar_dest_def_info = SLP_TREE_SCALAR_STMTS (slp_node)[group_size - 1]; - /* For an IFN_COND_OP we also need the vector mask operand. */ - if (is_cond_op) - vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[0], &vec_opmask); - } - else - { - tree op0, opmask; - if (!is_cond_op) - op0 = ops[1 - reduc_index]; - else - { - op0 = ops[2 + (1 - reduc_index)]; - opmask = ops[0]; - } - vect_get_vec_defs_for_operand (loop_vinfo, stmt_info, 1, - op0, &vec_oprnds0); - scalar_dest_def_info = stmt_info; - - /* For an IFN_COND_OP we also need the vector mask operand. */ - if (is_cond_op) - vect_get_vec_defs_for_operand (loop_vinfo, stmt_info, 1, - opmask, &vec_opmask); - } + vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[(is_cond_op ? 2 : 0) + + (1 - reduc_index)], + &vec_oprnds0); + group_size = SLP_TREE_SCALAR_STMTS (slp_node).length (); + scalar_dest_def_info = SLP_TREE_SCALAR_STMTS (slp_node)[group_size - 1]; + /* For an IFN_COND_OP we also need the vector mask operand. */ + if (is_cond_op) + vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[0], &vec_opmask); gimple *sdef = vect_orig_stmt (scalar_dest_def_info)->stmt; tree scalar_dest = gimple_get_lhs (sdef); @@ -7167,7 +7021,6 @@ vectorize_fold_left_reduction (loop_vec_info loop_vinfo, tree reduc_var = gimple_phi_result (reduc_def_stmt); int vec_num = vec_oprnds0.length (); - gcc_assert (vec_num == 1 || slp_node); tree vec_elem_type = TREE_TYPE (vectype_out); gcc_checking_assert (useless_type_conversion_p (scalar_type, vec_elem_type)); @@ -7279,13 +7132,7 @@ vectorize_fold_left_reduction (loop_vec_info loop_vinfo, scalar_dest_def_info, new_stmt, gsi); - if (slp_node) - slp_node->push_vec_def (new_stmt); - else - { - STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt); - *vec_stmt = new_stmt; - } + slp_node->push_vec_def (new_stmt); } return true; @@ -7543,7 +7390,7 @@ vectorizable_lane_reducing (loop_vec_info loop_vinfo, stmt_vec_info stmt_info, return false; } - if (slp_node && !vect_maybe_update_slp_op_vectype (slp_op, vectype)) + if (!vect_maybe_update_slp_op_vectype (slp_op, vectype)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -7682,23 +7529,20 @@ vectorizable_reduction (loop_vec_info loop_vinfo, { if (is_a <gphi *> (stmt_info->stmt)) { - if (slp_node) - { - /* We eventually need to set a vector type on invariant - arguments. */ - unsigned j; - slp_tree child; - FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (slp_node), j, child) - if (!vect_maybe_update_slp_op_vectype - (child, SLP_TREE_VECTYPE (slp_node))) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "incompatible vector types for " - "invariants\n"); - return false; - } - } + /* We eventually need to set a vector type on invariant + arguments. */ + unsigned j; + slp_tree child; + FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (slp_node), j, child) + if (!vect_maybe_update_slp_op_vectype + (child, SLP_TREE_VECTYPE (slp_node))) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "incompatible vector types for " + "invariants\n"); + return false; + } /* Analysis for double-reduction is done on the outer loop PHI, nested cycles have no further restrictions. */ STMT_VINFO_TYPE (stmt_info) = cycle_phi_info_type; @@ -7723,7 +7567,6 @@ vectorizable_reduction (loop_vec_info loop_vinfo, the outer loop PHI. The latter is what we want to analyze the reduction with. The LC PHI is handled by vectorizable_lc_phi. */ - gcc_assert (slp_node); return gimple_phi_num_args (as_a <gphi *> (stmt_info->stmt)) == 2; } use_operand_p use_p; @@ -7734,13 +7577,10 @@ vectorizable_reduction (loop_vec_info loop_vinfo, phi_info = loop_vinfo->lookup_stmt (use_stmt); } - if (slp_node) - { - slp_node_instance->reduc_phis = slp_node; - /* ??? We're leaving slp_node to point to the PHIs, we only - need it to get at the number of vector stmts which wasn't - yet initialized for the instance root. */ - } + slp_node_instance->reduc_phis = slp_node; + /* ??? We're leaving slp_node to point to the PHIs, we only + need it to get at the number of vector stmts which wasn't + yet initialized for the instance root. */ /* PHIs should not participate in patterns. */ gcc_assert (!STMT_VINFO_RELATED_STMT (phi_info)); @@ -7756,11 +7596,10 @@ vectorizable_reduction (loop_vec_info loop_vinfo, unsigned reduc_chain_length = 0; bool only_slp_reduc_chain = true; stmt_info = NULL; - slp_tree slp_for_stmt_info = slp_node ? slp_node_instance->root : NULL; + slp_tree slp_for_stmt_info = slp_node_instance->root; /* For double-reductions we start SLP analysis at the inner loop LC PHI which is the def of the outer loop live stmt. */ - if (STMT_VINFO_DEF_TYPE (reduc_info) == vect_double_reduction_def - && slp_node) + if (STMT_VINFO_DEF_TYPE (reduc_info) == vect_double_reduction_def) slp_for_stmt_info = SLP_TREE_CHILDREN (slp_for_stmt_info)[0]; while (reduc_def != PHI_RESULT (reduc_def_phi)) { @@ -7863,7 +7702,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, reduc_def = op.ops[reduc_idx]; reduc_chain_length++; - if (!stmt_info && slp_node) + if (!stmt_info) slp_for_stmt_info = SLP_TREE_CHILDREN (slp_for_stmt_info)[0]; } /* PHIs should not participate in patterns. */ @@ -7877,14 +7716,13 @@ vectorizable_reduction (loop_vec_info loop_vinfo, /* STMT_VINFO_REDUC_DEF doesn't point to the first but the last element. */ - if (slp_node && REDUC_GROUP_FIRST_ELEMENT (stmt_info)) + if (REDUC_GROUP_FIRST_ELEMENT (stmt_info)) { gcc_assert (!REDUC_GROUP_NEXT_ELEMENT (stmt_info)); stmt_info = REDUC_GROUP_FIRST_ELEMENT (stmt_info); } if (REDUC_GROUP_FIRST_ELEMENT (stmt_info)) - gcc_assert (slp_node - && REDUC_GROUP_FIRST_ELEMENT (stmt_info) == stmt_info); + gcc_assert (REDUC_GROUP_FIRST_ELEMENT (stmt_info) == stmt_info); /* 1. Is vectorizable reduction? */ /* Not supportable if the reduction variable is used in the loop, unless @@ -7939,7 +7777,6 @@ vectorizable_reduction (loop_vec_info loop_vinfo, OK to use them in a reduction chain or when the reduction group has just one element. */ if (lane_reducing - && slp_node && !REDUC_GROUP_FIRST_ELEMENT (stmt_info) && SLP_TREE_LANES (slp_node) > 1) { @@ -8017,7 +7854,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, /* If we have a condition reduction, see if we can simplify it further. */ if (reduction_type == COND_REDUCTION) { - if (slp_node && SLP_TREE_LANES (slp_node) != 1) + if (SLP_TREE_LANES (slp_node) != 1) return false; /* When the condition uses the reduction value in the condition, fail. */ @@ -8119,10 +7956,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, if (STMT_VINFO_LIVE_P (phi_info)) return false; - if (slp_node) - ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); - else - ncopies = vect_get_num_copies (loop_vinfo, vectype_in); + ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); gcc_assert (ncopies >= 1); @@ -8194,8 +8028,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, outer-loop vectorization is safe. Likewise when we are vectorizing a series of reductions using SLP and the VF is one the reductions are performed in scalar order. */ - if (slp_node - && !REDUC_GROUP_FIRST_ELEMENT (stmt_info) + if (!REDUC_GROUP_FIRST_ELEMENT (stmt_info) && known_eq (LOOP_VINFO_VECT_FACTOR (loop_vinfo), 1u)) ; else if (needs_fold_left_reduction_p (op.type, orig_code)) @@ -8227,7 +8060,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, || reduction_type == INTEGER_INDUC_COND_REDUCTION || reduction_type == CONST_COND_REDUCTION || reduction_type == EXTRACT_LAST_REDUCTION) - && slp_node + && 1 && ncopies > 1) { if (dump_enabled_p ()) @@ -8236,17 +8069,6 @@ vectorizable_reduction (loop_vec_info loop_vinfo, return false; } - if ((double_reduc || reduction_type != TREE_CODE_REDUCTION) - && !slp_node - && ncopies > 1) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "multiple types in double reduction or condition " - "reduction or fold-left reduction.\n"); - return false; - } - internal_fn reduc_fn = IFN_LAST; if (reduction_type == TREE_CODE_REDUCTION || reduction_type == FOLD_LEFT_REDUCTION @@ -8308,14 +8130,11 @@ vectorizable_reduction (loop_vec_info loop_vinfo, /* For SLP reductions, see if there is a neutral value we can use. */ tree neutral_op = NULL_TREE; - if (slp_node) - { - tree initial_value = NULL_TREE; - if (REDUC_GROUP_FIRST_ELEMENT (stmt_info) != NULL) - initial_value = vect_phi_initial_value (reduc_def_phi); - neutral_op = neutral_op_for_reduction (TREE_TYPE (vectype_out), - orig_code, initial_value); - } + tree initial_value = NULL_TREE; + if (REDUC_GROUP_FIRST_ELEMENT (stmt_info) != NULL) + initial_value = vect_phi_initial_value (reduc_def_phi); + neutral_op = neutral_op_for_reduction (TREE_TYPE (vectype_out), + orig_code, initial_value); if (double_reduc && reduction_type == FOLD_LEFT_REDUCTION) { @@ -8341,7 +8160,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, } if (reduction_type == FOLD_LEFT_REDUCTION - && (slp_node && SLP_TREE_LANES (slp_node) > 1) + && SLP_TREE_LANES (slp_node) > 1 && !REDUC_GROUP_FIRST_ELEMENT (stmt_info)) { /* We cannot use in-order reductions in this case because there is @@ -8370,8 +8189,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, } /* Check extra constraints for variable-length unchained SLP reductions. */ - if (slp_node - && !REDUC_GROUP_FIRST_ELEMENT (stmt_info) + if (!REDUC_GROUP_FIRST_ELEMENT (stmt_info) && !nunits_out.is_constant ()) { /* We checked above that we could build the initial vector when @@ -8465,9 +8283,8 @@ vectorizable_reduction (loop_vec_info loop_vinfo, own reduction accumulator since one of the main goals of unrolling a reduction is to reduce the aggregate loop-carried latency. */ if (ncopies > 1 - && (!slp_node - || (!REDUC_GROUP_FIRST_ELEMENT (stmt_info) - && SLP_TREE_LANES (slp_node) == 1)) + && !REDUC_GROUP_FIRST_ELEMENT (stmt_info) + && SLP_TREE_LANES (slp_node) == 1 && (STMT_VINFO_RELEVANT (stmt_info) <= vect_used_only_live) && reduc_chain_length == 1 && loop_vinfo->suggested_unroll_factor == 1) @@ -8518,8 +8335,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, reduction. */ single_defuse_cycle &= !lane_reducing; - if (slp_node - && (single_defuse_cycle || reduction_type == FOLD_LEFT_REDUCTION)) + if (single_defuse_cycle || reduction_type == FOLD_LEFT_REDUCTION) for (i = 0; i < (int) op.num_ops; i++) if (!vect_maybe_update_slp_op_vectype (slp_op[i], vectype_op[i])) { @@ -8549,7 +8365,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, { stmt_vec_info tem = vect_stmt_to_vectorize (STMT_VINFO_REDUC_DEF (phi_info)); - if (slp_node && REDUC_GROUP_FIRST_ELEMENT (tem)) + if (REDUC_GROUP_FIRST_ELEMENT (tem)) { gcc_assert (!REDUC_GROUP_NEXT_ELEMENT (tem)); tem = REDUC_GROUP_FIRST_ELEMENT (tem); @@ -8645,11 +8461,10 @@ vect_emulate_mixed_dot_prod (loop_vec_info loop_vinfo, stmt_vec_info stmt_info, bool vect_transform_reduction (loop_vec_info loop_vinfo, stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, - gimple **vec_stmt, slp_tree slp_node) + slp_tree slp_node) { tree vectype_out = STMT_VINFO_VECTYPE (stmt_info); class loop *loop = LOOP_VINFO_LOOP (loop_vinfo); - unsigned ncopies; unsigned vec_num; stmt_vec_info reduc_info = info_for_reduction (loop_vinfo, stmt_info); @@ -8677,16 +8492,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, if (!vectype_in) vectype_in = STMT_VINFO_VECTYPE (stmt_info); - if (slp_node) - { - ncopies = 1; - vec_num = vect_get_num_copies (loop_vinfo, slp_node, vectype_in); - } - else - { - ncopies = vect_get_num_copies (loop_vinfo, vectype_in); - vec_num = 1; - } + vec_num = vect_get_num_copies (loop_vinfo, slp_node, vectype_in); code_helper code = canonicalize_code (op.code, op.type); internal_fn cond_fn = get_conditional_internal_fn (code, op.type); @@ -8702,10 +8508,6 @@ vect_transform_reduction (loop_vec_info loop_vinfo, if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "transform reduction.\n"); - /* FORNOW: Multiple types are not supported for condition. */ - if (code == COND_EXPR) - gcc_assert (ncopies == 1); - /* A binary COND_OP reduction must have the same definition and else value. */ bool cond_fn_p = code.is_internal_fn () @@ -8729,8 +8531,8 @@ vect_transform_reduction (loop_vec_info loop_vinfo, internal_fn reduc_fn = STMT_VINFO_REDUC_FN (reduc_info); gcc_assert (code.is_tree_code () || cond_fn_p); return vectorize_fold_left_reduction - (loop_vinfo, stmt_info, gsi, vec_stmt, slp_node, reduc_def_phi, - code, reduc_fn, op.ops, op.num_ops, vectype_in, + (loop_vinfo, stmt_info, gsi, slp_node, reduc_def_phi, + code, reduc_fn, op.num_ops, vectype_in, reduc_index, masks, lens); } @@ -8748,33 +8550,12 @@ vect_transform_reduction (loop_vec_info loop_vinfo, tree scalar_dest = gimple_get_lhs (stmt_info->stmt); tree vec_dest = vect_create_destination_var (scalar_dest, vectype_out); - if (lane_reducing && !slp_node && !single_defuse_cycle) - { - /* Note: there are still vectorizable cases that can not be handled by - single-lane slp. Probably it would take some time to evolve the - feature to a mature state. So we have to keep the below non-slp code - path as failsafe for lane-reducing support. */ - gcc_assert (op.num_ops <= 3); - for (unsigned i = 0; i < op.num_ops; i++) - { - unsigned oprnd_ncopies = ncopies; - - if ((int) i == reduc_index) - { - tree vectype = STMT_VINFO_VECTYPE (stmt_info); - oprnd_ncopies = vect_get_num_copies (loop_vinfo, vectype); - } - - vect_get_vec_defs_for_operand (loop_vinfo, stmt_info, oprnd_ncopies, - op.ops[i], &vec_oprnds[i]); - } - } /* Get NCOPIES vector definitions for all operands except the reduction definition. */ - else if (!cond_fn_p) + if (!cond_fn_p) { gcc_assert (reduc_index >= 0 && reduc_index <= 2); - vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, ncopies, + vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, 1, single_defuse_cycle && reduc_index == 0 ? NULL_TREE : op.ops[0], &vec_oprnds[0], single_defuse_cycle && reduc_index == 1 @@ -8789,7 +8570,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, vectype. */ gcc_assert (single_defuse_cycle && (reduc_index == 1 || reduc_index == 2)); - vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, ncopies, op.ops[0], + vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, 1, op.ops[0], truth_type_for (vectype_in), &vec_oprnds[0], reduc_index == 1 ? NULL_TREE : op.ops[1], NULL_TREE, &vec_oprnds[1], @@ -8945,7 +8726,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, handle over the operand to other dependent statements. */ gcc_assert (reduc_vop); - if (slp_node && TREE_CODE (reduc_vop) == SSA_NAME + if (TREE_CODE (reduc_vop) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (reduc_vop)) new_stmt = SSA_NAME_DEF_STMT (reduc_vop); else @@ -8969,7 +8750,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, std::swap (vop[0], vop[1]); } tree mask = vect_get_loop_mask (loop_vinfo, gsi, masks, - vec_num * ncopies, vectype_in, + vec_num, vectype_in, mask_index++); gcall *call = gimple_build_call_internal (cond_fn, 4, mask, vop[0], vop[1], vop[0]); @@ -8987,7 +8768,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, if (masked_loop_p && mask_by_cond_expr) { tree mask = vect_get_loop_mask (loop_vinfo, gsi, masks, - vec_num * ncopies, vectype_in, + vec_num, vectype_in, mask_index++); build_vect_cond_expr (code, vop, mask, gsi); } @@ -9015,15 +8796,10 @@ vect_transform_reduction (loop_vec_info loop_vinfo, if (single_defuse_cycle && i < num - 1) vec_oprnds[reduc_index].safe_push (gimple_get_lhs (new_stmt)); - else if (slp_node) - slp_node->push_vec_def (new_stmt); else - STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt); + slp_node->push_vec_def (new_stmt); } - if (!slp_node) - *vec_stmt = STMT_VINFO_VEC_STMTS (stmt_info)[0]; - return true; } @@ -9031,14 +8807,12 @@ vect_transform_reduction (loop_vec_info loop_vinfo, bool vect_transform_cycle_phi (loop_vec_info loop_vinfo, - stmt_vec_info stmt_info, gimple **vec_stmt, + stmt_vec_info stmt_info, slp_tree slp_node, slp_instance slp_node_instance) { tree vectype_out = STMT_VINFO_VECTYPE (stmt_info); class loop *loop = LOOP_VINFO_LOOP (loop_vinfo); int i; - int ncopies; - int j; bool nested_cycle = false; int vec_num; @@ -9058,25 +8832,12 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo, /* Leave the scalar phi in place. */ return true; - if (slp_node) - { - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); - ncopies = 1; - } - else - { - vec_num = 1; - ncopies = vect_get_num_copies (loop_vinfo, - STMT_VINFO_VECTYPE (stmt_info)); - } + vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); /* Check whether we should use a single PHI node and accumulate vectors to one before the backedge. */ if (STMT_VINFO_FORCE_SINGLE_CYCLE (reduc_info)) - { - ncopies = 1; - vec_num = 1; - } + vec_num = 1; /* Create the destination vector */ gphi *phi = as_a <gphi *> (stmt_info->stmt); @@ -9086,158 +8847,86 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo, /* Get the loop-entry arguments. */ tree vec_initial_def = NULL_TREE; auto_vec<tree> vec_initial_defs; - if (slp_node) + vec_initial_defs.reserve (vec_num); + /* Optimize: if initial_def is for REDUC_MAX smaller than the base + and we can't use zero for induc_val, use initial_def. Similarly + for REDUC_MIN and initial_def larger than the base. */ + if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION) { - vec_initial_defs.reserve (vec_num); - /* Optimize: if initial_def is for REDUC_MAX smaller than the base - and we can't use zero for induc_val, use initial_def. Similarly - for REDUC_MIN and initial_def larger than the base. */ - if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION) - { - gcc_assert (SLP_TREE_LANES (slp_node) == 1); - tree initial_def = vect_phi_initial_value (phi); - reduc_info->reduc_initial_values.safe_push (initial_def); - tree induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info); - if (TREE_CODE (initial_def) == INTEGER_CST - && !integer_zerop (induc_val) - && ((STMT_VINFO_REDUC_CODE (reduc_info) == MAX_EXPR - && tree_int_cst_lt (initial_def, induc_val)) - || (STMT_VINFO_REDUC_CODE (reduc_info) == MIN_EXPR - && tree_int_cst_lt (induc_val, initial_def)))) - { - induc_val = initial_def; - /* Communicate we used the initial_def to epilouge - generation. */ - STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info) = NULL_TREE; - } - vec_initial_defs.quick_push - (build_vector_from_val (vectype_out, induc_val)); - } - else if (nested_cycle) - { - unsigned phi_idx = loop_preheader_edge (loop)->dest_idx; - vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[phi_idx], - &vec_initial_defs); - } - else + gcc_assert (SLP_TREE_LANES (slp_node) == 1); + tree initial_def = vect_phi_initial_value (phi); + reduc_info->reduc_initial_values.safe_push (initial_def); + tree induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info); + if (TREE_CODE (initial_def) == INTEGER_CST + && !integer_zerop (induc_val) + && ((STMT_VINFO_REDUC_CODE (reduc_info) == MAX_EXPR + && tree_int_cst_lt (initial_def, induc_val)) + || (STMT_VINFO_REDUC_CODE (reduc_info) == MIN_EXPR + && tree_int_cst_lt (induc_val, initial_def)))) { - gcc_assert (slp_node == slp_node_instance->reduc_phis); - vec<tree> &initial_values = reduc_info->reduc_initial_values; - vec<stmt_vec_info> &stmts = SLP_TREE_SCALAR_STMTS (slp_node); - - unsigned int num_phis = stmts.length (); - if (REDUC_GROUP_FIRST_ELEMENT (reduc_stmt_info)) - num_phis = 1; - initial_values.reserve (num_phis); - for (unsigned int i = 0; i < num_phis; ++i) - { - gphi *this_phi = as_a<gphi *> (stmts[i]->stmt); - initial_values.quick_push (vect_phi_initial_value (this_phi)); - } - if (vec_num == 1) - vect_find_reusable_accumulator (loop_vinfo, reduc_info); - if (!initial_values.is_empty ()) - { - tree initial_value - = (num_phis == 1 ? initial_values[0] : NULL_TREE); - code_helper code = STMT_VINFO_REDUC_CODE (reduc_info); - tree neutral_op - = neutral_op_for_reduction (TREE_TYPE (vectype_out), - code, initial_value); - /* Try to simplify the vector initialization by applying an - adjustment after the reduction has been performed. This - can also break a critical path but on the other hand - requires to keep the initial value live across the loop. */ - if (neutral_op - && initial_values.length () == 1 - && !reduc_info->reused_accumulator - && STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def - && !operand_equal_p (neutral_op, initial_values[0])) - { - STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info) - = initial_values[0]; - initial_values[0] = neutral_op; - } - get_initial_defs_for_reduction (loop_vinfo, reduc_info, - &vec_initial_defs, vec_num, - stmts.length (), neutral_op); - } + induc_val = initial_def; + /* Communicate we used the initial_def to epilouge + generation. */ + STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info) = NULL_TREE; } + vec_initial_defs.quick_push + (build_vector_from_val (vectype_out, induc_val)); + } + else if (nested_cycle) + { + unsigned phi_idx = loop_preheader_edge (loop)->dest_idx; + vect_get_slp_defs (SLP_TREE_CHILDREN (slp_node)[phi_idx], + &vec_initial_defs); } else { - /* Get at the scalar def before the loop, that defines the initial - value of the reduction variable. */ - tree initial_def = vect_phi_initial_value (phi); - reduc_info->reduc_initial_values.safe_push (initial_def); - /* Optimize: if initial_def is for REDUC_MAX smaller than the base - and we can't use zero for induc_val, use initial_def. Similarly - for REDUC_MIN and initial_def larger than the base. */ - if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION) - { - tree induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info); - if (TREE_CODE (initial_def) == INTEGER_CST - && !integer_zerop (induc_val) - && ((STMT_VINFO_REDUC_CODE (reduc_info) == MAX_EXPR - && tree_int_cst_lt (initial_def, induc_val)) - || (STMT_VINFO_REDUC_CODE (reduc_info) == MIN_EXPR - && tree_int_cst_lt (induc_val, initial_def)))) + gcc_assert (slp_node == slp_node_instance->reduc_phis); + vec<tree> &initial_values = reduc_info->reduc_initial_values; + vec<stmt_vec_info> &stmts = SLP_TREE_SCALAR_STMTS (slp_node); + + unsigned int num_phis = stmts.length (); + if (REDUC_GROUP_FIRST_ELEMENT (reduc_stmt_info)) + num_phis = 1; + initial_values.reserve (num_phis); + for (unsigned int i = 0; i < num_phis; ++i) + { + gphi *this_phi = as_a<gphi *> (stmts[i]->stmt); + initial_values.quick_push (vect_phi_initial_value (this_phi)); + } + if (vec_num == 1) + vect_find_reusable_accumulator (loop_vinfo, reduc_info); + if (!initial_values.is_empty ()) + { + tree initial_value + = (num_phis == 1 ? initial_values[0] : NULL_TREE); + code_helper code = STMT_VINFO_REDUC_CODE (reduc_info); + tree neutral_op + = neutral_op_for_reduction (TREE_TYPE (vectype_out), + code, initial_value); + /* Try to simplify the vector initialization by applying an + adjustment after the reduction has been performed. This + can also break a critical path but on the other hand + requires to keep the initial value live across the loop. */ + if (neutral_op + && initial_values.length () == 1 + && !reduc_info->reused_accumulator + && STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def + && !operand_equal_p (neutral_op, initial_values[0])) { - induc_val = initial_def; - /* Communicate we used the initial_def to epilouge - generation. */ - STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info) = NULL_TREE; - } - vec_initial_def = build_vector_from_val (vectype_out, induc_val); - } - else if (nested_cycle) - { - /* Do not use an adjustment def as that case is not supported - correctly if ncopies is not one. */ - vect_get_vec_defs_for_operand (loop_vinfo, reduc_stmt_info, - ncopies, initial_def, - &vec_initial_defs); - } - else if (STMT_VINFO_REDUC_TYPE (reduc_info) == CONST_COND_REDUCTION - || STMT_VINFO_REDUC_TYPE (reduc_info) == COND_REDUCTION) - /* Fill the initial vector with the initial scalar value. */ - vec_initial_def - = get_initial_def_for_reduction (loop_vinfo, reduc_stmt_info, - initial_def, initial_def); - else - { - if (ncopies == 1) - vect_find_reusable_accumulator (loop_vinfo, reduc_info); - if (!reduc_info->reduc_initial_values.is_empty ()) - { - initial_def = reduc_info->reduc_initial_values[0]; - code_helper code = STMT_VINFO_REDUC_CODE (reduc_info); - tree neutral_op - = neutral_op_for_reduction (TREE_TYPE (initial_def), - code, initial_def); - gcc_assert (neutral_op); - /* Try to simplify the vector initialization by applying an - adjustment after the reduction has been performed. */ - if (!reduc_info->reused_accumulator - && STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def - && !operand_equal_p (neutral_op, initial_def)) - { - STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info) - = initial_def; - initial_def = neutral_op; - } - vec_initial_def - = get_initial_def_for_reduction (loop_vinfo, reduc_info, - initial_def, neutral_op); + STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info) + = initial_values[0]; + initial_values[0] = neutral_op; } + get_initial_defs_for_reduction (loop_vinfo, reduc_info, + &vec_initial_defs, vec_num, + stmts.length (), neutral_op); } } if (vec_initial_def) { - vec_initial_defs.create (ncopies); - for (i = 0; i < ncopies; ++i) - vec_initial_defs.quick_push (vec_initial_def); + vec_initial_defs.create (1); + vec_initial_defs.quick_push (vec_initial_def); } if (auto *accumulator = reduc_info->reused_accumulator) @@ -9312,29 +9001,15 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo, for (i = 0; i < vec_num; i++) { tree vec_init_def = vec_initial_defs[i]; - for (j = 0; j < ncopies; j++) - { - /* Create the reduction-phi that defines the reduction - operand. */ - gphi *new_phi = create_phi_node (vec_dest, loop->header); - - /* Set the loop-entry arg of the reduction-phi. */ - if (j != 0 && nested_cycle) - vec_init_def = vec_initial_defs[j]; - add_phi_arg (new_phi, vec_init_def, loop_preheader_edge (loop), - UNKNOWN_LOCATION); + /* Create the reduction-phi that defines the reduction + operand. */ + gphi *new_phi = create_phi_node (vec_dest, loop->header); + add_phi_arg (new_phi, vec_init_def, loop_preheader_edge (loop), + UNKNOWN_LOCATION); - /* The loop-latch arg is set in epilogue processing. */ + /* The loop-latch arg is set in epilogue processing. */ - if (slp_node) - slp_node->push_vec_def (new_phi); - else - { - if (j == 0) - *vec_stmt = new_phi; - STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_phi); - } - } + slp_node->push_vec_def (new_phi); } return true; @@ -9344,7 +9019,7 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo, bool vectorizable_lc_phi (loop_vec_info loop_vinfo, - stmt_vec_info stmt_info, gimple **vec_stmt, + stmt_vec_info stmt_info, slp_tree slp_node) { if (!loop_vinfo @@ -9356,22 +9031,25 @@ vectorizable_lc_phi (loop_vec_info loop_vinfo, && STMT_VINFO_DEF_TYPE (stmt_info) != vect_double_reduction_def) return false; - if (!vec_stmt) /* transformation not required. */ + /* Deal with copies from externs or constants that disguise as + loop-closed PHI nodes (PR97886). */ + if (!vect_maybe_update_slp_op_vectype (SLP_TREE_CHILDREN (slp_node)[0], + SLP_TREE_VECTYPE (slp_node))) { - /* Deal with copies from externs or constants that disguise as - loop-closed PHI nodes (PR97886). */ - if (slp_node - && !vect_maybe_update_slp_op_vectype (SLP_TREE_CHILDREN (slp_node)[0], - SLP_TREE_VECTYPE (slp_node))) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "incompatible vector types for invariants\n"); - return false; - } - STMT_VINFO_TYPE (stmt_info) = lc_phi_info_type; - return true; + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "incompatible vector types for invariants\n"); + return false; } + STMT_VINFO_TYPE (stmt_info) = lc_phi_info_type; + return true; +} + +bool +vect_transform_lc_phi (loop_vec_info loop_vinfo, + stmt_vec_info stmt_info, + slp_tree slp_node) +{ tree vectype = STMT_VINFO_VECTYPE (stmt_info); tree scalar_dest = gimple_phi_result (stmt_info->stmt); @@ -9379,21 +9057,15 @@ vectorizable_lc_phi (loop_vec_info loop_vinfo, edge e = single_pred_edge (bb); tree vec_dest = vect_create_destination_var (scalar_dest, vectype); auto_vec<tree> vec_oprnds; - vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, - !slp_node ? vect_get_num_copies (loop_vinfo, vectype) : 1, + vect_get_vec_defs (loop_vinfo, stmt_info, slp_node, 1, gimple_phi_arg_def (stmt_info->stmt, 0), &vec_oprnds); for (unsigned i = 0; i < vec_oprnds.length (); i++) { /* Create the vectorized LC PHI node. */ gphi *new_phi = create_phi_node (vec_dest, bb); add_phi_arg (new_phi, vec_oprnds[i], e, UNKNOWN_LOCATION); - if (slp_node) - slp_node->push_vec_def (new_phi); - else - STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_phi); + slp_node->push_vec_def (new_phi); } - if (!slp_node) - *vec_stmt = STMT_VINFO_VEC_STMTS (stmt_info)[0]; return true; } @@ -12203,7 +11875,7 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance) gimple *stmt = STMT_VINFO_STMT (related_vinfo); stmt_worklist.safe_push (stmt); /* Set BB such that the assert in - 'get_initial_def_for_reduction' is able to determine that + 'get_initial_defs_for_reduction' is able to determine that the BB of the related stmt is inside this loop. */ gimple_set_bb (stmt, gimple_bb (new_stmt)); diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 562e222..857517f 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -2617,13 +2617,14 @@ out: if (oprnds_info[0]->def_stmts[0] && is_a<gassign *> (oprnds_info[0]->def_stmts[0]->stmt)) code = gimple_assign_rhs_code (oprnds_info[0]->def_stmts[0]->stmt); + basic_block bb = nullptr; for (unsigned j = 0; j < group_size; ++j) { FOR_EACH_VEC_ELT (oprnds_info, i, oprnd_info) { stmt_vec_info stmt_info = oprnd_info->def_stmts[j]; - if (!stmt_info || !stmt_info->stmt + if (!stmt_info || !is_a<gassign *> (stmt_info->stmt) || gimple_assign_rhs_code (stmt_info->stmt) != code || skip_args[i]) @@ -2631,6 +2632,14 @@ out: success = false; break; } + /* Avoid mixing lanes with defs in different basic-blocks. */ + if (!bb) + bb = gimple_bb (vect_orig_stmt (stmt_info)->stmt); + else if (gimple_bb (vect_orig_stmt (stmt_info)->stmt) != bb) + { + success = false; + break; + } bool exists; unsigned &stmt_idx @@ -5042,14 +5051,17 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size, vec<stmt_vec_info> roots = vNULL; vec<tree> remain = vNULL; gphi *phi = as_a<gphi *> (STMT_VINFO_STMT (stmt_info)); - stmts.create (1); tree def = gimple_phi_arg_def_from_edge (phi, latch_e); stmt_vec_info lc_info = loop_vinfo->lookup_def (def); - stmts.quick_push (vect_stmt_to_vectorize (lc_info)); - vect_build_slp_instance (vinfo, slp_inst_kind_reduc_group, - stmts, roots, remain, - max_tree_size, &limit, - bst_map, NULL, force_single_lane); + if (lc_info) + { + stmts.create (1); + stmts.quick_push (vect_stmt_to_vectorize (lc_info)); + vect_build_slp_instance (vinfo, slp_inst_kind_reduc_group, + stmts, roots, remain, + max_tree_size, &limit, + bst_map, NULL, force_single_lane); + } /* When the latch def is from a different cycle this can only be a induction. Build a simple instance for this. ??? We should be able to start discovery from the PHI @@ -5059,8 +5071,6 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size, tem.quick_push (stmt_info); if (!bst_map->get (tem)) { - gcc_assert (STMT_VINFO_DEF_TYPE (stmt_info) - == vect_induction_def); stmts.create (1); stmts.quick_push (stmt_info); vect_build_slp_instance (vinfo, slp_inst_kind_reduc_group, @@ -7834,21 +7844,70 @@ vect_slp_analyze_node_operations_1 (vec_info *vinfo, slp_tree node, node, node_instance, cost_vec); } +static int +sort_ints (const void *a_, const void *b_) +{ + int a = *(const int *)a_; + int b = *(const int *)b_; + return a - b; +} + /* Verify if we can externalize a set of internal defs. */ static bool vect_slp_can_convert_to_external (const vec<stmt_vec_info> &stmts) { + /* Constant generation uses get_later_stmt which can only handle + defs from the same BB or a set of defs that can be ordered + with a dominance query. */ basic_block bb = NULL; + bool all_same = true; + auto_vec<int> bbs; + bbs.reserve_exact (stmts.length ()); for (stmt_vec_info stmt : stmts) - if (!stmt) - return false; - /* Constant generation uses get_later_stmt which can only handle - defs from the same BB. */ - else if (!bb) - bb = gimple_bb (stmt->stmt); - else if (gimple_bb (stmt->stmt) != bb) + { + if (!stmt) + return false; + else if (!bb) + bb = gimple_bb (stmt->stmt); + else if (gimple_bb (stmt->stmt) != bb) + all_same = false; + bbs.quick_push (gimple_bb (stmt->stmt)->index); + } + if (all_same) + return true; + + /* Produce a vector of unique BB indexes for the defs. */ + bbs.qsort (sort_ints); + unsigned i, j; + for (i = 1, j = 1; i < bbs.length (); ++i) + if (bbs[i] != bbs[j-1]) + bbs[j++] = bbs[i]; + gcc_assert (j >= 2); + bbs.truncate (j); + + if (bbs.length () == 2) + return (dominated_by_p (CDI_DOMINATORS, + BASIC_BLOCK_FOR_FN (cfun, bbs[0]), + BASIC_BLOCK_FOR_FN (cfun, bbs[1])) + || dominated_by_p (CDI_DOMINATORS, + BASIC_BLOCK_FOR_FN (cfun, bbs[1]), + BASIC_BLOCK_FOR_FN (cfun, bbs[0]))); + + /* ??? For more than two BBs we can sort the vector and verify the + result is a total order. But we can't use vec::qsort with a + compare function using a dominance query since there's no way to + signal failure and any fallback for an unordered pair would + fail qsort_chk later. + For now simply hope that ordering after BB index provides the + best candidate total order. If required we can implement our + own mergesort or export an entry without checking. */ + for (unsigned i = 1; i < bbs.length (); ++i) + if (!dominated_by_p (CDI_DOMINATORS, + BASIC_BLOCK_FOR_FN (cfun, bbs[i]), + BASIC_BLOCK_FOR_FN (cfun, bbs[i-1]))) return false; + return true; } diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index ea0b426..efe6a2c 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -419,18 +419,21 @@ vect_stmt_relevant_p (stmt_vec_info stmt_info, loop_vec_info loop_vinfo, } } - /* Check if it's an induction and multiple exits. In this case there will be - a usage later on after peeling which is needed for the alternate exit. */ + /* Check if it's a not live PHI and multiple exits. In this case + there will be a usage later on after peeling which is needed for the + alternate exit. */ if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo) - && STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def) + && is_a <gphi *> (stmt) + && ((! VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info)) + && ! *live_p) + || STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def)) { if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "vec_stmt_relevant_p: induction forced for " - "early break.\n"); + dump_printf_loc (MSG_NOTE, vect_location, + "vec_stmt_relevant_p: PHI forced live for " + "early break.\n"); LOOP_VINFO_EARLY_BREAKS_LIVE_IVS (loop_vinfo).safe_push (stmt_info); *live_p = true; - } if (*live_p && *relevant == vect_unused_in_scope @@ -714,6 +717,8 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo, bool *fatal) bb = bbs[i]; for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) { + if (virtual_operand_p (gimple_phi_result (gsi_stmt (si)))) + continue; stmt_vec_info phi_info = loop_vinfo->lookup_stmt (gsi_stmt (si)); if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "init: phi relevant? %G", @@ -6806,7 +6811,6 @@ vectorizable_operation (vec_info *vinfo, poly_uint64 nunits_in; poly_uint64 nunits_out; tree vectype_out; - unsigned int ncopies; int vec_num; int i; vec<tree> vec_oprnds0 = vNULL; @@ -6867,7 +6871,7 @@ vectorizable_operation (vec_info *vinfo, } scalar_dest = gimple_assign_lhs (stmt); - vectype_out = STMT_VINFO_VECTYPE (stmt_info); + vectype_out = SLP_TREE_VECTYPE (slp_node); /* Most operations cannot handle bit-precision types without extra truncations. */ @@ -6978,20 +6982,8 @@ vectorizable_operation (vec_info *vinfo, } /* Multiple types in SLP are handled by creating the appropriate number of - vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in - case of SLP. */ - if (slp_node) - { - ncopies = 1; - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); - } - else - { - ncopies = vect_get_num_copies (loop_vinfo, vectype); - vec_num = 1; - } - - gcc_assert (ncopies >= 1); + vectorized stmts for each SLP node. */ + vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); /* Reject attempts to combine mask types with nonmask types, e.g. if we have an AND between a (nonmask) boolean loaded from memory and @@ -7033,9 +7025,10 @@ vectorizable_operation (vec_info *vinfo, ops we have to lower the lowering code assumes we are dealing with word_mode. */ if (!INTEGRAL_TYPE_P (TREE_TYPE (vectype)) + || !GET_MODE_SIZE (vec_mode).is_constant () || (((code == PLUS_EXPR || code == MINUS_EXPR || code == NEGATE_EXPR) - || !target_support_p) - && maybe_ne (GET_MODE_SIZE (vec_mode), UNITS_PER_WORD)) + || !target_support_p) + && maybe_ne (GET_MODE_SIZE (vec_mode), UNITS_PER_WORD)) /* Check only during analysis. */ || (!vec_stmt && !vect_can_vectorize_without_simd_p (code))) { @@ -7075,12 +7068,12 @@ vectorizable_operation (vec_info *vinfo, if (cond_len_fn != IFN_LAST && direct_internal_fn_supported_p (cond_len_fn, vectype, OPTIMIZE_FOR_SPEED)) - vect_record_loop_len (loop_vinfo, lens, ncopies * vec_num, vectype, + vect_record_loop_len (loop_vinfo, lens, vec_num, vectype, 1); else if (cond_fn != IFN_LAST && direct_internal_fn_supported_p (cond_fn, vectype, OPTIMIZE_FOR_SPEED)) - vect_record_loop_mask (loop_vinfo, masks, ncopies * vec_num, + vect_record_loop_mask (loop_vinfo, masks, vec_num, vectype, NULL); else { @@ -7093,10 +7086,9 @@ vectorizable_operation (vec_info *vinfo, } /* Put types on constant and invariant SLP children. */ - if (slp_node - && (!vect_maybe_update_slp_op_vectype (slp_op0, vectype) - || !vect_maybe_update_slp_op_vectype (slp_op1, vectype) - || !vect_maybe_update_slp_op_vectype (slp_op2, vectype))) + if (!vect_maybe_update_slp_op_vectype (slp_op0, vectype) + || !vect_maybe_update_slp_op_vectype (slp_op1, vectype) + || !vect_maybe_update_slp_op_vectype (slp_op2, vectype)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -7107,15 +7099,14 @@ vectorizable_operation (vec_info *vinfo, STMT_VINFO_TYPE (stmt_info) = op_vec_info_type; DUMP_VECT_SCOPE ("vectorizable_operation"); vect_model_simple_cost (vinfo, stmt_info, - ncopies, dt, ndts, slp_node, cost_vec); + 1, dt, ndts, slp_node, cost_vec); if (using_emulated_vectors_p) { /* The above vect_model_simple_cost call handles constants in the prologue and (mis-)costs one of the stmts as vector stmt. See below for the actual lowering that will be applied. */ - unsigned n - = slp_node ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) : ncopies; + unsigned n = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); switch (code) { case PLUS_EXPR: @@ -7168,60 +7159,7 @@ vectorizable_operation (vec_info *vinfo, else vec_dest = vect_create_destination_var (scalar_dest, vectype_out); - /* In case the vectorization factor (VF) is bigger than the number - of elements that we can fit in a vectype (nunits), we have to generate - more than one vector stmt - i.e - we need to "unroll" the - vector stmt by a factor VF/nunits. In doing so, we record a pointer - from one copy of the vector stmt to the next, in the field - STMT_VINFO_RELATED_STMT. This is necessary in order to allow following - stages to find the correct vector defs to be used when vectorizing - stmts that use the defs of the current stmt. The example below - illustrates the vectorization process when VF=16 and nunits=4 (i.e., - we need to create 4 vectorized stmts): - - before vectorization: - RELATED_STMT VEC_STMT - S1: x = memref - - - S2: z = x + 1 - - - - step 1: vectorize stmt S1 (done in vectorizable_load. See more details - there): - RELATED_STMT VEC_STMT - VS1_0: vx0 = memref0 VS1_1 - - VS1_1: vx1 = memref1 VS1_2 - - VS1_2: vx2 = memref2 VS1_3 - - VS1_3: vx3 = memref3 - - - S1: x = load - VS1_0 - S2: z = x + 1 - - - - step2: vectorize stmt S2 (done here): - To vectorize stmt S2 we first need to find the relevant vector - def for the first operand 'x'. This is, as usual, obtained from - the vector stmt recorded in the STMT_VINFO_VEC_STMT of the stmt - that defines 'x' (S1). This way we find the stmt VS1_0, and the - relevant vector def 'vx0'. Having found 'vx0' we can generate - the vector stmt VS2_0, and as usual, record it in the - STMT_VINFO_VEC_STMT of stmt S2. - When creating the second copy (VS2_1), we obtain the relevant vector - def from the vector stmt recorded in the STMT_VINFO_RELATED_STMT of - stmt VS1_0. This way we find the stmt VS1_1 and the relevant - vector def 'vx1'. Using 'vx1' we create stmt VS2_1 and record a - pointer to it in the STMT_VINFO_RELATED_STMT of the vector stmt VS2_0. - Similarly when creating stmts VS2_2 and VS2_3. This is the resulting - chain of stmts and pointers: - RELATED_STMT VEC_STMT - VS1_0: vx0 = memref0 VS1_1 - - VS1_1: vx1 = memref1 VS1_2 - - VS1_2: vx2 = memref2 VS1_3 - - VS1_3: vx3 = memref3 - - - S1: x = load - VS1_0 - VS2_0: vz0 = vx0 + v1 VS2_1 - - VS2_1: vz1 = vx1 + v1 VS2_2 - - VS2_2: vz2 = vx2 + v1 VS2_3 - - VS2_3: vz3 = vx3 + v1 - - - S2: z = x + 1 - VS2_0 */ - - vect_get_vec_defs (vinfo, stmt_info, slp_node, ncopies, + vect_get_vec_defs (vinfo, stmt_info, slp_node, 1, op0, &vec_oprnds0, op1, &vec_oprnds1, op2, &vec_oprnds2); /* Arguments are ready. Create the new vector stmt. */ FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0) @@ -7230,88 +7168,108 @@ vectorizable_operation (vec_info *vinfo, vop1 = ((op_type == binary_op || op_type == ternary_op) ? vec_oprnds1[i] : NULL_TREE); vop2 = ((op_type == ternary_op) ? vec_oprnds2[i] : NULL_TREE); - if (using_emulated_vectors_p - && (code == PLUS_EXPR || code == MINUS_EXPR || code == NEGATE_EXPR)) + if (using_emulated_vectors_p) { /* Lower the operation. This follows vector lowering. */ - unsigned int width = vector_element_bits (vectype); - tree inner_type = TREE_TYPE (vectype); - tree word_type - = build_nonstandard_integer_type (GET_MODE_BITSIZE (word_mode), 1); - HOST_WIDE_INT max = GET_MODE_MASK (TYPE_MODE (inner_type)); - tree low_bits = build_replicated_int_cst (word_type, width, max >> 1); - tree high_bits - = build_replicated_int_cst (word_type, width, max & ~(max >> 1)); + tree word_type = build_nonstandard_integer_type + (GET_MODE_BITSIZE (vec_mode).to_constant (), 1); tree wvop0 = make_ssa_name (word_type); new_stmt = gimple_build_assign (wvop0, VIEW_CONVERT_EXPR, build1 (VIEW_CONVERT_EXPR, word_type, vop0)); vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - tree result_low, signs; - if (code == PLUS_EXPR || code == MINUS_EXPR) + tree wvop1 = NULL_TREE; + if (vop1) { - tree wvop1 = make_ssa_name (word_type); + wvop1 = make_ssa_name (word_type); new_stmt = gimple_build_assign (wvop1, VIEW_CONVERT_EXPR, build1 (VIEW_CONVERT_EXPR, word_type, vop1)); vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - signs = make_ssa_name (word_type); - new_stmt = gimple_build_assign (signs, - BIT_XOR_EXPR, wvop0, wvop1); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - tree b_low = make_ssa_name (word_type); - new_stmt = gimple_build_assign (b_low, - BIT_AND_EXPR, wvop1, low_bits); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - tree a_low = make_ssa_name (word_type); - if (code == PLUS_EXPR) - new_stmt = gimple_build_assign (a_low, - BIT_AND_EXPR, wvop0, low_bits); - else - new_stmt = gimple_build_assign (a_low, - BIT_IOR_EXPR, wvop0, high_bits); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - if (code == MINUS_EXPR) + } + + tree result_low; + if (code == PLUS_EXPR || code == MINUS_EXPR || code == NEGATE_EXPR) + { + unsigned int width = vector_element_bits (vectype); + tree inner_type = TREE_TYPE (vectype); + HOST_WIDE_INT max = GET_MODE_MASK (TYPE_MODE (inner_type)); + tree low_bits + = build_replicated_int_cst (word_type, width, max >> 1); + tree high_bits + = build_replicated_int_cst (word_type, + width, max & ~(max >> 1)); + tree signs; + if (code == PLUS_EXPR || code == MINUS_EXPR) { - new_stmt = gimple_build_assign (NULL_TREE, - BIT_NOT_EXPR, signs); + signs = make_ssa_name (word_type); + new_stmt = gimple_build_assign (signs, + BIT_XOR_EXPR, wvop0, wvop1); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + tree b_low = make_ssa_name (word_type); + new_stmt = gimple_build_assign (b_low, BIT_AND_EXPR, + wvop1, low_bits); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + tree a_low = make_ssa_name (word_type); + if (code == PLUS_EXPR) + new_stmt = gimple_build_assign (a_low, BIT_AND_EXPR, + wvop0, low_bits); + else + new_stmt = gimple_build_assign (a_low, BIT_IOR_EXPR, + wvop0, high_bits); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + if (code == MINUS_EXPR) + { + new_stmt = gimple_build_assign (NULL_TREE, + BIT_NOT_EXPR, signs); + signs = make_ssa_name (word_type); + gimple_assign_set_lhs (new_stmt, signs); + vect_finish_stmt_generation (vinfo, stmt_info, + new_stmt, gsi); + } + new_stmt = gimple_build_assign (NULL_TREE, BIT_AND_EXPR, + signs, high_bits); signs = make_ssa_name (word_type); gimple_assign_set_lhs (new_stmt, signs); vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + result_low = make_ssa_name (word_type); + new_stmt = gimple_build_assign (result_low, code, + a_low, b_low); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); } - new_stmt = gimple_build_assign (NULL_TREE, - BIT_AND_EXPR, signs, high_bits); - signs = make_ssa_name (word_type); - gimple_assign_set_lhs (new_stmt, signs); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + else /* if (code == NEGATE_EXPR) */ + { + tree a_low = make_ssa_name (word_type); + new_stmt = gimple_build_assign (a_low, BIT_AND_EXPR, + wvop0, low_bits); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + signs = make_ssa_name (word_type); + new_stmt = gimple_build_assign (signs, BIT_NOT_EXPR, wvop0); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + new_stmt = gimple_build_assign (NULL_TREE, BIT_AND_EXPR, + signs, high_bits); + signs = make_ssa_name (word_type); + gimple_assign_set_lhs (new_stmt, signs); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + result_low = make_ssa_name (word_type); + new_stmt = gimple_build_assign (result_low, + MINUS_EXPR, high_bits, a_low); + vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + } + new_stmt = gimple_build_assign (NULL_TREE, BIT_XOR_EXPR, + result_low, signs); result_low = make_ssa_name (word_type); - new_stmt = gimple_build_assign (result_low, code, a_low, b_low); + gimple_assign_set_lhs (new_stmt, result_low); vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); } else { - tree a_low = make_ssa_name (word_type); - new_stmt = gimple_build_assign (a_low, - BIT_AND_EXPR, wvop0, low_bits); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - signs = make_ssa_name (word_type); - new_stmt = gimple_build_assign (signs, BIT_NOT_EXPR, wvop0); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); - new_stmt = gimple_build_assign (NULL_TREE, - BIT_AND_EXPR, signs, high_bits); - signs = make_ssa_name (word_type); - gimple_assign_set_lhs (new_stmt, signs); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + new_stmt = gimple_build_assign (NULL_TREE, code, wvop0, wvop1); result_low = make_ssa_name (word_type); - new_stmt = gimple_build_assign (result_low, - MINUS_EXPR, high_bits, a_low); + gimple_assign_set_lhs (new_stmt, result_low); vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); + } - new_stmt = gimple_build_assign (NULL_TREE, BIT_XOR_EXPR, result_low, - signs); - result_low = make_ssa_name (word_type); - gimple_assign_set_lhs (new_stmt, result_low); - vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi); new_stmt = gimple_build_assign (NULL_TREE, VIEW_CONVERT_EXPR, build1 (VIEW_CONVERT_EXPR, vectype, result_low)); @@ -7324,7 +7282,7 @@ vectorizable_operation (vec_info *vinfo, tree mask; if (masked_loop_p) mask = vect_get_loop_mask (loop_vinfo, gsi, masks, - vec_num * ncopies, vectype, i); + vec_num, vectype, i); else /* Dummy mask. */ mask = build_minus_one_cst (truth_type_for (vectype)); @@ -7351,7 +7309,7 @@ vectorizable_operation (vec_info *vinfo, if (len_loop_p) { tree len = vect_get_loop_len (loop_vinfo, gsi, lens, - vec_num * ncopies, vectype, i, 1); + vec_num, vectype, i, 1); signed char biasval = LOOP_VINFO_PARTIAL_LOAD_STORE_BIAS (loop_vinfo); tree bias = build_int_cst (intQI_type_node, biasval); @@ -7378,21 +7336,19 @@ vectorizable_operation (vec_info *vinfo, && code == BIT_AND_EXPR && VECTOR_BOOLEAN_TYPE_P (vectype)) { - if (loop_vinfo->scalar_cond_masked_set.contains ({ op0, - ncopies})) + if (loop_vinfo->scalar_cond_masked_set.contains ({ op0, 1 })) { mask = vect_get_loop_mask (loop_vinfo, gsi, masks, - vec_num * ncopies, vectype, i); + vec_num, vectype, i); vop0 = prepare_vec_mask (loop_vinfo, TREE_TYPE (mask), mask, vop0, gsi); } - if (loop_vinfo->scalar_cond_masked_set.contains ({ op1, - ncopies })) + if (loop_vinfo->scalar_cond_masked_set.contains ({ op1, 1 })) { mask = vect_get_loop_mask (loop_vinfo, gsi, masks, - vec_num * ncopies, vectype, i); + vec_num, vectype, i); vop1 = prepare_vec_mask (loop_vinfo, TREE_TYPE (mask), mask, vop1, gsi); @@ -7423,15 +7379,9 @@ vectorizable_operation (vec_info *vinfo, new_stmt, gsi); } - if (slp_node) - slp_node->push_vec_def (new_stmt); - else - STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt); + slp_node->push_vec_def (new_stmt); } - if (!slp_node) - *vec_stmt = STMT_VINFO_VEC_STMTS (stmt_info)[0]; - vec_oprnds0.release (); vec_oprnds1.release (); vec_oprnds2.release (); @@ -8786,6 +8736,15 @@ vectorizable_store (vec_info *vinfo, if (n == const_nunits) { int mis_align = dr_misalignment (first_dr_info, vectype); + /* With VF > 1 we advance the DR by step, if that is constant + and only aligned when performed VF times, DR alignment + analysis can analyze this as aligned since it assumes + contiguous accesses. But that is not how we code generate + here, so adjust for this. */ + if (maybe_gt (vf, 1u) + && !multiple_p (DR_STEP_ALIGNMENT (first_dr_info->dr), + DR_TARGET_ALIGNMENT (first_dr_info))) + mis_align = -1; dr_alignment_support dr_align = vect_supportable_dr_alignment (vinfo, dr_info, vectype, mis_align); @@ -8807,6 +8766,10 @@ vectorizable_store (vec_info *vinfo, ltype = build_vector_type (elem_type, n); lvectype = vectype; int mis_align = dr_misalignment (first_dr_info, ltype); + if (maybe_gt (vf, 1u) + && !multiple_p (DR_STEP_ALIGNMENT (first_dr_info->dr), + DR_TARGET_ALIGNMENT (first_dr_info))) + mis_align = -1; dr_alignment_support dr_align = vect_supportable_dr_alignment (vinfo, dr_info, ltype, mis_align); @@ -8867,17 +8830,10 @@ vectorizable_store (vec_info *vinfo, } } unsigned align; - /* ??? We'd want to use - if (alignment_support_scheme == dr_aligned) - align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info)); - since doing that is what we assume we can in the above checks. - But this interferes with groups with gaps where for example - VF == 2 makes the group in the unrolled loop aligned but the - fact that we advance with step between the two subgroups - makes the access to the second unaligned. See PR119586. - We have to anticipate that here or adjust code generation to - avoid the misaligned loads by means of permutations. */ - align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info)); + if (alignment_support_scheme == dr_aligned) + align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info)); + else + align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info)); /* Alignment is at most the access size if we do multiple stores. */ if (nstores > 1) align = MIN (tree_to_uhwi (TYPE_SIZE_UNIT (ltype)), align); @@ -10805,6 +10761,15 @@ vectorizable_load (vec_info *vinfo, if (n == const_nunits) { int mis_align = dr_misalignment (first_dr_info, vectype); + /* With VF > 1 we advance the DR by step, if that is constant + and only aligned when performed VF times, DR alignment + analysis can analyze this as aligned since it assumes + contiguous accesses. But that is not how we code generate + here, so adjust for this. */ + if (maybe_gt (vf, 1u) + && !multiple_p (DR_STEP_ALIGNMENT (first_dr_info->dr), + DR_TARGET_ALIGNMENT (first_dr_info))) + mis_align = -1; dr_alignment_support dr_align = vect_supportable_dr_alignment (vinfo, dr_info, vectype, mis_align); @@ -10833,6 +10798,10 @@ vectorizable_load (vec_info *vinfo, if (VECTOR_TYPE_P (ptype)) { mis_align = dr_misalignment (first_dr_info, ptype); + if (maybe_gt (vf, 1u) + && !multiple_p (DR_STEP_ALIGNMENT (first_dr_info->dr), + DR_TARGET_ALIGNMENT (first_dr_info))) + mis_align = -1; dr_align = vect_supportable_dr_alignment (vinfo, dr_info, ptype, mis_align); @@ -10852,8 +10821,10 @@ vectorizable_load (vec_info *vinfo, } } unsigned align; - /* ??? The above is still wrong, see vectorizable_store. */ - align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info)); + if (alignment_support_scheme == dr_aligned) + align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info)); + else + align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info)); /* Alignment is at most the access size if we do multiple loads. */ if (nloads > 1) align = MIN (tree_to_uhwi (TYPE_SIZE_UNIT (ltype)), align); @@ -14014,7 +13985,7 @@ vect_analyze_stmt (vec_info *vinfo, || vectorizable_comparison (vinfo, stmt_info, NULL, NULL, node, cost_vec) || vectorizable_lc_phi (as_a <loop_vec_info> (vinfo), - stmt_info, NULL, node) + stmt_info, node) || vectorizable_recurr (as_a <loop_vec_info> (vinfo), stmt_info, NULL, node, cost_vec) || vectorizable_early_exit (vinfo, stmt_info, NULL, NULL, node, @@ -14181,19 +14152,19 @@ vect_transform_stmt (vec_info *vinfo, case reduc_vec_info_type: done = vect_transform_reduction (as_a <loop_vec_info> (vinfo), stmt_info, - gsi, &vec_stmt, slp_node); + gsi, slp_node); gcc_assert (done); break; case cycle_phi_info_type: done = vect_transform_cycle_phi (as_a <loop_vec_info> (vinfo), stmt_info, - &vec_stmt, slp_node, slp_node_instance); + slp_node, slp_node_instance); gcc_assert (done); break; case lc_phi_info_type: - done = vectorizable_lc_phi (as_a <loop_vec_info> (vinfo), - stmt_info, &vec_stmt, slp_node); + done = vect_transform_lc_phi (as_a <loop_vec_info> (vinfo), + stmt_info, slp_node); gcc_assert (done); break; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 3d11559..a2f33a5 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -2625,12 +2625,11 @@ extern bool vectorizable_induction (loop_vec_info, stmt_vec_info, stmt_vector_for_cost *); extern bool vect_transform_reduction (loop_vec_info, stmt_vec_info, gimple_stmt_iterator *, - gimple **, slp_tree); + slp_tree); extern bool vect_transform_cycle_phi (loop_vec_info, stmt_vec_info, - gimple **, slp_tree, slp_instance); -extern bool vectorizable_lc_phi (loop_vec_info, stmt_vec_info, - gimple **, slp_tree); +extern bool vectorizable_lc_phi (loop_vec_info, stmt_vec_info, slp_tree); +extern bool vect_transform_lc_phi (loop_vec_info, stmt_vec_info, slp_tree); extern bool vectorizable_phi (vec_info *, stmt_vec_info, gimple **, slp_tree, stmt_vector_for_cost *); extern bool vectorizable_recurr (loop_vec_info, stmt_vec_info, diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc index 6603d90..4c78759 100644 --- a/gcc/vr-values.cc +++ b/gcc/vr-values.cc @@ -1996,10 +1996,13 @@ simplify_using_ranges::simplify (gimple_stmt_iterator *gsi) case BIT_AND_EXPR: case BIT_IOR_EXPR: - /* Optimize away BIT_AND_EXPR and BIT_IOR_EXPR - if all the bits being cleared are already cleared or - all the bits being set are already set. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))) + /* Optimize away BIT_AND_EXPR and BIT_IOR_EXPR if all the bits + being cleared are already cleared or all the bits being set + are already set. Beware that boolean types must be handled + logically (see range-op.cc) unless they have precision 1. */ + if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) + && (TREE_CODE (TREE_TYPE (rhs1)) != BOOLEAN_TYPE + || TYPE_PRECISION (TREE_TYPE (rhs1)) == 1)) return simplify_bit_ops_using_ranges (gsi, stmt); break; diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog index 62e6c4e..f0901b8 100644 --- a/libatomic/ChangeLog +++ b/libatomic/ChangeLog @@ -1,3 +1,8 @@ +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * testsuite/lib/libatomic.exp: Add load_lib of scanhtml.exp. + 2025-04-16 Jakub Jelinek <jakub@redhat.com> PR libgcc/101075 diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp index 4b52a6f..456493c 100644 --- a/libatomic/testsuite/lib/libatomic.exp +++ b/libatomic/testsuite/lib/libatomic.exp @@ -37,6 +37,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scansarif.exp +load_gcc_lib scanhtml.exp load_gcc_lib scantree.exp load_gcc_lib scanltrans.exp load_gcc_lib scanipa.exp diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 9a5208c..eef6ec7 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,16 @@ +2025-05-07 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/108900 + PR preprocessor/116047 + PR preprocessor/120061 + * files.cc (_cpp_stack_file): Revert 2025-03-28 change. + * line-map.cc (linemap_add): Use + SOURCE_LINE (from, linemap_included_from (map - 1)) + 1; instead of + SOURCE_LINE (from, from[1].start_location); to compute to_line + for LC_LEAVE. For LC_ENTER included_from computation, look at + map[-2] or even lower if map[-1] has the same start_location as + map[0]. + 2025-04-28 Lewis Hyatt <lhyatt@gmail.com> PR c/118838 diff --git a/libgcobol/ChangeLog b/libgcobol/ChangeLog index dc42330..47f087d 100644 --- a/libgcobol/ChangeLog +++ b/libgcobol/ChangeLog @@ -1,3 +1,9 @@ +2025-05-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * configure.ac: Handle --enable-libgcobol. + Let it override LIBGCOBOL_SUPPORTED. + * configure: Regenerate. + 2025-05-06 Iain Sandoe <iain@sandoe.co.uk> * config.h.in: Regenerate. diff --git a/libgcobol/configure b/libgcobol/configure index 06e7544..5f319ee 100755 --- a/libgcobol/configure +++ b/libgcobol/configure @@ -788,6 +788,7 @@ enable_option_checking enable_multilib enable_maintainer_mode enable_silent_rules +enable_libgcobol enable_version_specific_runtime_libs enable_dependency_tracking enable_shared @@ -1438,6 +1439,7 @@ Optional Features: sometimes confusing) to the casual installer --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") + --enable-libgcobol Enable libgcobol --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory @@ -3723,6 +3725,16 @@ END fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-libgcobol" >&5 +$as_echo_n "checking for --enable-libgcobol... " >&6; } +# Check whether --enable-libgcobol was given. +if test "${enable_libgcobol+set}" = set; then : + enableval=$enable_libgcobol; +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libgcobol" >&5 +$as_echo "$enable_libgcobol" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5 $as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; } # Check whether --enable-version-specific-runtime-libs was given. @@ -11798,7 +11810,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11801 "configure" +#line 11813 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11904,7 +11916,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11907 "configure" +#line 11919 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16795,6 +16807,14 @@ _ACEOF unset LIBGCOBOL_SUPPORTED . ${srcdir}/configure.tgt +# Decide if it's usable. +case $LIBGCOBOL_SUPPORTED:$enable_libgcobol in +*:no) use_libgcobol=no ;; +*:yes) use_libgcobol=yes ;; +yes:*) use_libgcobol=yes ;; +*:*) use_libgcobol=no ;; +esac + # ----------------- # __int128 support # ----------------- @@ -16887,7 +16907,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcobol_cv_have_int128" >&5 $as_echo "$libgcobol_cv_have_int128" >&6; } - if test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then + if test "x$use_libgcobol" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then BUILD_LIBGCOBOL_TRUE= BUILD_LIBGCOBOL_FALSE='#' else diff --git a/libgcobol/configure.ac b/libgcobol/configure.ac index e254763..1332696 100644 --- a/libgcobol/configure.ac +++ b/libgcobol/configure.ac @@ -40,6 +40,11 @@ AM_MAINTAINER_MODE AM_INIT_AUTOMAKE([1.15.1 no-define foreign no-dist -Wall -Wno-portability]) +AC_MSG_CHECKING([for --enable-libgcobol]) +AC_ARG_ENABLE(libgcobol, + [AS_HELP_STRING([--enable-libgcobol], [Enable libgcobol])]) +AC_MSG_RESULT($enable_libgcobol) + AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) AC_ARG_ENABLE(version-specific-runtime-libs, AS_HELP_STRING([--enable-version-specific-runtime-libs], @@ -138,6 +143,14 @@ AC_CHECK_SIZEOF([void *]) unset LIBGCOBOL_SUPPORTED . ${srcdir}/configure.tgt +# Decide if it's usable. +case $LIBGCOBOL_SUPPORTED:$enable_libgcobol in +*:no) use_libgcobol=no ;; +*:yes) use_libgcobol=yes ;; +yes:*) use_libgcobol=yes ;; +*:*) use_libgcobol=no ;; +esac + # ----------------- # __int128 support # ----------------- @@ -164,7 +177,7 @@ AC_CACHE_CHECK([whether __int128 is supported], [libgcobol_cv_have_int128], libgcobol_cv_have_int128=no ])]) -AM_CONDITIONAL(BUILD_LIBGCOBOL, [test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes]) +AM_CONDITIONAL(BUILD_LIBGCOBOL, [test "x$use_libgcobol" = xyes && test "x$libgcobol_cv_have_int128" = xyes]) # Check if functions are available in libc before adding extra libs. AC_SEARCH_LIBS([malloc], [c]) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index aa92b02..8c4a7ee 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,66 @@ +2025-05-08 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120158 + * m4/iparm.m4 (atype_min): For atype_name starting with + GFC_UINTEGER define to 0. + * generated/maxloc0_16_m1.c: Regenerate. + * generated/maxloc0_16_m2.c: Regenerate. + * generated/maxloc0_16_m4.c: Regenerate. + * generated/maxloc0_16_m8.c: Regenerate. + * generated/maxloc0_16_m16.c: Regenerate. + * generated/maxloc0_4_m1.c: Regenerate. + * generated/maxloc0_4_m2.c: Regenerate. + * generated/maxloc0_4_m4.c: Regenerate. + * generated/maxloc0_4_m8.c: Regenerate. + * generated/maxloc0_4_m16.c: Regenerate. + * generated/maxloc0_8_m1.c: Regenerate. + * generated/maxloc0_8_m2.c: Regenerate. + * generated/maxloc0_8_m4.c: Regenerate. + * generated/maxloc0_8_m8.c: Regenerate. + * generated/maxloc0_8_m16.c: Regenerate. + * generated/maxloc1_16_m1.c: Regenerate. + * generated/maxloc1_16_m2.c: Regenerate. + * generated/maxloc1_16_m4.c: Regenerate. + * generated/maxloc1_16_m8.c: Regenerate. + * generated/maxloc1_16_m16.c: Regenerate. + * generated/maxloc1_4_m1.c: Regenerate. + * generated/maxloc1_4_m2.c: Regenerate. + * generated/maxloc1_4_m4.c: Regenerate. + * generated/maxloc1_4_m8.c: Regenerate. + * generated/maxloc1_4_m16.c: Regenerate. + * generated/maxloc1_8_m1.c: Regenerate. + * generated/maxloc1_8_m2.c: Regenerate. + * generated/maxloc1_8_m4.c: Regenerate. + * generated/maxloc1_8_m8.c: Regenerate. + * generated/maxloc1_8_m16.c: Regenerate. + * generated/maxval_m1.c: Regenerate. + * generated/maxval_m2.c: Regenerate. + * generated/maxval_m4.c: Regenerate. + * generated/maxval_m8.c: Regenerate. + * generated/maxval_m16.c: Regenerate. + +2025-05-07 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120153 + * Makefile.am (i_maxloc1_c): Add generated/maxloc1_16_m16.c. + * intrinsics/random.c (arandom_m16): Use #ifdef HAVE_GFC_UINTEGER_16 + guard rather than #ifdef GFC_HAVE_GFC_UINTEGER_16. + * gfortran.map (GFORTRAN_15): Remove _gfortran_arandom_m16, + _gfortran_maxloc1_16_m16, _gfortran_mmaxloc1_16_m16 and + _gfortran_smaxloc1_16_m16. + (GFORTRAN_15.2): New symbol version, add those 4 symbols to it. + * generated/maxloc1_16_m16.c: New file. + * Makefile.in: Regenerate. + +2025-05-07 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120152 + * Makefile.am (i_maxloc1_c): Readd generated/maxloc1_4_i8.c, + generated/maxloc1_8_i8.c, generated/maxloc1_16_i8.c, + generated/maxloc1_4_i16.c, generated/maxloc1_8_i16.c. Move + generated/maxloc1_16_i16.c entry earlier in the list. + * Makefile.in: Regenerated. + 2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> * caf/libcaf.h: Add mapping mode to coarray's register. diff --git a/libgfortran/generated/maxloc0_16_m1.c b/libgfortran/generated/maxloc0_16_m1.c index d13ebbf..2a47b9e 100644 --- a/libgfortran/generated/maxloc0_16_m1.c +++ b/libgfortran/generated/maxloc0_16_m1.c @@ -96,7 +96,7 @@ maxloc0_16_m1 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_16_m1 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_16_m16.c b/libgfortran/generated/maxloc0_16_m16.c index 00cb09b..1003fdb 100644 --- a/libgfortran/generated/maxloc0_16_m16.c +++ b/libgfortran/generated/maxloc0_16_m16.c @@ -96,7 +96,7 @@ maxloc0_16_m16 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_16_m16 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_16_m2.c b/libgfortran/generated/maxloc0_16_m2.c index 3244952..49b92f7 100644 --- a/libgfortran/generated/maxloc0_16_m2.c +++ b/libgfortran/generated/maxloc0_16_m2.c @@ -96,7 +96,7 @@ maxloc0_16_m2 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_16_m2 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_16_m4.c b/libgfortran/generated/maxloc0_16_m4.c index 3cda598d..0144125 100644 --- a/libgfortran/generated/maxloc0_16_m4.c +++ b/libgfortran/generated/maxloc0_16_m4.c @@ -96,7 +96,7 @@ maxloc0_16_m4 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_16_m4 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_16_m8.c b/libgfortran/generated/maxloc0_16_m8.c index f98485d..96d6295 100644 --- a/libgfortran/generated/maxloc0_16_m8.c +++ b/libgfortran/generated/maxloc0_16_m8.c @@ -96,7 +96,7 @@ maxloc0_16_m8 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_16_m8 (gfc_array_i16 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_4_m1.c b/libgfortran/generated/maxloc0_4_m1.c index 7ae89c1..7825952 100644 --- a/libgfortran/generated/maxloc0_4_m1.c +++ b/libgfortran/generated/maxloc0_4_m1.c @@ -96,7 +96,7 @@ maxloc0_4_m1 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_4_m1 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_4_m16.c b/libgfortran/generated/maxloc0_4_m16.c index 8d62e04..4e90c49 100644 --- a/libgfortran/generated/maxloc0_4_m16.c +++ b/libgfortran/generated/maxloc0_4_m16.c @@ -96,7 +96,7 @@ maxloc0_4_m16 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_4_m16 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_4_m2.c b/libgfortran/generated/maxloc0_4_m2.c index c8cf68b..b6b530b 100644 --- a/libgfortran/generated/maxloc0_4_m2.c +++ b/libgfortran/generated/maxloc0_4_m2.c @@ -96,7 +96,7 @@ maxloc0_4_m2 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_4_m2 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_4_m4.c b/libgfortran/generated/maxloc0_4_m4.c index 3f5f550..b3ee5af 100644 --- a/libgfortran/generated/maxloc0_4_m4.c +++ b/libgfortran/generated/maxloc0_4_m4.c @@ -96,7 +96,7 @@ maxloc0_4_m4 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_4_m4 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_4_m8.c b/libgfortran/generated/maxloc0_4_m8.c index d4c30f8..4f7ec05 100644 --- a/libgfortran/generated/maxloc0_4_m8.c +++ b/libgfortran/generated/maxloc0_4_m8.c @@ -96,7 +96,7 @@ maxloc0_4_m8 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_4_m8 (gfc_array_i4 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_8_m1.c b/libgfortran/generated/maxloc0_8_m1.c index af97213..2b4b0e7 100644 --- a/libgfortran/generated/maxloc0_8_m1.c +++ b/libgfortran/generated/maxloc0_8_m1.c @@ -96,7 +96,7 @@ maxloc0_8_m1 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_8_m1 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_8_m16.c b/libgfortran/generated/maxloc0_8_m16.c index e2d47b6..da03132 100644 --- a/libgfortran/generated/maxloc0_8_m16.c +++ b/libgfortran/generated/maxloc0_8_m16.c @@ -96,7 +96,7 @@ maxloc0_8_m16 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_8_m16 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_8_m2.c b/libgfortran/generated/maxloc0_8_m2.c index 390fc8f..0c7b74c 100644 --- a/libgfortran/generated/maxloc0_8_m2.c +++ b/libgfortran/generated/maxloc0_8_m2.c @@ -96,7 +96,7 @@ maxloc0_8_m2 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_8_m2 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_8_m4.c b/libgfortran/generated/maxloc0_8_m4.c index 05dda2c..307a04b 100644 --- a/libgfortran/generated/maxloc0_8_m4.c +++ b/libgfortran/generated/maxloc0_8_m4.c @@ -96,7 +96,7 @@ maxloc0_8_m4 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_8_m4 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc0_8_m8.c b/libgfortran/generated/maxloc0_8_m8.c index 48875e7..5160418 100644 --- a/libgfortran/generated/maxloc0_8_m8.c +++ b/libgfortran/generated/maxloc0_8_m8.c @@ -96,7 +96,7 @@ maxloc0_8_m8 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { @@ -271,7 +271,7 @@ mmaxloc0_8_m8 (gfc_array_i8 * const restrict retarray, #if defined(GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif while (base) { diff --git a/libgfortran/generated/maxloc1_16_m1.c b/libgfortran/generated/maxloc1_16_m1.c index 14961da..4d78e75 100644 --- a/libgfortran/generated/maxloc1_16_m1.c +++ b/libgfortran/generated/maxloc1_16_m1.c @@ -147,7 +147,7 @@ maxloc1_16_m1 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_16_m1 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_1_QUIET_NAN) GFC_INTEGER_16 result2 = 0; diff --git a/libgfortran/generated/maxloc1_16_m16.c b/libgfortran/generated/maxloc1_16_m16.c index d97dbc0..e6f1ae3 100644 --- a/libgfortran/generated/maxloc1_16_m16.c +++ b/libgfortran/generated/maxloc1_16_m16.c @@ -147,7 +147,7 @@ maxloc1_16_m16 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_16_m16 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_16_QUIET_NAN) GFC_INTEGER_16 result2 = 0; diff --git a/libgfortran/generated/maxloc1_16_m2.c b/libgfortran/generated/maxloc1_16_m2.c index 0187b68..8bb48dd 100644 --- a/libgfortran/generated/maxloc1_16_m2.c +++ b/libgfortran/generated/maxloc1_16_m2.c @@ -147,7 +147,7 @@ maxloc1_16_m2 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_16_m2 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_2_QUIET_NAN) GFC_INTEGER_16 result2 = 0; diff --git a/libgfortran/generated/maxloc1_16_m4.c b/libgfortran/generated/maxloc1_16_m4.c index 480a524..659d6cf 100644 --- a/libgfortran/generated/maxloc1_16_m4.c +++ b/libgfortran/generated/maxloc1_16_m4.c @@ -147,7 +147,7 @@ maxloc1_16_m4 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_16_m4 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_4_QUIET_NAN) GFC_INTEGER_16 result2 = 0; diff --git a/libgfortran/generated/maxloc1_16_m8.c b/libgfortran/generated/maxloc1_16_m8.c index ecbaba3..a6d2c08 100644 --- a/libgfortran/generated/maxloc1_16_m8.c +++ b/libgfortran/generated/maxloc1_16_m8.c @@ -147,7 +147,7 @@ maxloc1_16_m8 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_16_m8 (gfc_array_i16 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_8_QUIET_NAN) GFC_INTEGER_16 result2 = 0; diff --git a/libgfortran/generated/maxloc1_4_m1.c b/libgfortran/generated/maxloc1_4_m1.c index e69d49d..709a1dd 100644 --- a/libgfortran/generated/maxloc1_4_m1.c +++ b/libgfortran/generated/maxloc1_4_m1.c @@ -147,7 +147,7 @@ maxloc1_4_m1 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_4_m1 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_1_QUIET_NAN) GFC_INTEGER_4 result2 = 0; diff --git a/libgfortran/generated/maxloc1_4_m16.c b/libgfortran/generated/maxloc1_4_m16.c index 0ed90bb..cc10527 100644 --- a/libgfortran/generated/maxloc1_4_m16.c +++ b/libgfortran/generated/maxloc1_4_m16.c @@ -147,7 +147,7 @@ maxloc1_4_m16 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_4_m16 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_16_QUIET_NAN) GFC_INTEGER_4 result2 = 0; diff --git a/libgfortran/generated/maxloc1_4_m2.c b/libgfortran/generated/maxloc1_4_m2.c index 76aa8d1..06f989c 100644 --- a/libgfortran/generated/maxloc1_4_m2.c +++ b/libgfortran/generated/maxloc1_4_m2.c @@ -147,7 +147,7 @@ maxloc1_4_m2 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_4_m2 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_2_QUIET_NAN) GFC_INTEGER_4 result2 = 0; diff --git a/libgfortran/generated/maxloc1_4_m4.c b/libgfortran/generated/maxloc1_4_m4.c index 3313c14..6a52a0a 100644 --- a/libgfortran/generated/maxloc1_4_m4.c +++ b/libgfortran/generated/maxloc1_4_m4.c @@ -147,7 +147,7 @@ maxloc1_4_m4 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_4_m4 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_4_QUIET_NAN) GFC_INTEGER_4 result2 = 0; diff --git a/libgfortran/generated/maxloc1_4_m8.c b/libgfortran/generated/maxloc1_4_m8.c index 1f39517..e2f92a9 100644 --- a/libgfortran/generated/maxloc1_4_m8.c +++ b/libgfortran/generated/maxloc1_4_m8.c @@ -147,7 +147,7 @@ maxloc1_4_m8 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_4_m8 (gfc_array_i4 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_8_QUIET_NAN) GFC_INTEGER_4 result2 = 0; diff --git a/libgfortran/generated/maxloc1_8_m1.c b/libgfortran/generated/maxloc1_8_m1.c index 7c3ac0f9..2f2ff5a 100644 --- a/libgfortran/generated/maxloc1_8_m1.c +++ b/libgfortran/generated/maxloc1_8_m1.c @@ -147,7 +147,7 @@ maxloc1_8_m1 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_8_m1 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) maxval = -GFC_UINTEGER_1_INFINITY; #else - maxval = -GFC_UINTEGER_1_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_1_QUIET_NAN) GFC_INTEGER_8 result2 = 0; diff --git a/libgfortran/generated/maxloc1_8_m16.c b/libgfortran/generated/maxloc1_8_m16.c index c643963..c0c47bb 100644 --- a/libgfortran/generated/maxloc1_8_m16.c +++ b/libgfortran/generated/maxloc1_8_m16.c @@ -147,7 +147,7 @@ maxloc1_8_m16 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_8_m16 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) maxval = -GFC_UINTEGER_16_INFINITY; #else - maxval = -GFC_UINTEGER_16_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_16_QUIET_NAN) GFC_INTEGER_8 result2 = 0; diff --git a/libgfortran/generated/maxloc1_8_m2.c b/libgfortran/generated/maxloc1_8_m2.c index 2fa5c3b..cf915b0 100644 --- a/libgfortran/generated/maxloc1_8_m2.c +++ b/libgfortran/generated/maxloc1_8_m2.c @@ -147,7 +147,7 @@ maxloc1_8_m2 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_8_m2 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) maxval = -GFC_UINTEGER_2_INFINITY; #else - maxval = -GFC_UINTEGER_2_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_2_QUIET_NAN) GFC_INTEGER_8 result2 = 0; diff --git a/libgfortran/generated/maxloc1_8_m4.c b/libgfortran/generated/maxloc1_8_m4.c index 8761c09..6a08644 100644 --- a/libgfortran/generated/maxloc1_8_m4.c +++ b/libgfortran/generated/maxloc1_8_m4.c @@ -147,7 +147,7 @@ maxloc1_8_m4 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_8_m4 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) maxval = -GFC_UINTEGER_4_INFINITY; #else - maxval = -GFC_UINTEGER_4_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_4_QUIET_NAN) GFC_INTEGER_8 result2 = 0; diff --git a/libgfortran/generated/maxloc1_8_m8.c b/libgfortran/generated/maxloc1_8_m8.c index 83c9795..497b18d 100644 --- a/libgfortran/generated/maxloc1_8_m8.c +++ b/libgfortran/generated/maxloc1_8_m8.c @@ -147,7 +147,7 @@ maxloc1_8_m8 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif result = 1; if (len <= 0) @@ -366,7 +366,7 @@ mmaxloc1_8_m8 (gfc_array_i8 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) maxval = -GFC_UINTEGER_8_INFINITY; #else - maxval = -GFC_UINTEGER_8_HUGE; + maxval = 0; #endif #if defined (GFC_UINTEGER_8_QUIET_NAN) GFC_INTEGER_8 result2 = 0; diff --git a/libgfortran/generated/maxval_m1.c b/libgfortran/generated/maxval_m1.c index 18df9b8..04bf510 100644 --- a/libgfortran/generated/maxval_m1.c +++ b/libgfortran/generated/maxval_m1.c @@ -143,10 +143,10 @@ maxval_m1 (gfc_array_m1 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) result = -GFC_UINTEGER_1_INFINITY; #else - result = -GFC_UINTEGER_1_HUGE; + result = 0; #endif if (len <= 0) - *dest = -GFC_UINTEGER_1_HUGE; + *dest = 0; else { #if ! defined HAVE_BACK_ARG @@ -351,7 +351,7 @@ mmaxval_m1 (gfc_array_m1 * const restrict retarray, #if defined (GFC_UINTEGER_1_INFINITY) result = -GFC_UINTEGER_1_INFINITY; #else - result = -GFC_UINTEGER_1_HUGE; + result = 0; #endif #if defined (GFC_UINTEGER_1_QUIET_NAN) int non_empty_p = 0; @@ -372,9 +372,9 @@ mmaxval_m1 (gfc_array_m1 * const restrict retarray, if (unlikely (n >= len)) { #if defined (GFC_UINTEGER_1_QUIET_NAN) - result = non_empty_p ? GFC_UINTEGER_1_QUIET_NAN : -GFC_UINTEGER_1_HUGE; + result = non_empty_p ? GFC_UINTEGER_1_QUIET_NAN : 0; #else - result = -GFC_UINTEGER_1_HUGE; + result = 0; #endif } else for (; n < len; n++, src += delta, msrc += mdelta) @@ -535,7 +535,7 @@ smaxval_m1 (gfc_array_m1 * const restrict retarray, while(1) { - *dest = -GFC_UINTEGER_1_HUGE; + *dest = 0; count[0]++; dest += dstride[0]; n = 0; diff --git a/libgfortran/generated/maxval_m16.c b/libgfortran/generated/maxval_m16.c index a66dc7a..0833d01 100644 --- a/libgfortran/generated/maxval_m16.c +++ b/libgfortran/generated/maxval_m16.c @@ -143,10 +143,10 @@ maxval_m16 (gfc_array_m16 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) result = -GFC_UINTEGER_16_INFINITY; #else - result = -GFC_UINTEGER_16_HUGE; + result = 0; #endif if (len <= 0) - *dest = -GFC_UINTEGER_16_HUGE; + *dest = 0; else { #if ! defined HAVE_BACK_ARG @@ -351,7 +351,7 @@ mmaxval_m16 (gfc_array_m16 * const restrict retarray, #if defined (GFC_UINTEGER_16_INFINITY) result = -GFC_UINTEGER_16_INFINITY; #else - result = -GFC_UINTEGER_16_HUGE; + result = 0; #endif #if defined (GFC_UINTEGER_16_QUIET_NAN) int non_empty_p = 0; @@ -372,9 +372,9 @@ mmaxval_m16 (gfc_array_m16 * const restrict retarray, if (unlikely (n >= len)) { #if defined (GFC_UINTEGER_16_QUIET_NAN) - result = non_empty_p ? GFC_UINTEGER_16_QUIET_NAN : -GFC_UINTEGER_16_HUGE; + result = non_empty_p ? GFC_UINTEGER_16_QUIET_NAN : 0; #else - result = -GFC_UINTEGER_16_HUGE; + result = 0; #endif } else for (; n < len; n++, src += delta, msrc += mdelta) @@ -535,7 +535,7 @@ smaxval_m16 (gfc_array_m16 * const restrict retarray, while(1) { - *dest = -GFC_UINTEGER_16_HUGE; + *dest = 0; count[0]++; dest += dstride[0]; n = 0; diff --git a/libgfortran/generated/maxval_m2.c b/libgfortran/generated/maxval_m2.c index 19fa8de..70f3785 100644 --- a/libgfortran/generated/maxval_m2.c +++ b/libgfortran/generated/maxval_m2.c @@ -143,10 +143,10 @@ maxval_m2 (gfc_array_m2 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) result = -GFC_UINTEGER_2_INFINITY; #else - result = -GFC_UINTEGER_2_HUGE; + result = 0; #endif if (len <= 0) - *dest = -GFC_UINTEGER_2_HUGE; + *dest = 0; else { #if ! defined HAVE_BACK_ARG @@ -351,7 +351,7 @@ mmaxval_m2 (gfc_array_m2 * const restrict retarray, #if defined (GFC_UINTEGER_2_INFINITY) result = -GFC_UINTEGER_2_INFINITY; #else - result = -GFC_UINTEGER_2_HUGE; + result = 0; #endif #if defined (GFC_UINTEGER_2_QUIET_NAN) int non_empty_p = 0; @@ -372,9 +372,9 @@ mmaxval_m2 (gfc_array_m2 * const restrict retarray, if (unlikely (n >= len)) { #if defined (GFC_UINTEGER_2_QUIET_NAN) - result = non_empty_p ? GFC_UINTEGER_2_QUIET_NAN : -GFC_UINTEGER_2_HUGE; + result = non_empty_p ? GFC_UINTEGER_2_QUIET_NAN : 0; #else - result = -GFC_UINTEGER_2_HUGE; + result = 0; #endif } else for (; n < len; n++, src += delta, msrc += mdelta) @@ -535,7 +535,7 @@ smaxval_m2 (gfc_array_m2 * const restrict retarray, while(1) { - *dest = -GFC_UINTEGER_2_HUGE; + *dest = 0; count[0]++; dest += dstride[0]; n = 0; diff --git a/libgfortran/generated/maxval_m4.c b/libgfortran/generated/maxval_m4.c index 6d660d8..3b1e79a 100644 --- a/libgfortran/generated/maxval_m4.c +++ b/libgfortran/generated/maxval_m4.c @@ -143,10 +143,10 @@ maxval_m4 (gfc_array_m4 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) result = -GFC_UINTEGER_4_INFINITY; #else - result = -GFC_UINTEGER_4_HUGE; + result = 0; #endif if (len <= 0) - *dest = -GFC_UINTEGER_4_HUGE; + *dest = 0; else { #if ! defined HAVE_BACK_ARG @@ -351,7 +351,7 @@ mmaxval_m4 (gfc_array_m4 * const restrict retarray, #if defined (GFC_UINTEGER_4_INFINITY) result = -GFC_UINTEGER_4_INFINITY; #else - result = -GFC_UINTEGER_4_HUGE; + result = 0; #endif #if defined (GFC_UINTEGER_4_QUIET_NAN) int non_empty_p = 0; @@ -372,9 +372,9 @@ mmaxval_m4 (gfc_array_m4 * const restrict retarray, if (unlikely (n >= len)) { #if defined (GFC_UINTEGER_4_QUIET_NAN) - result = non_empty_p ? GFC_UINTEGER_4_QUIET_NAN : -GFC_UINTEGER_4_HUGE; + result = non_empty_p ? GFC_UINTEGER_4_QUIET_NAN : 0; #else - result = -GFC_UINTEGER_4_HUGE; + result = 0; #endif } else for (; n < len; n++, src += delta, msrc += mdelta) @@ -535,7 +535,7 @@ smaxval_m4 (gfc_array_m4 * const restrict retarray, while(1) { - *dest = -GFC_UINTEGER_4_HUGE; + *dest = 0; count[0]++; dest += dstride[0]; n = 0; diff --git a/libgfortran/generated/maxval_m8.c b/libgfortran/generated/maxval_m8.c index d6b7dac..ece6438 100644 --- a/libgfortran/generated/maxval_m8.c +++ b/libgfortran/generated/maxval_m8.c @@ -143,10 +143,10 @@ maxval_m8 (gfc_array_m8 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) result = -GFC_UINTEGER_8_INFINITY; #else - result = -GFC_UINTEGER_8_HUGE; + result = 0; #endif if (len <= 0) - *dest = -GFC_UINTEGER_8_HUGE; + *dest = 0; else { #if ! defined HAVE_BACK_ARG @@ -351,7 +351,7 @@ mmaxval_m8 (gfc_array_m8 * const restrict retarray, #if defined (GFC_UINTEGER_8_INFINITY) result = -GFC_UINTEGER_8_INFINITY; #else - result = -GFC_UINTEGER_8_HUGE; + result = 0; #endif #if defined (GFC_UINTEGER_8_QUIET_NAN) int non_empty_p = 0; @@ -372,9 +372,9 @@ mmaxval_m8 (gfc_array_m8 * const restrict retarray, if (unlikely (n >= len)) { #if defined (GFC_UINTEGER_8_QUIET_NAN) - result = non_empty_p ? GFC_UINTEGER_8_QUIET_NAN : -GFC_UINTEGER_8_HUGE; + result = non_empty_p ? GFC_UINTEGER_8_QUIET_NAN : 0; #else - result = -GFC_UINTEGER_8_HUGE; + result = 0; #endif } else for (; n < len; n++, src += delta, msrc += mdelta) @@ -535,7 +535,7 @@ smaxval_m8 (gfc_array_m8 * const restrict retarray, while(1) { - *dest = -GFC_UINTEGER_8_HUGE; + *dest = 0; count[0]++; dest += dstride[0]; n = 0; diff --git a/libgfortran/m4/iparm.m4 b/libgfortran/m4/iparm.m4 index 0c4c76c..2d6a376 100644 --- a/libgfortran/m4/iparm.m4 +++ b/libgfortran/m4/iparm.m4 @@ -28,7 +28,7 @@ define_type(rtype, rtype_tmp)dnl define(rtype_qual,`_'rtype_kind)dnl ')dnl define(atype_max, atype_name`_HUGE')dnl -define(atype_min,ifelse(regexp(file, `_\(.\)[0-9]*\.c$', `\1'),`i',`(-'atype_max`-1)',`-'atype_max))dnl +define(atype_min,ifelse(index(atype_name,`GFC_UINTEGER'),0,`0',ifelse(regexp(file, `_\(.\)[0-9]*\.c$', `\1'),`i',`(-'atype_max`-1)',`-'atype_max)))dnl define(atype_inf, atype_name`_INFINITY')dnl define(atype_nan, atype_name`_QUIET_NAN')dnl define(name, regexp(regexp(file, `[^/]*$', `\&'), `^\([^_]*\)_', `\1'))dnl diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index b4032bc..fa2ddae 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,30 @@ +2025-05-09 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.c/interop-cuda-full.c: Use 'link' instead + of 'run' when the default device is "! offload_device_nvptx". + * testsuite/libgomp.c/interop-cuda-libonly.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-full.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-no-headers.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c: Likewise. + * testsuite/libgomp.fortran/interop-hip-nvidia-full.F90: Likewise. + * testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90: Likewise. + * testsuite/libgomp.c/interop-hip-amd-full.c: Use 'link' instead + of 'run' when the default device is "! offload_device_gcn". + * testsuite/libgomp.c/interop-hip-amd-no-hip-header.c: Likewise. + * testsuite/libgomp.fortran/interop-hip-amd-full.F90: Likewise. + * testsuite/libgomp.fortran/interop-hip-amd-no-module.F90: Likewise. + +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * testsuite/lib/libgomp.exp: Add load_lib of scanhtml.exp. + +2025-05-07 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.fortran/map-alloc-comp-9.f90: Process differently + when USE_USM_REQUIREMENT is set. + * testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90: New test. + 2025-05-06 Tejas Belagod <tejas.belagod@arm.com> * testsuite/libgomp.c-target/aarch64/udr-sve.c: Fix test. diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 54f2f708..fd475ac 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -30,6 +30,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scansarif.exp +load_gcc_lib scanhtml.exp load_gcc_lib scantree.exp load_gcc_lib scanltrans.exp load_gcc_lib scanoffload.exp diff --git a/libgomp/testsuite/libgomp.c/interop-cuda-full.c b/libgomp/testsuite/libgomp.c/interop-cuda-full.c index 38aa6b1..c48a934 100644 --- a/libgomp/testsuite/libgomp.c/interop-cuda-full.c +++ b/libgomp/testsuite/libgomp.c/interop-cuda-full.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_nvptx } } } */ +/* { dg-do link { target { ! offload_device_nvptx } } } */ + /* { dg-require-effective-target openacc_cuda } */ /* { dg-require-effective-target openacc_cudart } */ /* { dg-additional-options "-lcuda -lcudart" } */ diff --git a/libgomp/testsuite/libgomp.c/interop-cuda-libonly.c b/libgomp/testsuite/libgomp.c/interop-cuda-libonly.c index 17cbb15..bc257a2 100644 --- a/libgomp/testsuite/libgomp.c/interop-cuda-libonly.c +++ b/libgomp/testsuite/libgomp.c/interop-cuda-libonly.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_nvptx } } } */ +/* { dg-do link { target { ! offload_device_nvptx } } } */ + /* { dg-require-effective-target openacc_libcudart } */ /* { dg-require-effective-target openacc_libcuda } */ /* { dg-additional-options "-lcuda -lcudart" } */ diff --git a/libgomp/testsuite/libgomp.c/interop-hip-amd-full.c b/libgomp/testsuite/libgomp.c/interop-hip-amd-full.c index d7725fc..bd44f44 100644 --- a/libgomp/testsuite/libgomp.c/interop-hip-amd-full.c +++ b/libgomp/testsuite/libgomp.c/interop-hip-amd-full.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_gcn } } } */ +/* { dg-do link { target { ! offload_device_gcn } } } */ + /* { dg-require-effective-target gomp_hip_header_amd } */ /* { dg-require-effective-target gomp_libamdhip64 } */ /* { dg-additional-options "-lamdhip64" } */ diff --git a/libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c b/libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c index 2584537..91ad987 100644 --- a/libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c +++ b/libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_gcn } } } */ +/* { dg-do link { target { ! offload_device_gcn } } } */ + /* { dg-require-effective-target gomp_libamdhip64 } */ /* { dg-additional-options "-lamdhip64" } */ diff --git a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c index 79af47d..d5dc236 100644 --- a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c +++ b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_nvptx } } } */ +/* { dg-do link { target { ! offload_device_nvptx } } } */ + /* { dg-require-effective-target openacc_cudart } */ /* { dg-require-effective-target openacc_cuda } */ /* { dg-require-effective-target gomp_hip_header_nvidia } */ diff --git a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c index 4586398..7cff2cb 100644 --- a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c +++ b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_nvptx } } } */ +/* { dg-do link { target { ! offload_device_nvptx } } } */ + /* { dg-require-effective-target openacc_libcudart } */ /* { dg-require-effective-target openacc_libcuda } */ /* { dg-additional-options "-lcuda -lcudart" } */ diff --git a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c index 4186984..7b7dc74 100644 --- a/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c +++ b/libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c @@ -1,3 +1,6 @@ +/* { dg-do run { target { offload_device_nvptx } } } */ +/* { dg-do link { target { ! offload_device_nvptx } } } */ + /* { dg-require-effective-target openacc_cudart } */ /* { dg-require-effective-target openacc_cuda } */ /* { dg-additional-options "-lcuda -lcudart" } */ diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 index bbd49dd..eb2f437 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_gcn } } } +! { dg-do link { target { ! offload_device_gcn } } } + ! { dg-require-effective-target gomp_hipfort_module } ! { dg-require-effective-target gomp_libamdhip64 } ! { dg-additional-options "-lamdhip64" } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 index 0afec83..0ebbe80 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_gcn } } } +! { dg-do link { target { ! offload_device_gcn } } } + ! { dg-require-effective-target gomp_libamdhip64 } ! { dg-additional-options "-lamdhip64" } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 index cef592f..d29a689 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_nvptx } } } +! { dg-do link { target { ! offload_device_nvptx } } } + ! { dg-require-effective-target gomp_hipfort_module } ! { dg-require-effective-target openacc_cudart } ! { dg-require-effective-target openacc_cuda } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 index c1ef29d..2063610 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_nvptx } } } +! { dg-do link { target { ! offload_device_nvptx } } } + ! { dg-require-effective-target openacc_libcudart } ! { dg-require-effective-target openacc_libcuda } ! { dg-additional-options "-lcuda -lcudart" } diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 7bfb33f..4dab5b4 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,8 @@ +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * testsuite/lib/libitm.exp: Add load_lib of scanhtml.exp. + 2025-01-02 Jakub Jelinek <jakub@redhat.com> * libitm.texi: Bump @copying's copyright year. diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp index ac390d6d..0b33015 100644 --- a/libitm/testsuite/lib/libitm.exp +++ b/libitm/testsuite/lib/libitm.exp @@ -43,6 +43,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scansarif.exp +load_gcc_lib scanhtml.exp load_gcc_lib scantree.exp load_gcc_lib scanltrans.exp load_gcc_lib scanipa.exp diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index bf23e49..a1480d4 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,8 @@ +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * testsuite/lib/libphobos-dg.exp: Add load_lib of scanhtml.exp. + 2025-05-06 Sam James <sam@gentoo.org> * configure.tgt: Add sparc64-unknown-linux-gnu as a supported target. diff --git a/libphobos/testsuite/lib/libphobos-dg.exp b/libphobos/testsuite/lib/libphobos-dg.exp index 2cac87f..f2c38a2 100644 --- a/libphobos/testsuite/lib/libphobos-dg.exp +++ b/libphobos/testsuite/lib/libphobos-dg.exp @@ -24,6 +24,7 @@ load_gcc_lib scanasm.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scansarif.exp +load_gcc_lib scanhtml.exp load_gcc_lib scantree.exp load_gcc_lib scanipa.exp load_gcc_lib torture-options.exp diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8aa7ec8..a4c2d7c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,74 @@ +2025-05-09 Tomasz Kamiński <tkaminsk@redhat.com> + + * include/bits/chrono_io.h (__formatter_chrono::_M_format_to): + Extracted from _M_format. + (__formatter_chrono::_M_format): Use _Padding_sink and delegate + to _M_format_to. + +2025-05-09 Tomasz Kamiński <tkaminsk@redhat.com> + + * include/std/format (__Sink_iter<_CharT>::_M_discarding) + (__Sink<_CharT>::_M_discarding, _Iter_sink<_CharT, _OutIter>::_M_discarding) + (_Padding_sinl<_CharT, _Out>::_M_padwidth) + (_Padding_sink<_CharT, _Out>::_M_maxwidth): Remove const. + (_Padding_sink<_CharT, _Out>::_M_sync_discarding) + (_Padding_sink<_CharT, _Out>::_M_discarding): Define. + (_Padding_sink<_CharT, _Out>::_Padding_sink(_Out, size_t, size_t)) + (_Padding_sink<_CharT, _Out>::_M_force_update): + (_Padding_sink<_CharT, _Out>::_M_flush): Call _M_sync_discarding. + (_Padding_sink<_CharT, _Out>::_Padding_sink(_Out, size_t)): Delegate. + +2025-05-07 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120159 + * src/c++23/std.cc.in (is_layout_compatible_v): Export. + +2025-05-07 Jonathan Wakely <jwakely@redhat.com> + + * src/c++23/std.cc.in: Fix export for std::extents. + +2025-05-07 Luc Grosheintz <luc.grosheintz@gmail.com> + + * testsuite/23_containers/mdspan/extents/class_mandates_neg.cc: New test. + * testsuite/23_containers/mdspan/extents/ctor_copy.cc: New test. + * testsuite/23_containers/mdspan/extents/ctor_ints.cc: New test. + * testsuite/23_containers/mdspan/extents/ctor_shape.cc: New test. + * testsuite/23_containers/mdspan/extents/custom_integer.cc: New test. + * testsuite/23_containers/mdspan/extents/misc.cc: New test. + +2025-05-07 Luc Grosheintz <luc.grosheintz@gmail.com> + + PR libstdc++/107761 + * include/std/mdspan (extents): New class. + * src/c++23/std.cc.in: Add 'using std::extents'. + +2025-05-07 Luc Grosheintz <luc.grosheintz@gmail.com> + + * doc/doxygen/user.cfg.in: Add <mdspan>. + * include/Makefile.am: Ditto. + * include/Makefile.in: Ditto. + * include/precompiled/stdc++.h: Ditto. + * include/std/mdspan: New file. + +2025-05-07 Luc Grosheintz <luc.grosheintz@gmail.com> + + * include/bits/version.def: Add internal feature testing macro + __glibcxx_mdspan. + * include/bits/version.h: Regenerate. + +2025-05-07 Tomasz Kamiński <tkaminsk@redhat.com> + + PR libstdc++/120114 + * include/bits/chrono_io.h (__formatter_chrono::_M_format): Use __field_width. + * testsuite/std/time/format/pr120114.cc: New test. + +2025-05-07 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120147 + * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Restore use of + AC_LANG_CPLUSPLUS. + * configure: Regenerate. + 2025-05-06 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/70560 diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h index 620227a..ace8b9f 100644 --- a/libstdc++-v3/include/bits/chrono_io.h +++ b/libstdc++-v3/include/bits/chrono_io.h @@ -503,9 +503,7 @@ namespace __format _M_format(const _Tp& __t, _FormatContext& __fc, bool __is_neg = false) const { - auto __first = _M_spec._M_chrono_specs.begin(); - const auto __last = _M_spec._M_chrono_specs.end(); - if (__first == __last) + if (_M_spec._M_chrono_specs.empty()) return _M_format_to_ostream(__t, __fc, __is_neg); #if defined _GLIBCXX_USE_NL_LANGINFO_L && __CHAR_BIT__ == 8 @@ -525,29 +523,29 @@ namespace __format __fc._M_loc = __with_encoding_conversion(__loc); } #endif - - _Sink_iter<_CharT> __out; - __format::_Str_sink<_CharT> __sink; - bool __write_direct = false; - if constexpr (is_same_v<typename _FormatContext::iterator, - _Sink_iter<_CharT>>) - { - if (_M_spec._M_width_kind == __format::_WP_none) - { - __out = __fc.out(); - __write_direct = true; - } - else - __out = __sink.out(); - } - else - __out = __sink.out(); - // formatter<duration> passes the correct value of __is_neg // for durations but for hh_mm_ss we decide it here. if constexpr (__is_specialization_of<_Tp, chrono::hh_mm_ss>) __is_neg = __t.is_negative(); + const size_t __padwidth = _M_spec._M_get_width(__fc); + if (__padwidth == 0) + return _M_format_to(__t, __fc.out(), __fc, __is_neg); + + using _Out = typename _FormatContext::iterator; + _Padding_sink<_Out, _CharT> __sink(__fc.out(), __padwidth); + _M_format_to(__t, __sink.out(), __fc, __is_neg); + return __sink._M_finish(_M_spec._M_align, _M_spec._M_fill); + } + + template<typename _Tp, typename _Out, typename _FormatContext> + _Out + _M_format_to(const _Tp& __t, _Out __out, _FormatContext& __fc, + bool __is_neg) const + { + auto __first = _M_spec._M_chrono_specs.begin(); + const auto __last = _M_spec._M_chrono_specs.end(); + auto __print_sign = [&__is_neg, &__out] { if constexpr (chrono::__is_duration_v<_Tp> || __is_specialization_of<_Tp, chrono::hh_mm_ss>) @@ -699,20 +697,7 @@ namespace __format } } while (__first != __last); - - if constexpr (is_same_v<typename _FormatContext::iterator, - _Sink_iter<_CharT>>) - if (__write_direct) - return __out; - - auto __str = __sink.view(); - size_t __width; - if constexpr (__unicode::__literal_encoding_is_unicode<_CharT>()) - __width = __unicode::__field_width(__str); - else - __width = __str.size(); - return __format::__write_padded_as_spec(__str, __width, - __fc, _M_spec); + return std::move(__out); } _ChronoSpec<_CharT> _M_spec; diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 054ce35..b3192cf 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -3144,6 +3144,10 @@ namespace __format auto _M_reserve(size_t __n) const { return _M_sink->_M_reserve(__n); } + + bool + _M_discarding() const + { return _M_sink->_M_discarding(); } }; // Abstract base class for type-erased character sinks. @@ -3263,6 +3267,11 @@ namespace __format _M_bump(size_t __n) { _M_next += __n; } + // Returns true if the _Sink is discarding incoming characters. + virtual bool + _M_discarding() const + { return false; } + public: _Sink(const _Sink&) = delete; _Sink& operator=(const _Sink&) = delete; @@ -3488,6 +3497,14 @@ namespace __format _M_count += __s.size(); } + bool + _M_discarding() const override + { + // format_to_n return total number of characters, that would be written, + // see C++20 [format.functions] p20 + return false; + } + public: [[__gnu__::__always_inline__]] explicit @@ -3550,6 +3567,14 @@ namespace __format } } + bool + _M_discarding() const override + { + // format_to_n return total number of characters, that would be written, + // see C++20 [format.functions] p20 + return false; + } + typename _Sink<_CharT>::_Reservation _M_reserve(size_t __n) final { @@ -3636,17 +3661,15 @@ namespace __format template<typename _Out, typename _CharT> class _Padding_sink : public _Str_sink<_CharT> { - const size_t _M_padwidth; - const size_t _M_maxwidth; + size_t _M_padwidth; + size_t _M_maxwidth; _Out _M_out; size_t _M_printwidth; [[__gnu__::__always_inline__]] bool _M_ignoring() const - { - return _M_printwidth >= _M_maxwidth; - } + { return _M_printwidth >= _M_maxwidth; } [[__gnu__::__always_inline__]] bool @@ -3660,11 +3683,20 @@ namespace __format } void + _M_sync_discarding() + { + if constexpr (is_same_v<_Out, _Sink_iter<_CharT>>) + if (_M_out._M_discarding()) + _M_maxwidth = _M_printwidth; + } + + void _M_flush() { span<_CharT> __new = this->_M_used(); basic_string_view<_CharT> __str(__new.data(), __new.size()); _M_out = __format::__write(std::move(_M_out), __str); + _M_sync_discarding(); this->_M_rewind(); } @@ -3682,7 +3714,10 @@ namespace __format // We have more characters than padidng, no padding is needed, // write direclty to _M_out. if (_M_printwidth >= _M_padwidth) - _M_out = __format::__write(std::move(_M_out), __str); + { + _M_out = __format::__write(std::move(_M_out), __str); + _M_sync_discarding(); + } // We reached _M_maxwidth that is smaller than _M_padwidth. // Store the prefix sequence in _M_seq, and free _M_buf. else @@ -3718,6 +3753,10 @@ namespace __format _Str_sink<_CharT>::_M_overflow(); } + bool + _M_discarding() const override + { return _M_ignoring(); } + typename _Sink<_CharT>::_Reservation _M_reserve(size_t __n) override { @@ -3752,15 +3791,16 @@ namespace __format public: [[__gnu__::__always_inline__]] - explicit _Padding_sink(_Out __out, size_t __padwidth) - : _M_padwidth(__padwidth), _M_maxwidth(-1), + explicit + _Padding_sink(_Out __out, size_t __padwidth, size_t __maxwidth) + : _M_padwidth(__padwidth), _M_maxwidth(__maxwidth), _M_out(std::move(__out)), _M_printwidth(0) - { } + { _M_sync_discarding(); } [[__gnu__::__always_inline__]] - explicit _Padding_sink(_Out __out, size_t __padwidth, size_t __maxwidth) - : _M_padwidth(__padwidth), _M_maxwidth(__maxwidth), - _M_out(std::move(__out)), _M_printwidth(0) + explicit + _Padding_sink(_Out __out, size_t __padwidth) + : _Padding_sink(std::move(__out), __padwidth, (size_t)-1) { } _Out diff --git a/libstdc++-v3/src/c++23/print.cc b/libstdc++-v3/src/c++23/print.cc index 8ba7140..f343699 100644 --- a/libstdc++-v3/src/c++23/print.cc +++ b/libstdc++-v3/src/c++23/print.cc @@ -43,6 +43,10 @@ # include <unistd.h> // isatty #endif +#ifdef __VXWORKS__ +#include <ioLib.h> +#endif + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog index 162e771..4d1bd44 100644 --- a/libvtv/ChangeLog +++ b/libvtv/ChangeLog @@ -1,3 +1,8 @@ +2025-05-09 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * testsuite/lib/libvtv-dg.exp: Add load_lib of scanhtml.exp. + 2024-11-18 David Malcolm <dmalcolm@redhat.com> * testsuite/lib/libvtv.exp: Add diff --git a/libvtv/testsuite/lib/libvtv-dg.exp b/libvtv/testsuite/lib/libvtv-dg.exp index 454d916..2a45f5c 100644 --- a/libvtv/testsuite/lib/libvtv-dg.exp +++ b/libvtv/testsuite/lib/libvtv-dg.exp @@ -13,6 +13,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. load_gcc_lib scansarif.exp +load_gcc_lib scanhtml.exp proc libvtv-dg-test { prog do_what extra_tool_flags } { return [gcc-dg-test-1 libvtv_target_compile $prog $do_what $extra_tool_flags] |