aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-07-28json: add dump overload for easier debuggingDavid Malcolm2-0/+11
This has saved me a lot of typing in the debugger. gcc/ChangeLog: * json.cc (value::dump): New overload, taking no params. * json.h (value::dump): New decl. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-07-28c++: parse error with -std=c++14 -fconcepts [PR116071]Jason Merrill2-3/+25
cp_parser_simple_type_specifier tries a variety of different things that might qualify as a user-defined type: an actual type-name, a constrained auto, a CTAD placeholder. In a context where a type-specifier is optional, this is all tentative. With -std=c++14 -fconcepts, we try type-name and constrained auto in sub-tentative parses, and when we run out of things to try we haven't found anything but also haven't failed the outer tentative parse, so parse_definitely succeeds, discarding the nested-name-specifier. Fixed by failing if we didn't find anything. I said in r14-3203 that we should disable this combination of flags if further problems arise, but this seems like a more general problem that only happened to occur with just this combination of flags. So it lives on. PR c++/116071 gcc/cp/ChangeLog: * parser.cc (cp_parser_simple_type_specifier): Call cp_parser_simulate_error if nothing worked. gcc/testsuite/ChangeLog: * g++.dg/parse/pr116071.C: New test.
2024-07-28c++: Mostly concepts related formatting fixesJakub Jelinek3-174/+175
When playing with P2963R3, while reading and/or modifying code I've fixed various comment or code formatting issues (and in 3 spots also comment wording), but including that in the WIP P2963R3 patch made that patch totally unreadable because these changes were 4 times the size of the actual code changes. So, here it is separated to a pure formatting + comment wording patch. 2024-07-24 Jakub Jelinek <jakub@redhat.com> * constraint.cc (subst_info::quiet, subst_info::noisy): Formatting fixes. (known_non_bool_p): Comment formatting fixes. (unpack_concept_check): Likewise. (resolve_function_concept_overload): Likewise. (resolve_function_concept_check): Likewise. (resolve_concept_check): Likewise. (deduce_constrained_parameter): Likewise. (finish_type_constraints): Likewise. (get_returned_expression): Likewise. (get_variable_initializer): Likewise. (norm_info::update_context, norm_info::ctx_params): Formatting fixes. (norm_info::context): Comment formatting fixes. (normalize_logical_operation): Likewise. Formatting fix. (normalize_concept_check): Comment formatting fixes. (normalize_atom): Likewise. (normalize_expression): Likewise. (get_normalized_constraints_from_info): Likewise. (get_normalized_constraints_from_decl): Likewise. Formatting fixes. (atomic_constraints_identical_p): Comment formatting fixes. (constraints_equivalent_p): Formatting fixes. (inchash::add_constraint): Likewise. (associate_classtype_constraints): Comment formatting fixes. (get_constraints): Likewise. (set_constraints): Likewise. (build_concept_check_arguments): Likewise. (build_function_check): Likewise. (build_concept_check): Likewise. (finish_shorthand_constraint): Likewise. (get_shorthand_constraints): Likewise. (check_constraint_variables): Likewise. (tsubst_constraint_variables): Likewise. (tsubst_requires_expr): Likewise. (get_mapped_args): Likewise. Formatting fixes. (satisfy_atom): Comment formatting fixes. (satisfy_constraint_r): Comment wording and formatting fixes. (satisfy_normalized_constraints): Comment formatting fixes. (satisfy_declaration_constraints): Likewise. (evaluate_concept_check): Likewise. (finish_requires_expr): Likewise. (finish_compound_requirement): Likewise. (check_function_concept): Likewise. (equivalently_constrained): Likewise. (more_constrained): Likewise. (diagnose_atomic_constraint): Likewise. * cp-tree.h (TREE_LANG_FLAG_0): Fix a comment error, FOLD_EXPR_MODIFY_P instead of FOLD_EXPR_MODOP_P. (DECL_MAIN_FREESTANDING_P, DECL_MAIN_P): Comment formatting fixes. (enum cpp0x_warn_str): Likewise. (enum composite_pointer_operation): Likewise. (enum expr_list_kind): Likewise. (enum impl_conv_rhs): Likewise. (enum impl_conv_void): Likewise. (struct deferred_access_check): Likewise. (ATOMIC_CONSTR_EXPR): Likewise. (FUNCTION_REF_QUALIFIED): Likewise. (DECL_DEPENDENT_P): Likewise. (FOLD_EXPR_MODIFY_P): Likewise. (FOLD_EXPR_OP_RAW): Likewise. (FOLD_EXPR_PACK): Likewise. (FOLD_EXPR_INIT): Likewise. (TYPE_WAS_UNNAMED): Likewise. (class cp_unevaluated): Likewise. (struct ovl_op_info_t assertion): Likewise. (cp_declarator::function::requires_clause): Likewise. (variable_template_p): Likewise. (concept_definition_p): Likewise. * logic.cc (clause::clause): Likewise. (clause::replace): Likewise. (clause::insert): Likewise. Formatting fixes. (struct formula): Comment formatting fixes. (formula::branch): Likewise. (debug): Formatting fixes. (dnf_size_r): Comment formatting fixes. (cnf_size_r): Likewise. (dnf_size): Likewise. (cnf_size): Likewise. (branch_clause): Likewise. (decompose_term): Likewise. Formatting fixes. (struct subsumption_entry): Comment formatting fixes. (subsumption_cache): Likewise. (save_subsumption): Likewise. Formatting fixes. (subsumes_constraints_nonnull): Formatting fixes.
2024-07-28[rtl-optimization/116037] Explicitly track if a destination was skipped in ↵Jeff Law2-9/+69
ext-dce So this has been in the hopper since the first bugs were reported against ext-dce. It'd been holding off committing as I was finding other issues in terms of correctness of live computations. There's still problems in that space, but I think it's time to push this chunk forward. I'm marking it as 116037, but it may impact other bugs. This patch starts explicitly tracking if set processing skipped a destination, which can happen for wide modes (TI+), vectors, certain subregs, etc. This is computed during ext_dce_set_processing. During use processing we use that flag to determine reliably if we need to make the inputs fully live and to avoid even trying to eliminate an extension if we skipped output processing. While testing this I found that a recent change to fix cases where we had two subreg input operands mucked up the code to make things like a shift/rotate count fully live. So that goof has been fixed. Bootstrapped and regression tested on x86. Most, but not all, of these changes have also been tested on the crosses. Pushing to the trunk. I'm not including it in this patch but I'm poking at converting this code to use note_uses/note_stores to make it more maintainable. The SUBREG and STRICT_LOW_PART handling of note_stores is problematical, but I think it's solvable. I haven't tried a conversion to note_uses yet. PR rtl-optimization/116037 gcc/ * ext-dce.cc (ext_dce_process_sets): Note if we ever skip a dest and return that info explicitly. (ext_dce_process_uses): If a set was skipped, then consider all bits in every input as live. Do not try to optimize away an extension if we skipped processing a destination in the same insn. Restore code to make shift/rotate count fully live. (ext_dce_process_bb): Handle API changes for ext_dce_process_sets. gcc/testsuite/ * gcc.dg/torture/pr116037.c: New test
2024-07-28testsuite: Fix up pr116034.c test for big/pdp endian [PR116061]Jakub Jelinek1-2/+3
Didn't notice the memmove is into an int variable, so the test was still failing on big endian. 2024-07-24 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/116034 PR testsuite/116061 * gcc.dg/pr116034.c (g): Change type from int to unsigned short. (foo): Guard memmove call on __SIZEOF_SHORT__ == 2.
2024-07-28libstdc++: Fix <ostream> and <istream> for -std=gnu++14 -fconcepts [PR116070]Jonathan Wakely2-2/+2
This questionable combination of flags causes a number of errors. The ones in the rvalue stream overloads need to be fixed in the gcc-14 branch so I'm committing it separately to simplify backporting. libstdc++-v3/ChangeLog: PR libstdc++/116070 * include/std/istream: Check feature test macro before using is_class_v and is_same_v. * include/std/ostream: Likewise.
2024-07-28libstdc++: Fix std::vector<bool> for -std=gnu++14 -fconcepts [PR116070]Jonathan Wakely1-1/+1
This questionable combination of flags causes a number of errors. This one in std::vector<bool> needs to be fixed in the gcc-13 branch so I'm committing it separately to simplify backporting. libstdc++-v3/ChangeLog: PR libstdc++/116070 * include/bits/stl_bvector.h: Check feature test macro before using is_default_constructible_v.
2024-07-28libstdc++: Remove duplicate include header from ranges_algobase.hMichael Levine1-1/+0
The bits/stl_algobase.h header was added to bits/ranges_algobase.h separately through two related commits: r15-1106-g674d213ab91871 r15-1117-g0bb1db32ccf54a The comment for the first time it is included in the file is also incorrect (my error from that 2nd one) since it is really being included for __memcmp, not __memcpy This patch removes the duplicate header include. libstdc++-v3/ChangeLog: * include/bits/ranges_algobase.h: Remove duplicate include of <bits/stl_algobase.h>. Signed-off-by: Michael Levine <mlevine55@bloomberg.net>
2024-07-28aarch64: Extend aarch64_feature_flags to 128 bitsAndrew Carlotti5-17/+33
Replace the existing uint64_t typedef with a bbitmap<2> typedef. Most of the preparatory work was carried out in previous commits, so this patch itself is fairly small. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_set_asm_isa_flags): Store a second uint64_t value. * config/aarch64/aarch64-opts.h (aarch64_feature_flags): Switch typedef to bbitmap<2>. * config/aarch64/aarch64.cc (aarch64_set_current_function): Extract isa mode from val[0]. * config/aarch64/aarch64.h (aarch64_get_asm_isa_flags): Load a second uint64_t value. (aarch64_get_isa_flags): Ditto. (aarch64_asm_isa_flags): Ditto. (aarch64_isa_flags): Ditto. (HANDLE): Use bbitmap<2>::from_index to initialise flags. (AARCH64_FL_ISA_MODES): Do arithmetic on integer type. (AARCH64_ISA_MODE): Extract value from bbitmap<2> array. * config/aarch64/aarch64.opt (aarch64_asm_isa_flags_1): New variable. (aarch64_isa_flags_1): Ditto.
2024-07-28Add new bbitmap<N> classAndrew Carlotti1-0/+236
This class provides a constant-size bitmap that can be used as almost a drop-in replacement for bitmaps stored in integer types. The implementation is entirely within the header file and uses recursive templated operations to support effective optimisation and usage in constexpr expressions. This initial implementation hardcodes the choice of uint64_t elements for storage and initialisation, but this could instead be specified via a second template parameter. gcc/ChangeLog: * bbitmap.h: New file.
2024-07-28aarch64: Use constructor explicitly in get_flags_offAndrew Carlotti1-2/+3
gcc/ChangeLog: * config/aarch64/aarch64-feature-deps.h (get_flags_off): Construct aarch64_feature_flags (0) explicitly.
2024-07-28aarch64: Add bool conversion to TARGET_* macrosAndrew Carlotti5-131/+79
Use a new AARCH64_HAVE_ISA macro in TARGET_* definitions, and eliminate all the AARCH64_ISA_* feature macros. gcc/ChangeLog: * config/aarch64/aarch64-c.cc (aarch64_define_unconditional_macros): Use TARGET_V8R macro. (aarch64_update_cpp_builtins): Use TARGET_* macros. * config/aarch64/aarch64.h (AARCH64_HAVE_ISA): New macro. (AARCH64_ISA_SM_OFF, AARCH64_ISA_SM_ON, AARCH64_ISA_ZA_ON) (AARCH64_ISA_V8A, AARCH64_ISA_V8_1A, AARCH64_ISA_CRC) (AARCH64_ISA_FP, AARCH64_ISA_SIMD, AARCH64_ISA_LSE) (AARCH64_ISA_RDMA, AARCH64_ISA_V8_2A, AARCH64_ISA_F16) (AARCH64_ISA_SVE, AARCH64_ISA_SVE2, AARCH64_ISA_SVE2_AES) (AARCH64_ISA_SVE2_BITPERM, AARCH64_ISA_SVE2_SHA3) (AARCH64_ISA_SVE2_SM4, AARCH64_ISA_SME, AARCH64_ISA_SME_I16I64) (AARCH64_ISA_SME_F64F64, AARCH64_ISA_SME2, AARCH64_ISA_V8_3A) (AARCH64_ISA_DOTPROD, AARCH64_ISA_AES, AARCH64_ISA_SHA2) (AARCH64_ISA_V8_4A, AARCH64_ISA_SM4, AARCH64_ISA_SHA3) (AARCH64_ISA_F16FML, AARCH64_ISA_RCPC, AARCH64_ISA_RCPC8_4) (AARCH64_ISA_RNG, AARCH64_ISA_V8_5A, AARCH64_ISA_TME) (AARCH64_ISA_MEMTAG, AARCH64_ISA_V8_6A, AARCH64_ISA_I8MM) (AARCH64_ISA_F32MM, AARCH64_ISA_F64MM, AARCH64_ISA_BF16) (AARCH64_ISA_SB, AARCH64_ISA_RCPC3, AARCH64_ISA_V8R) (AARCH64_ISA_PAUTH, AARCH64_ISA_V8_7A, AARCH64_ISA_V8_8A) (AARCH64_ISA_V8_9A, AARCH64_ISA_V9A, AARCH64_ISA_V9_1A) (AARCH64_ISA_V9_2A, AARCH64_ISA_V9_3A, AARCH64_ISA_V9_4A) (AARCH64_ISA_MOPS, AARCH64_ISA_LS64, AARCH64_ISA_CSSC) (AARCH64_ISA_D128, AARCH64_ISA_THE, AARCH64_ISA_GCS): Remove. (TARGET_BASE_SIMD, TARGET_SIMD, TARGET_FLOAT) (TARGET_NON_STREAMING, TARGET_STREAMING, TARGET_ZA, TARGET_SHA2) (TARGET_SHA3, TARGET_AES, TARGET_SM4, TARGET_F16FML) (TARGET_CRC32, TARGET_LSE, TARGET_FP_F16INST) (TARGET_SIMD_F16INST, TARGET_DOTPROD, TARGET_SVE, TARGET_SVE2) (TARGET_SVE2_AES, TARGET_SVE2_BITPERM, TARGET_SVE2_SHA3) (TARGET_SVE2_SM4, TARGET_SME, TARGET_SME_I16I64) (TARGET_SME_F64F64, TARGET_SME2, TARGET_ARMV8_3, TARGET_JSCVT) (TARGET_FRINT, TARGET_TME, TARGET_RNG, TARGET_MEMTAG) (TARGET_I8MM, TARGET_SVE_I8MM, TARGET_SVE_F32MM) (TARGET_SVE_F64MM, TARGET_BF16_FP, TARGET_BF16_SIMD) (TARGET_SVE_BF16, TARGET_PAUTH, TARGET_BTI, TARGET_MOPS) (TARGET_LS64, TARGET_CSSC, TARGET_SB, TARGET_RCPC, TARGET_RCPC2) (TARGET_RCPC3, TARGET_SIMD_RDMA, TARGET_ARMV9_4, TARGET_D128) (TARGET_THE, TARGET_GCS): Redefine using AARCH64_HAVE_ISA. (TARGET_V8R, TARGET_V9A): New. * config/aarch64/aarch64.md (arch_enabled): Use TARGET_RCPC2. * config/aarch64/iterators.md (GPI_I16): Use TARGET_FP_F16INST. (GPF_F16): Ditto. * config/aarch64/predicates.md (aarch64_rcpc_memory_operand): Use TARGET_RCPC2.
2024-07-28aarch64: Add explicit bool cast to return valueAndrew Carlotti1-1/+1
gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_valid_sysreg_name_p): Add bool cast.
2024-07-28aarch64: Decouple feature flag option storage typeAndrew Carlotti3-10/+16
The awk scripts that process the .opt files are relatively fragile and only handle a limited set of data types correctly. The unrecognised aarch64_feature_flags type is handled as a uint64_t, which happens to be correct for now. However, that assumption will change when we extend the mask to 128 bits. This patch changes the option members to use uint64_t types, and adds a "_0" suffix to the names (both for future extensibility, and to allow the original name to be used for the full aarch64_feature_flags mask within generator files). gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_set_asm_isa_flags): Reorder, and add suffix to names. * config/aarch64/aarch64.h (aarch64_get_asm_isa_flags): Add "_0" suffix. (aarch64_get_isa_flags): Ditto. (aarch64_asm_isa_flags): Redefine using renamed uint64_t value. (aarch64_isa_flags): Ditto. * config/aarch64/aarch64.opt: (aarch64_asm_isa_flags): Rename to... (aarch64_asm_isa_flags_0): ...this, and change to uint64_t. (aarch64_isa_flags): Rename to... (aarch64_isa_flags_0): ...this, and change to uint64_t.
2024-07-28aarch64: Define aarch64_get_{asm_|}isa_flagsAndrew Carlotti3-23/+26
Building an aarch64_feature_flags value from data within a gcc_options or cl_target_option struct will get more complicated in a later commit. Use a macro to avoid doing this manually in more than one location. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_handle_option): Use new macro. * config/aarch64/aarch64.cc (aarch64_override_options_internal): Ditto. (aarch64_option_print): Ditto. (aarch64_set_current_function): Ditto. (aarch64_can_inline_p): Ditto. (aarch64_declare_function_name): Ditto. (aarch64_start_file): Ditto. * config/aarch64/aarch64.h (aarch64_get_asm_isa_flags): New (aarch64_get_isa_flags): New. (aarch64_asm_isa_flags): Use new macro. (aarch64_isa_flags): Ditto.
2024-07-28aarch64: Introduce aarch64_isa_mode typeAndrew Carlotti4-77/+94
Currently there are many places where an aarch64_feature_flags variable is used, but only the bottom three isa mode bits are set and read. Using a separate data type for these value makes it more clear that they're not expected or required to have any of their upper feature bits set. It will also make things simpler and more efficient when we extend aarch64_feature_flags to 128 bits. This patch uses explicit casts whenever converting from an aarch64_feature_flags value to an aarch64_isa_mode value. This isn't strictly necessary, but serves to highlight the locations where an explicit conversion will become necessary later. gcc/ChangeLog: * config/aarch64/aarch64-opts.h: Add aarch64_isa_mode typedef. * config/aarch64/aarch64-protos.h (aarch64_gen_callee_cookie): Use aarch64_isa_mode parameter. (aarch64_sme_vq_immediate): Ditto. * config/aarch64/aarch64.cc (aarch64_fntype_pstate_sm): Use aarch64_isa_mode values. (aarch64_fntype_pstate_za): Ditto. (aarch64_fndecl_pstate_sm): Ditto. (aarch64_fndecl_pstate_za): Ditto. (aarch64_fndecl_isa_mode): Ditto. (aarch64_cfun_incoming_pstate_sm): Ditto. (aarch64_cfun_enables_pstate_sm): Ditto. (aarch64_call_switches_pstate_sm): Ditto. (aarch64_gen_callee_cookie): Ditto. (aarch64_callee_isa_mode): Ditto. (aarch64_insn_callee_abi): Ditto. (aarch64_sme_vq_immediate): Ditto. (aarch64_add_offset_temporaries): Ditto. (aarch64_add_offset): Ditto. (aarch64_add_sp): Ditto. (aarch64_sub_sp): Ditto. (aarch64_guard_switch_pstate_sm): Ditto. (aarch64_switch_pstate_sm): Ditto. (aarch64_init_cumulative_args): Ditto. (aarch64_allocate_and_probe_stack_space): Ditto. (aarch64_expand_prologue): Ditto. (aarch64_expand_epilogue): Ditto. (aarch64_start_call_args): Ditto. (aarch64_expand_call): Ditto. (aarch64_end_call_args): Ditto. (aarch64_set_current_function): Ditto, with added conversions. (aarch64_handle_attr_arch): Avoid macro with changed type. (aarch64_handle_attr_cpu): Ditto. (aarch64_handle_attr_isa_flags): Ditto. (aarch64_switch_pstate_sm_for_landing_pad): Use arch64_isa_mode values. (aarch64_switch_pstate_sm_for_jump): Ditto. (pass_switch_pstate_sm::gate): Ditto. * config/aarch64/aarch64.h (AARCH64_ISA_MODE_{SM_ON|SM_OFF|ZA_ON}): New macros. (AARCH64_FL_SM_STATE): Mark as possibly unused. (AARCH64_ISA_MODE_SM_STATE): New aarch64_isa_mode mask. (AARCH64_DEFAULT_ISA_MODE): New aarch64_isa_mode value. (AARCH64_FL_DEFAULT_ISA_MODE): Define using above value. (AARCH64_ISA_MODE): Change type to aarch64_isa_mode. (arm_pcs): Use aarch64_isa_mode value.
2024-07-28aarch64: Eliminate a temporary variable.Andrew Carlotti1-5/+4
The name would become misleading in a later commit anyway, and I think this is marginally more readable. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Remove temporary variable.
2024-07-28aarch64: Move AARCH64_NUM_ISA_MODES definitionAndrew Carlotti2-5/+5
AARCH64_NUM_ISA_MODES will be used within aarch64-opts.h in a later commit. gcc/ChangeLog: * config/aarch64/aarch64.h (DEF_AARCH64_ISA_MODE): Move to... * config/aarch64/aarch64-opts.h (DEF_AARCH64_ISA_MODE): ...here.
2024-07-28aarch64: Remove unused global aarch64_tune_flagsAndrew Carlotti1-4/+0
gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_tune_flags): Remove unused global variable. (aarch64_override_options_internal): Remove dead assignment.
2024-07-28c++: add fixed testcase [PR109997]Jason Merrill1-0/+4
Fixed by r14-9713 for PR100667. PR c++/109997 gcc/testsuite/ChangeLog: * g++.dg/ext/is_assignable1.C: New test.
2024-07-28optabs/rs6000: Rename iorc and andc to iorn and andnAndrew Pinski7-40/+44
When I was trying to add an scalar version of iorc and andc, the optab that got matched was for and/ior with the mode of csi and cdi instead of iorc and andc optabs for si and di modes. Since csi/cdi are the complex integer modes, we need to rename the optabs to be without c there. This changes c to n which is a neutral and known not to be first letter of a mode. Bootstrapped and tested on x86_64 and powerpc64le. gcc/ChangeLog: * config/rs6000/rs6000-builtins.def: s/iorc/iorn/. s/andc/andn/ for the code. * config/rs6000/rs6000-string.cc (expand_cmp_vec_sequence): Update to iorn. * config/rs6000/rs6000.md (andc<mode>3): Rename to ... (andn<mode>3): This. (iorc<mode>3): Rename to ... (iorn<mode>3): This. * doc/md.texi: Update documentation for the rename. * internal-fn.def (BIT_ANDC): Rename to ... (BIT_ANDN): This. (BIT_IORC): Rename to ... (BIT_IORN): This. * optabs.def (andc_optab): Rename to ... (andn_optab): This. (iorc_optab): Rename to ... (iorn_optab): This. * gimple-isel.cc (gimple_expand_vec_cond_expr): Update for the renamed internal functions, ANDC/IORC to ANDN/IORN. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-07-28modula2: Improve error message to include symbol name.Gaius Mulley1-1/+1
gcc/m2/ChangeLog: * gm2-compiler/M2StateCheck.mod (GenerateError): Add symbol name to the error message. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-07-28modula2: Add GNU flex as a build and install prerequisite.Gaius Mulley1-0/+4
gcc/ChangeLog: * doc/install.texi (GM2-prerequisite): Add GNU flex. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-07-28tree-optimization/116057 - wrong code with CCP and vector CTORsRichard Biener2-0/+31
The following fixes an issue with CCPs likely_value when faced with a vector CTOR containing undef SSA names and constants. This should be classified as CONSTANT and not UNDEFINED. PR tree-optimization/116057 * tree-ssa-ccp.cc (likely_value): Also walk CTORs in stmt operands to look for constants. * gcc.dg/torture/pr116057.c: New testcase.
2024-07-28Revert "aarch64: Fuse CMP+CSEL and CMP+CSET for -mcpu=neoverse-v2"Kyrylo Tkachov5-90/+1
This reverts commit 4c5eb66e701bc9f3bf1298269f52559b10d63a09.
2024-07-28aarch64: Fuse CMP+CSEL and CMP+CSET for -mcpu=neoverse-v2Jennifer Schmitz5-1/+90
According to the Neoverse V2 Software Optimization Guide (section 4.14), the instruction pairs CMP+CSEL and CMP+CSET can be fused, which had not been implemented so far. This patch implements and tests the two fusion pairs. The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression. There was also no non-noise impact on SPEC CPU2017 benchmark. OK for mainline? Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com> gcc/ * config/aarch64/aarch64.cc (aarch_macro_fusion_pair_p): Implement fusion logic. * config/aarch64/aarch64-fusion-pairs.def (cmp+csel): New entry. (cmp+cset): Likewise. * config/aarch64/tuning_models/neoversev2.h: Enable logic in field fusible_ops. gcc/testsuite/ * gcc.target/aarch64/cmp_csel_fuse.c: New test. * gcc.target/aarch64/cmp_cset_fuse.c: Likewise.
2024-07-28libstdc++: Rename tests [PR12048]Jonathan Wakely4-0/+0
These have the wrong PR number in the filenames. libstdc++-v3/ChangeLog: PR libstdc++/12048 * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc: Move to... * testsuite/ext/stdio_sync_filebuf/wchar_t/12048-1.cc: ...here. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc: Move to... * testsuite/ext/stdio_sync_filebuf/wchar_t/12048-2.cc: ...here. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc: Move to... * testsuite/ext/stdio_sync_filebuf/wchar_t/12048-3.cc: ...here. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc: Move to... * testsuite/ext/stdio_sync_filebuf/wchar_t/12048-4.cc: ...here.
2024-07-28libstdc++: Stop copying all data files into test directoryJonathan Wakely1-5/+0
This removes the TODO in libstdc++_init, so that we don't copy all *.tst and *.txt files from testsuite/data into every test's working directory. Instead, only the necessary files declared with dg-additional-files are copied. libstdc++-v3/ChangeLog: * testsuite/lib/libstdc++.exp (libstdc++_init): Do not copy all data files into test directory.
2024-07-28libstdc++: Use dg-additional-files in some non-I/O testsJonathan Wakely12-0/+24
libstdc++-v3/ChangeLog: * testsuite/20_util/hash/chi2_q_document_words.cc: Use dg-additional-files for input text. * testsuite/performance/ext/pb_ds/all_text_find.cc: Likewise. * testsuite/performance/ext/pb_ds/multimap_text_find.hpp: Likewise. * testsuite/performance/ext/pb_ds/multimap_text_insert.hpp: Likewise. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp: Likewise. * testsuite/performance/ext/pb_ds/priority_queue_text_join.cc: Likewise. * testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp: Likewise. * testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc: Likewise. * testsuite/performance/ext/pb_ds/priority_queue_text_push.cc: Likewise. * testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc: Likewise. * testsuite/performance/ext/pb_ds/tree_text_insert.cc: Likewise. * testsuite/performance/ext/pb_ds/tree_text_lor_find.cc: Likewise.
2024-07-28libstdc++: Use dg-additional-files in some algorithm testsJonathan Wakely8-0/+8
Use the dg-additional-files directive to declare files that need to be copied into the test's working directory. This is currently redundant (as all .tst and .txt files are copied for all tests) but is a step towards not copying all files. libstdc++-v3/ChangeLog: * testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: Use dg-additional-files. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc: Likewise. * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc: Likewise. * testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc: Likewise. * testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc: Likewise. * testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc: Likewise. * testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Likewise. * testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc: Likewise.
2024-07-28libstdc++: Add file-io-diff to replace @diff@ markup in I/O testsJonathan Wakely20-57/+131
This adds a new dg-final action to compare two files after a test has run, so that we can verify that fstream operations produce the expected results. With this change, all uses of @diff@ that seem potentially useful have been converted to actually compare the files and FAIL if they differ. The file-io-diff action can take two arguments naming the files to be compared, or for convenience it can take a single string and will compare STR.tst and STR.txt, as that's how it's commonly used. Additionally, all remaining uses of @require@ are converted to dg-additional-files directives, so that the TODO in libstdc++.exp can be resolved. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_filebuf/close/char/1.cc: Remove @require@ and @diff@. Use dg-final file-io-diff action. * testsuite/27_io/basic_istream/extractors_other/char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/get/char/2.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/3.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/6414.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/6414.cc: Likewise. * testsuite/27_io/basic_istream/seekg/char/fstream.cc: Likewise. * testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc: Likewise. * testsuite/27_io/basic_istream/tellg/char/fstream.cc: Likewise. * testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc: Likewise. * testsuite/27_io/basic_ofstream/open/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc: Likewise. * testsuite/27_io/ios_base/sync_with_stdio/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/2.cc: Likewise. Check file positions. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc: Likewise. * testsuite/lib/libstdc++.exp (file-io-diff): New proc.
2024-07-28libstdc++: Use dg-additional-files in some I/O testsJonathan Wakely37-6/+48
Use the dg-additional-files directive to declare files that need to be copied into the test's working directory. This is currently redundant (as all .tst and .txt files are copied for all tests) but is a step towards not copying all files. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_filebuf/imbue/char/2.cc: Use dg-additional-files. * testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/path.cc: Likewise. * testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/3.cc: Likewise. * testsuite/27_io/basic_filebuf/underflow/10096.cc: Likewise. * testsuite/27_io/basic_fstream/cons/char/path.cc: Likewise. * testsuite/27_io/basic_fstream/open/char/path.cc: Likewise. * testsuite/27_io/basic_ifstream/assign/1.cc: Likewise. * testsuite/27_io/basic_ifstream/cons/move.cc: Likewise. * testsuite/27_io/basic_ifstream/cons/char/path.cc: Likewise. * testsuite/27_io/basic_ifstream/open/char/path.cc: Likewise. * testsuite/27_io/basic_ifstream/open/wchar_t/1.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/objects/char/12048-1.cc: Likewise. * testsuite/27_io/objects/char/12048-2.cc: Likewise. * testsuite/27_io/objects/char/12048-3.cc: Likewise. * testsuite/27_io/objects/char/12048-4.cc: Likewise. * testsuite/27_io/objects/char/12048-5.cc: Likewise. * testsuite/27_io/objects/wchar_t/12048-1.cc: Likewise. * testsuite/27_io/objects/wchar_t/12048-2.cc: Likewise. * testsuite/27_io/objects/wchar_t/12048-3.cc: Likewise. * testsuite/27_io/objects/wchar_t/12048-4.cc: Likewise. * testsuite/27_io/objects/wchar_t/12048-5.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/char/12048-1.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/char/12048-2.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/char/12048-3.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/char/12048-4.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc: Likewise. * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc: Likewise.
2024-07-28libstdc++: Replace @require@ markup in some I/O testsJonathan Wakely57-208/+117
We can replace the @require@ markup with { dg-additional-files ... } directives, so that the required files are explicitly named and are explicitly copied into place for tests that require it. This will allow a later change to remove the "Copy all required data files" step in the proc libstdc++_init in testsuite/lib/libstdc++.exp that is marked TODO. This commit uses dg-additional-files for a subset of the files that contain @require@. Also remove the @diff@ markup where appears to be copy & pasted from other test files, and so serves no purpose. For example, there is no output file created by 27_io/basic_ifstream/cons/char/1.cc so there is nothing for @diff@ to compare. Maybe the purpose was to check that reading the .tst file with an ifstream doesn't change it, but we've survived without doing those comparisons for many years so I think we can remove those cases of @diff@ markup. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_filebuf/close/char/2.cc: Remove @require@ and @diff@ markup. Use dg-additional-files. Remove unused variable. * testsuite/27_io/basic_filebuf/close/char/3.cc: Remove @require@ and @diff@ markup. Use dg-additional-files. * testsuite/27_io/basic_filebuf/close/char/4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/5.cc: Likewise. * testsuite/27_io/basic_filebuf/in_avail/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/is_open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/2-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1-io.cc: Likewise. Remove unused variable. * testsuite/27_io/basic_filebuf/sputn/char/2-in.cc: Remove @require@ and @diff@ markup. Use dg-additional-files. * testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc: Likewise. * testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc: Likewise. * testsuite/27_io/basic_ifstream/cons/char/1.cc: Likewise. * testsuite/27_io/basic_ifstream/open/char/1.cc: Likewise. * testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc: Likewise. * testsuite/27_io/basic_istream/readsome/char/6746-2.cc: Likewise. * testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc: Likewise. * testsuite/27_io/basic_istream/seekg/char/sstream.cc: Likewise. * testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc: Likewise. * testsuite/27_io/basic_istream/tellg/char/1.cc: Likewise. * testsuite/27_io/basic_istream/tellg/char/sstream.cc: Likewise. * testsuite/27_io/basic_istream/tellg/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc: Likewise. * testsuite/27_io/basic_ofstream/open/char/1.cc: Likewise. * testsuite/lib/dg-options.exp (dg-additional-files): Append to v3_additional_files instead of replacing. * testsuite/lib/libstdc++.exp (v3_target_compile): Reset v3_additional_files after copying files.
2024-07-28libstdc++: Clean up @diff@ markup in some I/O testsJonathan Wakely28-109/+24
We have a number of 27_io/* tests with comments like this: // @require@ %-*.tst // @diff@ %-*.tst %-*.txt It seems that these declare required data files used by the test and a post-test action to compare the test output with the expected result. We do have tests that depend on some *.tst and/or *.txt files that are copied from testsuite/data into each test's working directory before it runs, so the comments are related to those dependencies. However, nothing in the current test framework actually makes use of these comments. Currently, every test gets a fresh copy of every *.tst and *.txt file in the testsuite/data directory, whether the test actually requires them or not. This change is the first in a series to clean up this unused markup in the tests. This first step is to just remove all @require@ and @diff@ comments where they seem to serve no purpose at all. These tests do not open any of the *.tst or *.txt files that are copied into the test's working directory from the testsuite/data directory, so they don't "require" any of those files, and there's no need to "diff" them after the test runs. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_filebuf/close/char/4879.cc: Remove @require@ and @diff@ comments. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/3.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/snextc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc: Likewise. * testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Likewise. Remove unused variable. * testsuite/27_io/basic_filebuf/sputn/char/2-io.cc: Likewise. * testsuite/27_io/basic_ofstream/cons/char/1.cc: Remove @require@ and @diff@ comments. Remove unused variables. * testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc: Remove * testsuite/27_io/ios_base/sync_with_stdio/2.cc: Likewise.
2024-07-28[MAINTAINERS] Update email and move to DCOMatthew Malcomson1-1/+2
* MAINTAINERS: Update my email address. Signed-off-by: Matthew Malcomson <mmalcomson@nvidia.com>
2024-07-28RISC-V: Disable Zba optimization pattern if XTheadMemIdx is enabledChristoph Müllner3-1/+56
It is possible that the Zba optimization pattern zero_extendsidi2_bitmanip matches for a XTheadMemIdx INSN with the effect of emitting an invalid instruction as reported in PR116035. The pattern above is used to emit a zext.w instruction to zero-extend SI mode registers to DI mode. A similar functionality can be achieved by XTheadBb's th.extu instruction. And indeed, we have the equivalent pattern in thead.md (zero_extendsidi2_th_extu). However, that pattern depends on !TARGET_XTHEADMEMIDX. To compensate for that, there are specific patterns that ensure that zero-extension instruction can still be emitted (th_memidx_bb_zero_extendsidi2 and friends). While we could implement something similar (th_memidx_zba_zero_extendsidi2) it would only make sense, if there existed real HW that does implement Zba and XTheadMemIdx, but not XTheadBb. Unless such a machine exists, let's simply disable zero_extendsidi2_bitmanip if XTheadMemIdx is available. PR target/116035 gcc/ChangeLog: * config/riscv/bitmanip.md: Disable zero_extendsidi2_bitmanip for XTheadMemIdx. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr116035-1.c: New test. * gcc.target/riscv/pr116035-2.c: New test. Reported-by: Patrick O'Neill <patrick@rivosinc.com> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
2024-07-28x86: Don't enable APX_F in 32-bit modeLingling Kong4-2/+32
gcc/ChangeLog: PR target/115978 * config/i386/driver-i386.cc (host_detect_local_cpu): Enable APX_F only for 64-bit codegen. * config/i386/i386-options.cc (DEF_PTA): Skip PTA_APX_F if not in 64-bit mode. gcc/testsuite/ChangeLog: PR target/115978 * gcc.target/i386/pr115978-1.c: New test. * gcc.target/i386/pr115978-2.c: Ditto.
2024-07-28Internal-fn: Only allow modes describe types for internal fn[PR115961]Pan Li2-0/+64
The direct_internal_fn_supported_p has no restrictions for the type modes. For example the bitfield like below will be recog as .SAT_TRUNC. struct e { unsigned pre : 12; unsigned a : 4; }; __attribute__((noipa)) void bug (e * v, unsigned def, unsigned use) { e & defE = *v; defE.a = min_u (use + 1, 0xf); } This patch would like to add checks for the direct_internal_fn_supported_p, and only allows the tree types describled by modes. The below test suites are passed for this patch: 1. The rv64gcv fully regression tests. 2. The x86 bootstrap tests. 3. The x86 fully regression tests. PR target/115961 gcc/ChangeLog: * internal-fn.cc (type_strictly_matches_mode_p): Add new func impl to check type strictly matches mode or not. (type_pair_strictly_matches_mode_p): Ditto but for tree type pair. (direct_internal_fn_supported_p): Add above check for the tree type pair. gcc/testsuite/ChangeLog: * g++.dg/torture/pr115961-run-1.C: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
2024-07-28[PR rtl-optimization/115877][6/n] Add testcase from pr115877Jeff Law1-0/+20
This just adds the testcase from pr115877. It's working now on the trunk. I'm not done with cleanups/bugfixing, but there's no reason to not have the testcase installed at this point. PR rtl-optimization/115877 gcc/testsuite * gcc.dg/torture/pr115877.c: New test.
2024-07-28Daily bump.GCC Administrator8-1/+345
2024-07-28Output CodeView type information for rvalue referencesMark Harmstone2-5/+11
Translates DW_TAG_rvalue_reference_type DIEs into LF_POINTER types. gcc/ * dwarf2codeview.cc (get_type_num_reference_type): Handle rvalue refs. (get_type_num_array_type): Add DW_TAG_rvalue_reference_type to switch. (get_type_num): Handle DW_TAG_rvalue_reference_type DIEs. * dwarf2codeview.h (CV_PTR_MODE_RVREF): Define.
2024-07-28Output CodeView type information for referencesMark Harmstone2-0/+45
Translates DW_TAG_reference_type DIEs into LF_POINTER types. gcc/ * dwarf2codeview.cc (get_type_num_reference_type): New function. (get_type_num_array_type): Add DW_TAG_reference_type to switch. (get_type_num): Handle DW_TAG_reference_type DIEs. * dwarf2codeview.h (CV_PTR_MODE_LVREF): Define.
2024-07-28RISC-V: Fix snafu in SI mode splitters patchVineet Gupta1-1/+1
SPEC2017 perlbench for RISC-V was broke as runtime output mismatch failure. > 3830: mbox2: dWshe3Aa1EULre4CT5O/ErYFrk+o/EOoebA1kTVjQVQQH2EjT5fHcYnwjj2MdBmZu5y3Ce4Ei4QQZo/SNrry9g > mbox2: uuWPimQiU0D4UrwFP+LS0lFNph4qL43WV1A6T3tHleatIOUaHixhrJU9NoA2lc9KjwYpdEL0lNTXkvo8ymNHzA > ^ > 3832: mbox3: 8f4jdv6GIf0lX3DcdwRdEm6/aZwnmGX6n86GzCvmkwTKFXQjwlwVHc8jy8XlcyiIPr3yXTkgVOiP3cRYvyYQPg > mbox3: 9xQySgP6qbhfxl8Usu1WfGA5UhStB5AN31wueGM6OF4Jp59DkqJPu6ksGblOU5u0nQapQC1e9oYIs16a2mq2NA > ^ > specdiff run completed Edwin bisected this to 273f16a125c4 ("[v3][RISC-V] Handle bit manipulation of SImode values") which had the operands swapped in one of the new splitters introduced. No test as reducer narrows it to down to the exact test introduced by the original commit. gcc/ChangeLog: * config/riscv/bitmanip.md: Fix splitter. Reported-by: Edwin Lu <ewlu@rivosinc.com> Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
2024-07-28doc: add missing @option for musttailMarek Polacek1-2/+2
gcc/ChangeLog: * doc/extend.texi: Add missing @option.
2024-07-28Add documentation for musttail attributeAndi Kleen1-2/+23
gcc/ChangeLog: PR c/83324 * doc/extend.texi: Document [[musttail]]
2024-07-28Add tests for C/C++ musttail attributesAndi Kleen14-0/+327
Some adopted from the existing C musttail plugin tests. Also extends the ability to query the sibcall capabilities of the target. gcc/testsuite/ChangeLog: * lib/target-supports.exp: (check_effective_target_struct_tail_call): New function. * c-c++-common/musttail1.c: New test. * c-c++-common/musttail12.c: New test. * c-c++-common/musttail13.c: New test. * c-c++-common/musttail2.c: New test. * c-c++-common/musttail3.c: New test. * c-c++-common/musttail4.c: New test. * c-c++-common/musttail5.c: New test. * c-c++-common/musttail7.c: New test. * c-c++-common/musttail8.c: New test. * g++.dg/musttail10.C: New test. * g++.dg/musttail11.C: New test. * g++.dg/musttail6.C: New test. * g++.dg/musttail9.C: New test.
2024-07-28C: Implement musttail attribute for returnsAndi Kleen3-16/+64
Implement a C23 clang compatible musttail attribute similar to the earlier C++ implementation in the C parser. gcc/c/ChangeLog: PR c/83324 * c-parser.cc (struct attr_state): Define with musttail_p. (c_parser_statement_after_labels): Handle [[musttail]]. (c_parser_std_attribute): Dito. (c_parser_handle_musttail): Dito. (c_parser_compound_statement_nostart): Dito. (c_parser_all_labels): Dito. (c_parser_statement): Dito. * c-tree.h (c_finish_return): Add musttail_p flag. * c-typeck.cc (c_finish_return): Handle musttail_p flag.
2024-07-28C++: Support clang compatible [[musttail]] (PR83324)Andi Kleen6-4/+63
This patch implements a clang compatible [[musttail]] attribute for returns. musttail is useful as an alternative to computed goto for interpreters. With computed goto the interpreter function usually ends up very big which causes problems with register allocation and other per function optimizations not scaling. With musttail the interpreter can be instead written as a sequence of smaller functions that call each other. To avoid unbounded stack growth this requires forcing a sibling call, which this attribute does. It guarantees an error if the call cannot be tail called which allows the programmer to fix it instead of risking a stack overflow. Unlike computed goto it is also type-safe. It turns out that David Malcolm had already implemented middle/backend support for a musttail attribute back in 2016, but it wasn't exposed to any frontend other than a special plugin. This patch adds a [[gnu::musttail]] attribute for C++ that can be added to return statements. The return statement must be a direct call (it does not follow dependencies), which is similar to what clang implements. It then uses the existing must tail infrastructure. For compatibility it also detects clang::musttail Passes bootstrap and full test gcc/c-family/ChangeLog: * c-attribs.cc (set_musttail_on_return): New function. * c-common.h (set_musttail_on_return): Declare new function. gcc/cp/ChangeLog: PR c/83324 * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add. * parser.cc (cp_parser_statement): Handle musttail. (cp_parser_jump_statement): Dito. * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL. * semantics.cc (simplify_aggr_init_expr): Handle musttail.
2024-07-28c++: normalizing ttp constraints [PR115656]Patrick Palka4-6/+19
Here we normalize the constraint same_as<T, bool> for the first time during ttp coercion of B / UU, specifically constraint subsumption checking. During this normalization the set of in-scope template parameters i.e. current_template_parms is empty, which we rely on during normalization of the ttp constraints since we pass in_decl=NULL_TREE to norm_info. And this tricks the satisfaction cache into thinking that the satisfaction value of same_as<T, bool> is independent of its template parameters, and we incorrectly conflate the satisfaction value with T = bool vs T = long and accept the specialization A<long, B>. Since is_compatible_template_arg rewrites the ttp's constraints to be in terms of the argument template's parameters, and since it's the only caller of weakly_subsumes, the latter funcion can instead pass in_decl=tmpl to avoid relying on current_template_parms. This patch implements this, and in turns renames weakly_subsumes to ttp_subsumes to reflect that this predicate is now hardcoded for this one caller. PR c++/115656 gcc/cp/ChangeLog: * constraint.cc (weakly_subsumes): Pass in_decl=tmpl to get_normalized_constraints_from_info. Rename to ... (ttp_subsumes): ... this. * cp-tree.h (weakly_subsumes): Rename to ... (ttp_subsumes): ... this. * pt.cc (is_compatible_template_arg): Adjust after renaming. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-ttp7.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com>
2024-07-28c++: missing SFINAE during alias CTAD [PR115296]Patrick Palka2-1/+20
During the alias CTAD transformation, if substitution failed for some guide we should just silently discard the guide. We currently do discard the guide, but not silently, as in the below testcase which we diagnose forming a too-large array type when transforming the user-defined deduction guides. This patch fixes this by using complain=tf_none instead of tf_warning_or_error throughout alias_ctad_tweaks. PR c++/115296 gcc/cp/ChangeLog: * pt.cc (alias_ctad_tweaks): Use complain=tf_none instead of tf_warning_or_error. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias23.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com>