aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2024-04-09modula2: tidyup makeSystemGaius Mulley1-5/+9
This patch provides a tidyup for gcc/m2/tools-src/makeSystem. It only runs the compiler once and will echo a debug command line should it fail. gcc/m2/ChangeLog: * tools-src/makeSystem: Invoke ${COMPILER} once and adjust the echo string to expand the shell variables with -wrapper gdb, --args. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-04-09LoongArch: Enable switchable targetYang Yujie5-17/+127
This patch fixes the back-end context switching in cases where functions should be built with their own target contexts instead of the global one, such as LTO linking and functions with target attributes (TBD). PR target/113233 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_reg_init): Reinitialize the loongarch_regno_mode_ok cache. (loongarch_option_override): Same. (loongarch_save_restore_target_globals): Restore target globals. (loongarch_set_current_function): Restore the target contexts for functions. (TARGET_SET_CURRENT_FUNCTION): Define. * config/loongarch/loongarch.h (SWITCHABLE_TARGET): Enable switchable target context. * config/loongarch/loongarch-builtins.cc (loongarch_init_builtins): Initialize all builtin functions at startup. (loongarch_expand_builtin): Turn assertion of builtin availability into a test. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Define condition loongarch_sx_as. * gcc.dg/lto/pr113233_0.c: New test.
2024-04-09rust: Add rust.install-dvi and rust.install-html rulesChristophe Lyon1-0/+2
rust has the (empty) rust.dvi and rust.html rules, but lacks the (empty) rust.install-dvi and rust.install-html ones. 2024-04-04 Christophe Lyon <christophe.lyon@linaro.org> gcc/rust/ * Make-lang.in (rust.install-dvi, rust.install-html): New rules.
2024-04-09Generate constant at start of loop, without UBJørgen Kvalsvik1-5/+15
Generating the constants used for recording the edges taken for condition coverage would trigger undefined behavior when an expression had exactly 64 (== sizeof (1ULL)) conditions, as it would generate the constant for the next iteration at the end of the loop body, even if there was never a next iteration. By moving the check and constant generation to the top of the loop and hoisting the increment flag there is no opportunity for UB. PR middle-end/114627 gcc/ChangeLog: * tree-profile.cc (instrument_decisions): Generate constant at the start of loop.
2024-04-09Add tree-inlined gconds to caller cond->expr mapJørgen Kvalsvik2-19/+76
Properly add the condition -> expression mapping of inlined gconds from the caller into the callee map. This is a fix for PR114599 that works beyond fixing the segfault, as the previous fixed copied references to the source gconds, not the deep copied ones that end up in the calle body. The new tests checks this, both in the case of a calle without conditions (which triggered the segfault), and a test that shows that conditions are properly mapped, and not mixed. PR middle-end/114599 gcc/ChangeLog: * tree-inline.cc (copy_bb): Copy cond_uids into callee. (prepend_lexical_block): Remove outdated comment. (add_local_variables): Remove bad cond_uids copy. gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-19.c: New test.
2024-04-09c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]Jakub Jelinek2-7/+31
When looking at maybe_warn_for_constant_evaluated for the trivial infinite loops patch, I've noticed that it can emit weird diagnostics for if constexpr in templates, first warn that std::is_constant_evaluted() always evaluates to false (because the function template is not constexpr) and then during instantiation warn that std::is_constant_evaluted() always evaluates to true (because it is used in if constexpr condition). Now, only the latter is actually true, even when the if constexpr is in a non-constexpr function, it will still always evaluate to true. So, the following patch fixes it to call maybe_warn_for_constant_evaluated always with IF_STMT_CONSTEXPR_P (if_stmt) as the second argument rather than true if it is if constexpr with non-dependent condition etc. 2024-04-09 Jakub Jelinek <jakub@redhat.com> PR c++/114580 * semantics.cc (finish_if_stmt_cond): Call maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt) as the second argument, rather than true/false depending on if it is if constexpr with non-dependent constant expression with bool type. * g++.dg/cpp2a/is-constant-evaluated15.C: New test.
2024-04-09Fix up duplicated words mostly in comments, part 2Jakub Jelinek28-36/+36
Another patch from eyeballing git grep -v 'long long\|optab optab\|template template\|double double' | grep ' \([a-zA-Z]\+\) \1 ' output, this time in gcc/ subdirectory. 2024-04-09 Jakub Jelinek <jakub@redhat.com> gcc/ * expr.cc (convert_mode_scalar): Fix duplicated words in comment; into into -> it into. * function.h (function::cond_uids): Fix duplicated words in comment; same same -> same. * config/riscv/riscv-vector-costs.cc (costs::adjust_vect_cost_per_loop): Fix duplicated words in comment; model model -> model. * config/riscv/riscv-vector-builtins-shapes.cc (build_base): Fix duplicated words in comment; for for -> for. * config/riscv/riscv-avlprop.cc (pass_avlprop::execute): Fix duplicated words in comment; more more -> more. * config/aarch64/driver-aarch64.cc (host_detect_local_cpu): Fix duplicated words in comment; be be -> be. * tree-profile.cc (masking_vectors): Fix duplicated words in comment; has has -> has, the the -> the. * value-range.cc (irange::set_range_from_bitmask): Fix duplicated words in comment; the the -> the. * gcov.cc (add_condition_counts): Fix duplicated words in comment; to to -> to. * vr-values.cc (get_scev_info): Fix duplicated words in comment; the the -> to the. * tree-vrp.cc (fully_replaceable): Fix duplicated words in comment; by by -> by. * mode-switching.cc (single_succ_confluence_n): Fix duplicated words in comment; the the -> the. * tree-ssa-phiopt.cc (value_replacement): Fix duplicated words in comment; can can -> we can. * gimple-range-phi.cc (phi_analyzer::process_phi): Fix duplicated words in comment; it it -> it is. * tree-ssa-sccvn.cc (visit_phi): Fix duplicated words in comment; to to -> to. * rtl-ssa/accesses.h (use_info::next_debug_insn_use): Fix duplicated words in comment; if if -> if. * doc/options.texi (InverseMask): Fix duplicated words; and and -> and. Change take to takes. * doc/invoke.texi (fanalyzer-undo-inlining): Fix duplicated words; be be -> be. (-minline-memops-threshold): Likewise. gcc/analyzer/ * analyzer.opt (Wanalyzer-undefined-behavior-strtok): Fix duplicated words; in in -> in. * program-state.cc (sm_state_map::replay_call_summary): Fix duplicated words in comment; to to -> to. (program_state::replay_call_summary): Likewise. * region-model.cc (region_model::replay_call_summary): Likewise. gcc/c/ * c-decl.cc (previous_tag): Fix duplicated words in comment; the the -> the. (diagnose_mismatched_decls): Fix duplicated words in comment; about about -> about. gcc/cp/ * constexpr.cc (build_new_constexpr_heap_type): Fix duplicated words in comment; is is -> is. * cp-tree.def (CO_RETURN_EXPR): Fix duplicated words in comment; for for -> for. * parser.cc (fixup_blocks_walker): Fix duplicated words in comment; is is -> is. * semantics.cc (fixup_template_type): Fix duplicated words in comment; for for -> for. (finish_omp_for): Fix duplicated words in comment; the the -> the. * pt.cc (more_specialized_fn): Fix duplicated words in comment; think think -> think. (type_targs_deducible_from): Fix duplicated words in comment; the the -> the. gcc/jit/ * docs/topics/expressions.rst (Constructor expressions): Fix duplicated words; have have -> have.
2024-04-09bitint: Don't move debug stmts from before returns_twice calls [PR114628]Jakub Jelinek2-2/+36
Debug stmts are allowed by the verifier before the returns_twice calls. More importantly, they don't have a lhs, so the current handling of arg_stmts statements to force them on the edges ICEs. The following patch just keeps them where they were before. 2024-04-09 Jakub Jelinek <jakub@redhat.com> PR middle-end/114628 * gimple-lower-bitint.cc (gimple_lower_bitint): Keep debug stmts before returns_twice calls as is, don't push them into arg_stmts vector/move to edges. * gcc.dg/bitint-105.c: New test.
2024-04-09aarch64: Add support for aarch64-gnu (GNU/Hurd on AArch64)Sergey Bugaev2-0/+74
Coupled with a corresponding binutils patch, this produces a toolchain that can sucessfully build working binaries targeting aarch64-gnu. gcc/Changelog: * config.gcc: Recognize aarch64*-*-gnu* targets. * config/aarch64/aarch64-gnu.h: New file. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-04-09Move GNU/Hurd startfile spec from config/i386/gnu.h to config/gnu.hSergey Bugaev2-11/+16
Since it's not i386-specific; this makes it possible to reuse it for other architectures. Also, add a warning for the case gnu.h is specified before gnu-user.h, which would cause gnu-user's version of the spec to override gnu's, and not the other way around as it's intended. The i?86-gnu target currently specifies them in the right order, but it's easy to accidentally put them in a wrong order. gcc/Changelog: * config/i386/gnu.h: Move GNU/Hurd STARTFILE_SPEC from here... * config/gnu.h: ...to here. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-04-09middle-end/114604 - ranger allocates bitmap without initialized obstackRichard Biener1-0/+4
The following fixes ranger bitmap allocation when invoked from IPA context where the global bitmap obstack possibly isn't initialized. Instead of trying to use one of the ranger obstacks the following simply initializes the global bitmap obstack around an active ranger. PR middle-end/114604 * gimple-range.cc (enable_ranger): Initialize the global bitmap obstack. (disable_ranger): Release it.
2024-04-09RTEMS: Add multilib configuration for aarch64Sebastian Huber2-0/+43
Add a multilib with workarounds for Cortex-A53 errata. gcc/ChangeLog: * config.gcc (aarch64-*-rtems*): Add target makefile fragment t-aarch64-rtems. * config/aarch64/t-aarch64-rtems: New file.
2024-04-08x86: Define __APX_INLINE_ASM_USE_GPR32__H.J. Lu2-0/+8
Define __APX_INLINE_ASM_USE_GPR32__ for -mapx-inline-asm-use-gpr32. When __APX_INLINE_ASM_USE_GPR32__ is defined, inline asm statements should contain only instructions compatible with r16-r31. gcc/ PR target/114587 * config/i386/i386-c.cc (ix86_target_macros_internal): Define __APX_INLINE_ASM_USE_GPR32__ for -mapx-inline-asm-use-gpr32. gcc/testsuite/ PR target/114587 * gcc.target/i386/apx-3.c: Likewise.
2024-04-08testsuite: Add profile_update_atomic check to gcov-20.c [PR114614]Kewen Lin1-0/+1
As PR114614 shows, the newly added test case gcov-20.c by commit r14-9789-g08a52331803f66 failed on targets which do not support atomic profile update, there would be a message like: warning: target does not support atomic profile update, single mode is selected Since the test case adopts -fprofile-update=atomic, it requires effective target check profile_update_atomic, this patch is to add the check accordingly. PR testsuite/114614 gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-20.c: Add effective target check profile_update_atomic.
2024-04-08rs6000: Fix wrong align passed to build_aligned_type [PR88309]Kewen Lin4-3/+33
As the comments in PR88309 show, there are two oversights in rs6000_gimple_fold_builtin that pass align in bytes to build_aligned_type but which actually requires align in bits, it causes unexpected ICE or hanging in function is_miss_rate_acceptable due to zero align_unit value. This patch is to fix them by converting bytes to bits, add an assertion on positive align_unit value and notes function build_aligned_type requires align measured in bits in its function comment. PR target/88309 Co-authored-by: Andrew Pinski <quic_apinski@quicinc.com> gcc/ChangeLog: * config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Fix wrong align passed to function build_aligned_type. * tree-ssa-loop-prefetch.cc (is_miss_rate_acceptable): Add an assertion to ensure align_unit should be positive. * tree.cc (build_qualified_type): Update function comments. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr88309.c: New test.
2024-04-09PR modula2/114648 cc1gm2 by default does not handle C pre-processor file and ↵Gaius Mulley4-1/+50
line directives This patch fixes the default behavior of cc1gm2 to the description in the documentation. By default cc1gm2 will allow C preprocessor directives (they can be turned off via -fno-cpp). gcc/m2/ChangeLog: PR modula2/114648 * gm2-compiler/M2Options.mod (LineDirectives): Initially set to true. gcc/testsuite/ChangeLog: PR modula2/114648 * gm2/cpp/default/pass/AdvParse.def: New test. * gm2/cpp/default/pass/AdvParse.mod: New test. * gm2/cpp/default/pass/cpp-default-pass.exp: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-04-09Daily bump.GCC Administrator4-1/+211
2024-04-08combine: Fix ICE in try_combine on pr112494.c [PR112560]Uros Bizjak2-5/+15
The compiler, configured with --enable-checking=yes,rtl,extra ICEs with: internal compiler error: RTL check: expected elt 0 type 'e' or 'u', have 'E' (rtx unspec) in try_combine, at combine.cc:3237 This is 3236 /* Just replace the CC reg with a new mode. */ 3237 SUBST (XEXP (*cc_use_loc, 0), newpat_dest); 3238 undobuf.other_insn = cc_use_insn; in combine.cc, where *cc_use_loc is (unspec:DI [ (reg:CC 17 flags) ] UNSPEC_PUSHFL) combine assumes CC must be used inside of a comparison and uses XEXP (..., 0) without checking on the RTX type of the argument. Replace cc_use_loc with the entire new RTX only in case cc_use_loc satisfies COMPARISON_P predicate. Otherwise scan the entire cc_use_loc RTX for CC reg to be updated with a new mode. PR rtl-optimization/112560 gcc/ChangeLog: * combine.cc (try_combine): Replace cc_use_loc with the entire new RTX only in case cc_use_loc satisfies COMPARISON_P predicate. Otherwise scan the entire cc_use_loc RTX for CC reg to be updated with a new mode. * config/i386/i386.md (@pushf<mode>2): Allow all CC modes for operand 1.
2024-04-08GCN: '--param=gcn-preferred-vectorization-factor=[default,32,64]'Thomas Schwinge36-2/+107
..., and specify '--param=gcn-preferred-vectorization-factor=64' for 'gcc.target/gcn/[...]' test cases with 'scan-assembler' directives that are specific to 64-lane vectors. This resolves regressions introduced in commit 6dedafe166cc02ae87b6a0699ad61ce3ffc46803 "amdgcn: Prefer V32 on RDNA devices". gcc/ * config/gcn/gcn.opt (--param=gcn-preferred-vectorization-factor): New. * config/gcn/gcn.cc (gcn_vectorize_preferred_simd_mode) Use it. * doc/invoke.texi (Optimize Options): Document it. gcc/testsuite/ * gcc.target/gcn/cond_fmaxnm_1.c: Specify '--param=gcn-preferred-vectorization-factor=64'. * gcc.target/gcn/cond_fmaxnm_2.c: Likewise. * gcc.target/gcn/cond_fmaxnm_3.c: Likewise. * gcc.target/gcn/cond_fmaxnm_4.c: Likewise. * gcc.target/gcn/cond_fmaxnm_5.c: Likewise. * gcc.target/gcn/cond_fmaxnm_6.c: Likewise. * gcc.target/gcn/cond_fmaxnm_7.c: Likewise. * gcc.target/gcn/cond_fmaxnm_8.c: Likewise. * gcc.target/gcn/cond_fminnm_1.c: Likewise. * gcc.target/gcn/cond_fminnm_2.c: Likewise. * gcc.target/gcn/cond_fminnm_3.c: Likewise. * gcc.target/gcn/cond_fminnm_4.c: Likewise. * gcc.target/gcn/cond_fminnm_5.c: Likewise. * gcc.target/gcn/cond_fminnm_6.c: Likewise. * gcc.target/gcn/cond_fminnm_7.c: Likewise. * gcc.target/gcn/cond_fminnm_8.c: Likewise. * gcc.target/gcn/cond_shift_3.c: Likewise. * gcc.target/gcn/cond_shift_4.c: Likewise. * gcc.target/gcn/cond_shift_8.c: Likewise. * gcc.target/gcn/cond_shift_9.c: Likewise. * gcc.target/gcn/cond_smax_1.c: Likewise. * gcc.target/gcn/cond_smin_1.c: Likewise. * gcc.target/gcn/cond_umax_1.c: Likewise. * gcc.target/gcn/cond_umin_1.c: Likewise. * gcc.target/gcn/simd-math-1.c: Likewise. * gcc.target/gcn/simd-math-5-char.c: Likewise. * gcc.target/gcn/simd-math-5-long.c: Likewise. * gcc.target/gcn/simd-math-5-short.c: Likewise. * gcc.target/gcn/simd-math-5.c: Likewise. * gcc.target/gcn/smax_1.c: Likewise. * gcc.target/gcn/smin_1.c: Likewise. * gcc.target/gcn/umax_1.c: Likewise. * gcc.target/gcn/umin_1.c: Likewise.
2024-04-08New effective-target 'asm_goto_with_outputs'Thomas Schwinge15-15/+31
After commit e16f90be2dc8af6c371fe79044c3e668fa3dda62 "testsuite: Fix up lra effective target", we get for nvptx target: -PASS: gcc.c-torture/compile/asmgoto-2.c -O0 (test for excess errors) +ERROR: gcc.c-torture/compile/asmgoto-2.c -O0 : no files matched glob pattern "lra1020113.c.[0-9][0-9][0-9]r.reload" for " dg-do 2 compile { target lra } " Etc. However, nvptx appears to support 'asm goto' with outputs, including the new execution test case: PASS: gcc.dg/pr107385.c execution test Therefore, generally use new effective-target 'asm_goto_with_outputs' instead of 'lra'. One exceptions is 'gcc.dg/pr110079.c', which doesn't use 'asm goto' with outputs, and continues using effective-target 'lra', with special-casing nvptx target, to avoid ERROR for 'lra'. gcc/ * doc/sourcebuild.texi (Effective-Target Keywords): Document 'asm_goto_with_outputs'. Add comment to 'lra'. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_lra): Add comment. (check_effective_target_asm_goto_with_outputs): New. * gcc.c-torture/compile/asmgoto-2.c: Use it. * gcc.c-torture/compile/asmgoto-5.c: Likewise. * gcc.c-torture/compile/asmgoto-6.c: Likewise. * gcc.c-torture/compile/pr98096.c: Likewise. * gcc.dg/pr100590.c: Likewise. * gcc.dg/pr107385.c: Likewise. * gcc.dg/pr108095.c: Likewise. * gcc.dg/pr97954.c: Likewise. * gcc.dg/torture/pr100329.c: Likewise. * gcc.dg/torture/pr100398.c: Likewise. * gcc.dg/torture/pr100519.c: Likewise. * gcc.dg/torture/pr110422.c: Likewise. * gcc.dg/pr110079.c: Special-case nvptx target.
2024-04-08Fortran: Accept again tab as alternative to space as separator [PR114304]Tobias Burnus1-0/+82
This fixes a side-effect of/regression caused by r14-9822-g93adf88cc6744a, which was for the same PR. PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Accept tab as alternative to space. gcc/testsuite/ChangeLog: * gfortran.dg/pr114304-2.f90: New test.
2024-04-08Update gcc fr.poJoseph Myers1-731/+536
* fr.po: Update.
2024-04-08ICF&SRA: Make ICF and SRA agree on paddingMartin Jambor14-55/+999
PR 113359 shows that (at least with -fno-strict-aliasing) ICF can unify two functions which copy an aggregate type of the same size but then SRA, through its total scalarization, can copy the aggregate by pieces, skipping paddding, but the padding was not the same in the two original functions that ICF unified. This patch enhances SRA with the ability to collect padding information which then can be compared from within ICF. Unfortunately SRA uses OPTION_SET_P when determining its limits, so ICF needs to switch cfuns at least once to figure it out too. gcc/ChangeLog: 2024-03-27 Martin Jambor <mjambor@suse.cz> PR ipa/113359 * ipa-icf-gimple.h (func_checker): New members safe_for_total_scalarization_p, m_total_scalarization_limit_known_p and m_total_scalarization_limit. (func_checker::func_checker): Initialize new member variables. * ipa-icf-gimple.cc: Include tree-sra.h. (func_checker::func_checker): Initialize new member variables. (func_checker::safe_for_total_scalarization_p): New function. (func_checker::compare_operand): Use the new function. * tree-sra.h (sra_get_max_scalarization_size): Declare. (sra_total_scalarization_would_copy_same_data_p): Likewise. * tree-sra.cc (prepare_iteration_over_array_elts): New function. (class sra_padding_collecting): New. (sra_padding_collecting::record_padding): Likewise. (scalarizable_type_p): Rename to totally_scalarizable_type_p. Add ability to record padding when requested. (totally_scalarize_subtree): Split out gathering information necessary to iterate over array elements to prepare_iteration_over_array_elts. Fix errornous early exit. (analyze_all_variable_accesses): Adjust the call to totally_scalarizable_type_p. Move determining of total scalariation size limit... (sra_get_max_scalarization_size): ...here. (check_ts_and_push_padding_to_vec): New function. (sra_total_scalarization_would_copy_same_data_p): Likewise. gcc/testsuite/ChangeLog: 2024-03-27 Martin Jambor <mjambor@suse.cz> PR ipa/113359 * gcc.dg/lto/pr113359-1_0.c: New. * gcc.dg/lto/pr113359-1_1.c: Likewise. * gcc.dg/lto/pr113359-2_0.c: Likewise. * gcc.dg/lto/pr113359-2_1.c: Likewise. * gcc.dg/lto/pr113359-3_0.c: Likewise. * gcc.dg/lto/pr113359-3_1.c: Likewise. * gcc.dg/lto/pr113359-4_0.c: Likewise. * gcc.dg/lto/pr113359-4_1.c: Likewise. * gcc.dg/lto/pr113359-5_0.c: Likewise. * gcc.dg/lto/pr113359-5_1.c: Likewise.
2024-04-08ipa: Compare jump functions in ICF (PR 113907)Martin Jambor8-1/+267
In PR 113907 comment #58, Honza found a case where ICF thinks bodies of functions are equivalent but becaise of difference in aliases in a memory access, different aggregate jump functions are associated with supposedly equivalent call statements. This patch adds a way to compare jump functions and plugs it into ICF to avoid the issue. gcc/ChangeLog: 2024-03-20 Martin Jambor <mjambor@suse.cz> PR ipa/113907 * ipa-prop.h (class ipa_vr): Declare new overload of a member function equal_p. (ipa_jump_functions_equivalent_p): Declare. * ipa-prop.cc (ipa_vr::equal_p): New function. (ipa_agg_pass_through_jf_equivalent_p): Likewise. (ipa_agg_jump_functions_equivalent_p): Likewise. (ipa_jump_functions_equivalent_p): Likewise. * ipa-cp.h (values_equal_for_ipcp_p): Declare. * ipa-cp.cc (values_equal_for_ipcp_p): Make function public. * ipa-icf-gimple.cc: Include alloc-pool.h, symbol-summary.h, sreal.h, ipa-cp.h and ipa-prop.h. (func_checker::compare_gimple_call): Comapre jump functions. gcc/testsuite/ChangeLog: 2024-03-20 Martin Jambor <mjambor@suse.cz> PR ipa/113907 * gcc.dg/lto/pr113907_0.c: New. * gcc.dg/lto/pr113907_1.c: Likewise. * gcc.dg/lto/pr113907_2.c: Likewise.
2024-04-08aarch64: Fix expansion of svsudot [PR114607]Richard Sandiford2-5/+5
Not sure how this happend, but: svsudot is supposed to be expanded as USDOT with the operands swapped. However, a thinko in the expansion of svsudot meant that the arguments weren't in fact swapped; the attempted swap was just a no-op. And the testcases blithely accepted that. gcc/ PR target/114607 * config/aarch64/aarch64-sve-builtins-base.cc (svusdot_impl::expand): Fix botched attempt to swap the operands for svsudot. gcc/testsuite/ PR target/114607 * gcc.target/aarch64/sve/acle/asm/sudot_s32.c: New test.
2024-04-08RISC-V: Implement TLS Descriptors.Tatsuyuki Ishi11-11/+115
This implements TLS Descriptors (TLSDESC) as specified in [1]. The 4-instruction sequence is implemented as a single RTX insn for simplicity, but this can be revisited later if instruction scheduling or more flexible RA is desired. The default remains to be the traditional TLS model, but can be configured with --with-tls={trad,desc}. The choice can be revisited once toolchain and libc support ships. [1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373. gcc/ChangeLog: * config/riscv/riscv.opt: Add -mtls-dialect to configure TLS flavor. * config.gcc: Add --with-tls configuration option to change the default TLS flavor. * config/riscv/riscv.h: Add TARGET_TLSDESC determined from -mtls-dialect and with_tls defaults. * config/riscv/riscv-opts.h: Define enum riscv_tls_type for the two TLS flavors. * config/riscv/riscv-protos.h: Define SYMBOL_TLSDESC symbol type. * config/riscv/riscv.md: Add instruction sequence for TLSDESC. * config/riscv/riscv.cc (riscv_symbol_insns): Add instruction sequence length data for TLSDESC. (riscv_legitimize_tls_address): Add lowering of TLSDESC. * doc/install.texi: Document --with-tls for RISC-V. * doc/invoke.texi: Document -mtls-dialect for RISC-V. gcc/testsuite/ChangeLog: * gcc.target/riscv/tls_1.x: Add TLSDESC GD test case. * gcc.target/riscv/tlsdesc.c: Same as above.
2024-04-08s390: Fix s390_const_int_pool_entry_p and movdi peephole2 [PR114605]Jakub Jelinek3-2/+59
The following testcase is miscompiled, because we have initially a movti which loads the 0x3f8000003f800000ULL TImode constant from constant pool. Later on we split it into a pair of DImode loads. Now, for the first load (why just that?, though not stage4 material) we trigger the peephole2 which uses s390_const_int_pool_entry_p. That function doesn't check at all the constant pool mode though, sees the constant pool at that address has a CONST_INT value and just assumes that is the value to return, which is especially wrong for big-endian, if it is a DImode load from offset 0, it should be loading 0 rather than 0x3f8000003f800000ULL. The following patch adds checks if we are extracing a MODE_INT mode, if the constant pool has MODE_INT mode as well, punts if constant pool has smaller mode size than the extraction one (then it would be UB), if it has the same mode as before keeps using what it did before, if constant pool has a larger mode than the one being extracted, uses simplify_subreg. I'd have used avoid_constant_pool_reference instead which can handle also offsets into the constant pool constants, but it can't handle UNSPEC_LTREF. Another thing is that once that is fixed, we ICE when we extract constant like 0, ior insn predicate require non-0 constant. So, the patch also fixes the peephole2 so that if either 32-bit half is zero, it uses a mere load of the constant into register rather than a pair of such load and ior. 2024-04-08 Jakub Jelinek <jakub@redhat.com> PR target/114605 * config/s390/s390.cc (s390_const_int_pool_entry_p): Punt if mem doesn't have MODE_INT mode, or pool constant doesn't have MODE_INT mode, or if pool constant mode is smaller than mem mode. If mem mode is different from pool constant mode, try to simplify subreg. If that doesn't work, punt, if it does, use the simplified constant instead of the constant pool constant. * config/s390/s390.md (movdi from const pool peephole): If either low or high 32-bit part is zero, just emit move insn instead of move + ior. * gcc.dg/pr114605.c: New test.
2024-04-08aarch64: Fix vld1/st1_x4 intrinsic testSwinney, Jonathan1-3/+7
The test for this intrinsic was failing silently and so it failed to report the bug reported in 114521. This patch modifes the test to report the result. Bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114521 Signed-off-by: Jonathan Swinney <jswinney@amazon.com> gcc/testsuite/ * gcc.target/aarch64/advsimd-intrinsics/vld1x4.c: Exit with a nonzero code if the test fails.
2024-04-08ChangeLog: Add by hand ChangeLog entry for PR114361 revert.Jakub Jelinek2-0/+19
This commit has been added to IGNORED_COMMITS, because it contained bogus explanation of the standardized git revert message.
2024-04-08Daily bump.GCC Administrator9-1/+442
2024-04-08tree-optimization/114624 - fix use-after-free in SCCPRichard Biener2-2/+22
We're inspecting the replaced PHI node after releasing it. PR tree-optimization/114624 * tree-scalar-evolution.cc (final_value_replacement_loop): Get at the PHI arg location before releasing the PHI node. * gcc.dg/torture/pr114624.c: New testcase.
2024-04-08RISC-V: Refine the error msg for RVV intrinisc required extPan Li15-19/+210
The RVV intrinisc API has sorts of required extension from both the march or target attribute. It will have error message similar to below: built-in function '__riscv_vsetvl_e8m4\(vl\)' requires the V ISA extension However, it is not accurate as we have many additional sub extenstion besides v extension. For example, zvbb, zvbk, zvbc ... etc. This patch would like to refine the error message with a friendly hint for the required extension. For example as below: vuint64m1_t __attribute__((target("arch=+v"))) test_1 (vuint64m1_t op_1, vuint64m1_t op_2, size_t vl) { return __riscv_vclmul_vv_u64m1 (op_1, op_2, vl); } When compile with march=rv64gc and target arch=+v, we will have error message as below: error: built-in function '__riscv_vclmul_vv_u64m1(op_1, op_2, vl)' requires the 'zvbc' ISA extension Then the end-user will get the point that the *zvbc* extension is missing for the intrinisc API easily. The below tests are passed for this patch. * The riscv fully regression tests. gcc/ChangeLog: * config/riscv/riscv-vector-builtins-shapes.cc (build_one): Pass required_ext arg when invoke add function. (build_th_loadstore): Ditto. (struct vcreate_def): Ditto. (struct read_vl_def): Ditto. (struct vlenb_def): Ditto. * config/riscv/riscv-vector-builtins.cc (function_builder::add_function): Introduce new arg required_ext to fill in the register func. (function_builder::add_unique_function): Ditto. (function_builder::add_overloaded_function): Ditto. (expand_builtin): Leverage required_extensions_specified to check if the required extension is provided. * config/riscv/riscv-vector-builtins.h (reqired_ext_to_isa_name): New func impl to convert the required_ext enum to the extension name. (required_extensions_specified): New func impl to predicate if the required extension is well feeded. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-7.c: Adjust the error message for v extension. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-8.c: Ditto. * gcc.target/riscv/rvv/base/intrinsic_required_ext-1.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-10.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-2.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-3.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-4.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-5.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-6.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-7.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-8.c: New test. * gcc.target/riscv/rvv/base/intrinsic_required_ext-9.c: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
2024-04-08Darwin: Sync coverage specs with gcc/gcc.cc.Iain Sandoe1-1/+1
The specs for coverage ere out of date leading to test fails for fcondition-coverage cases. Fixed by updating to match the specs in gcc/gcc.cc. gcc/ChangeLog: * config/darwin.h (LINK_COMMAND_SPEC_A): Update coverage specs. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-08RISC-V: Minor fix for max_pointdemin.han1-1/+1
The program points start from 1, so max_point should be equal to length(). Tested on RV64 and no regression. gcc/ChangeLog: * config/riscv/riscv-vector-costs.cc: Use length() Signed-off-by: demin.han <demin.han@starfivetech.com>
2024-04-08RISC-V: Allow RVV intrinsic for more function targetPan Li65-442/+1886
In previous, we allowed the target(("arch=+v")) for a function with rv64gc build. This patch would like to support more arch options as below: * zve32x * zve32f * zve64x * zve64f * zve64d * zvfhmin * zvfh * zvk* * zvbb For example, we have sample code as below. vfloat32m1_t __attribute__((target("arch=+zve64f"))) test_9 (vfloat32m1_t a, vfloat32m1_t b, size_t vl) { return __riscv_vfadd_vv_f32m1 (a, b, vl); } It will generate the asm code when build with -O3 -march=rv64gc test_9: vsetvli zero,a0,e32,m1,ta,ma vfadd.vv v8,v8,v9 ret Meanwhile, this patch introduces more error handling for the target attribute. Take arch=+zve32x with vfloat32m1_t will have error message "'vfloat32m1_t' requires the zve32f, zve64f or zve64d ISA extension". And take arch=+zve32f with vfloat16m1_t will have error message "'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension". By default, all the RVV types includes the cmdline march will be registered when include the riscv_vector.h. And we have sorts of check during args and return types. Below test are passed for this patch: * The riscv fully regression test. gcc/ChangeLog: * config/riscv/riscv-c.cc (struct pragma_intrinsic_flags): New struct to hold all intrinisc related flags. (riscv_pragma_intrinsic_flags_pollute): New func to pollute the intrinsic flags and backup original flags. (riscv_pragma_intrinsic_flags_restore): New func to restore the flags from the backup intrinsic flags. (riscv_pragma_intrinsic): Pollute the flags and register all possible builtin types and functions, then restore and reinit. * config/riscv/riscv-protos.h (reinit_builtins): New func decl to reinit after flags pollution. (riscv_option_override): New extern func decl. * config/riscv/riscv-vector-builtins.cc (register_builtin_types_on_null): New func to register builtin types if null. (DEF_RVV_TYPE): Ditto. (DEF_RVV_TUPLE_TYPE): Ditto. (reinit_builtins): New func impl to reinit after flags pollution. (expand_builtin): Return target rtx after error_at. * config/riscv/riscv.cc (riscv_vector_int_type_p): New predicate func to tell one tree type is integer or not. (riscv_vector_float_type_p): New predicate func to tell one tree type is float or not. (riscv_vector_element_bitsize): New func to get the element bitsize of a vector tree type. (riscv_vector_required_min_vlen): New func to get the required min vlen of a vector tree type. (riscv_validate_vector_type): New func to validate the tree type is valid on flags. (riscv_return_value_is_vector_type_p): Leverage the func riscv_validate_vector_type to do the tree type validation. (riscv_arguments_is_vector_type_p): Ditto. (riscv_override_options_internal): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr109479-1.c: Adjust the existing test scenarios and add new error check tests. * gcc.target/riscv/rvv/base/pr109479-2.c: Ditto. * gcc.target/riscv/rvv/base/pr109479-3.c: Ditto. * gcc.target/riscv/rvv/base/pr109479-4.c: Diito. * gcc.target/riscv/rvv/base/pr109479-5.c: Diito. * gcc.target/riscv/rvv/base/pr109479-6.c: Diito. * gcc.target/riscv/rvv/base/user-10.c: Ditto. * gcc.target/riscv/rvv/base/user-12.c: Ditto. * gcc.target/riscv/rvv/base/user-13.c: Ditto. * gcc.target/riscv/rvv/base/user-14.c: Ditto. * gcc.target/riscv/rvv/base/user-15.c: Ditto. * gcc.target/riscv/rvv/base/user-2.c: Ditto. * gcc.target/riscv/rvv/base/user-3.c: Ditto. * gcc.target/riscv/rvv/base/user-5.c: Ditto. * gcc.target/riscv/rvv/base/user-6.c: Ditto. * gcc.target/riscv/rvv/base/user-9.c: Ditto. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-10.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-11.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-12.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-13.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-14.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-15.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-16.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-17.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-18.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-19.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-20.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-21.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-22.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-23.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-24.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-25.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-26.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-27.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-28.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-29.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-30.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-31.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-32.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-33.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-34.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-35.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-36.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-37.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-38.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-39.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-40.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-41.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-42.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-43.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-44.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-45.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-46.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-47.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-48.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-49.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-50.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-51.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-52.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-53.c: New test. * gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-9.c: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
2024-04-08LoongArch: Set default alignment for functions jumps and loops [PR112919].Lulu Cheng3-16/+36
Xi Ruoyao set the alignment rules under LA464 in commit r14-1839, but the macro ASM_OUTPUT_ALIGN_WITH_NOP was removed in R14-4674, which affected the alignment rules. So I set different aligns on LA464 and LA664 again to test the performance of spec2006, and modify the alignment based on the test results. gcc/ChangeLog: PR target/112919 * config/loongarch/loongarch-def.cc (la664_align): Newly defined function that sets alignment rules under the LA664 microarchitecture. * config/loongarch/loongarch-opts.cc (loongarch_target_option_override): If not optimizing for size, set the default alignment to what the target wants. * config/loongarch/loongarch-tune.h (struct loongarch_align): Add new member variables jump and loop.
2024-04-06PR modula2/114617 gm2 unable to resolve const expressions using relop ICEGaius Mulley12-104/+738
This patch allows cc1gm2 to resolve constant expressions which use relative operators. Previous to the patch the result of a relop was stored in a temporary variable set by an if then else quadruple sequence. This patch marks a const expression in the quadruples and then reduces this sequence of quadruples into a single assignment to an internal constant. gcc/m2/ChangeLog: PR modula2/114617 * gm2-compiler/M2GenGCC.mod (CodeStatememt): Add quad trace. (ResolveConstantExpressions): Add parameter p to FoldIfLess, FoldIfGre, FoldIfLessEqu, FoldIfGreEqu, FoldIfEqu, FoldIfNotEqu, FoldIfIn and FoldIfNotIn. (CodeInline): Add constExpr variable and pass it to GetQuadOtok. (CodeReturnValue): Ditto. (CodeParam): Ditto. (FoldStringLength): Ditto. (FoldStringConvertM2nul): Ditto. (FoldStringConvertCnul): Ditto. (DeclaredOperandsBecomes): Ditto. (TypeCheckBecomes): Ditto. (PerformFoldBecomes): Ditto. (CodeBecomes): Ditto. (CheckElementSetTypes): Ditto. (CodeBinarySet): Ditto. (PerformCodeIfLess): Ditto. (PerformCodeIfGre): Ditto. (PerformCodeIfLessEqu): Ditto. (PerformCodeIfGreEqu): Ditto. (PerformCodeIfEqu): Ditto. (PerformCodeIfNotEqu): Ditto. (IsValidExpressionRelOp): Ditto. (PerformCodeIfIn): Ditto. (PerformCodeIfNotIn): Ditto. (CodeXIndr): Ditto. (QuadCondition): New procedure function. (IsBooleanRelOpPattern): Ditto. (FoldBooleanRelopPattern): Ditto. (FoldIfGre): Check for boolean relop constant expression and add parameter p. (FoldIfLessEqu): Ditto. (FoldIfIn): Ditto. (FoldIfEqu): Ditto. (FoldIfNotIn): Ditto. (FoldIfGreEqu): New procedure. (FoldIfNotEqu): Ditto. * gm2-compiler/M2Optimize.mod (ReduceBranch): Add constExpr variable and pass it to GetQuadOtok. * gm2-compiler/M2Quads.def (IsBecomes): New procedure function. (IsDummy): Ditto. (IsQuadConstExpr): Ditto. (SetQuadConstExpr): Ditto. (GetQuadDest): New procedure. (GetQuadOp1): New procedure. (GetQuadOp2): New procedure. (GetQuadOp3): New procedure. (GetQuadOtok): New procedure. (GetQuadOTypetok): New procedure. (PutQuadOtok): New procedure. (IsInConstParameters): New procedure function. * gm2-compiler/M2Quads.mod (IsBecomes): New procedure function. (IsDummy): Ditto. (IsQuadConstExpr): Ditto. (SetQuadConstExpr): Ditto. (GetQuadDest): New procedure. (GetQuadOp1): New procedure. (GetQuadOp2): New procedure. (GetQuadOp3): New procedure. (GetQuadOtok): New procedure. (GetQuadOTypetok): New procedure. (PutQuadOtok): New procedure. (IsInConstParameters): New procedure function. (ConstStack): Remove to ... (ConstExprStack): ... this. (ConstParamStack): New variable and initialize. (QuadFrame): New field ConstExpr. (GetQuadOtok): Add parameter constExpr and assign. (PutQuadOtok): Add constExpr parameter and assign. (PutQuadOType): Ditto. (GetQuadOTypetok): Ditto. (EraseQuad): Assign ConstExpr to FALSE. (FoldSubrange): Set ConstExpr to FALSE in BecomesOp. (PushInConstParameters): New procedure. (PopInConstParameters): New procedure. (IsInConstParameters): New procedure function. * gm2-compiler/M2SymInit.mod (IssueConditional): Add constExpr boolean variable. (CheckReadBeforeInitQuad): Ditto. (trashParam): Ditto. * gm2-compiler/P3Build.bnf (ConstExpression): Call PushInConstExpression and PopInConstExpression. (ConstSetOrQualidentOrFunction): Call PushInConstParameters and PopInConstParameters. * gm2-compiler/PCBuild.bnf (ConstExpression): Call PushInConstExpression and PopInConstExpression. * gm2-compiler/PHBuild.bnf: Ditto * gm2-gcc/m2expr.cc (m2expr_BuildCondIfExpression): New function. * gm2-gcc/m2expr.def (BuildCondIfExpression): New prototype. * gm2-gcc/m2expr.h (m2expr_BuildCondIfExpression): New function. gcc/testsuite/ChangeLog: PR modula2/114617 * gm2/iso/const/pass/iso-const-pass.exp: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-04-06libfortran: Fix handling of formatted separators.Jerry DeLisle2-2/+116
PR libfortran/114304 PR libfortran/105473 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Add logic to handle spaces preceding a comma or semicolon such that that a 'null' read occurs without error at the end of comma or semicolon terminated input lines. Add check and error message for ';'. (list_formatted_read_scalar): Treat comma as a decimal point when specified by the decimal mode on the first item. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Modify to verify new error message. * gfortran.dg/pr114304.f90: New test.
2024-04-06d: Merge upstream dmd, druntime b65767825f, phobos 92dc5a4e9.Iain Buclaw2-2/+2
Synchronizing with the upstream release of v2.108.0. D front-end changes: - Import dmd v2.108.0. D runtime changes: - Import druntime v2.108.0. Phobos changes: - Import phobos v2.108.0. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd b65767825f. * dmd/VERSION: Bump version to v2.108.0. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime b65767825f. * src/MERGE: Merge upstream phobos 92dc5a4e9.
2024-04-06x86: Use explicit shift count in double-precision shiftsH.J. Lu1-8/+8
Don't use implicit shift count in double-precision shifts in AT&T syntax since they aren't in Intel SDM. Keep the 's' modifier for backward compatibility with inline asm statements. PR target/114590 * config/i386/i386.md (x86_64_shld): Use explicit shift count in AT&T syntax. (x86_64_shld_ndd): Likewise. (x86_shld): Likewise. (x86_shld_ndd): Likewise. (x86_64_shrd): Likewise. (x86_64_shrd_ndd): Likewise. (x86_shrd): Likewise. (x86_shrd_ndd): Likewise.
2024-04-06Copy condition->expr map when inlining [PR114599]Jørgen Kvalsvik2-1/+44
When a function is tree-inlined, copy the condition -> expression mapping from the inlined function into the caller, shifted so uids are not mixed. Tree inlining was always problematic under condition coverage - either through a nullptr dereference (triggered by the test case), or through quietly mixing caller conditions with the callee conditions. PR middle-end/114599 gcc/ChangeLog: * tree-inline.cc (add_local_variables): Copy cond_uids mappings. gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-pr114599.c: New test.
2024-04-06Remove unecessary and broken MC/DC compile testJørgen Kvalsvik1-11/+0
The __sigsetjmp test was added as a regression test in an early iteration of the MC/DC support, as it caused an internal compiler error. This was triggered by a code path which did not make it through to the final revision. Since this test really only worked on systems with __sigsetjmp, and does not serve a purpose any more it can be removed. gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-19.c: Remove test.
2024-04-05analyzer: respect GCC_COLORS in out-of-bounds diagrams [PR114588]David Malcolm5-7/+33
gcc/analyzer/ChangeLog: PR analyzer/114588 * access-diagram.cc (access_diagram_impl::access_diagram_impl): Replace hardcoded colors for valid_style and invalid_style with calls to text_art::get_style_from_color_cap_name. gcc/ChangeLog: PR analyzer/114588 * diagnostic-color.cc (color_dict): Add "valid" and "invalid" as color capability names. * doc/invoke.texi: Document them in description of GCC_COLORS. * text-art/style.cc: Include "diagnostic-color.h". (text_art::get_style_from_color_cap_name): New. * text-art/types.h (get_style_from_color_cap_name): New decl. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-04-05testsuite, Darwin: Account for block labels in function body scans.Iain Sandoe1-1/+1
When we have '-O3 -g' we emit a bunch of LB{B,E} local labels which were not currently being discarded, leading to some test fails. Fixed by adding this case to the ignored labels. gcc/testsuite/ChangeLog: * lib/scanasm.exp: Add 'LB*' to the local labels that are ignored for Darwin. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-05c++: add fixed test [PR91079]Marek Polacek1-0/+13
Fixed by r12-2975. PR c++/91079 DR 1881 gcc/testsuite/ChangeLog: * g++.dg/ext/is_std_layout5.C: New test.
2024-04-05aarch64: Fix whitespace in aarch64-ldp-fusion.cc:alias_walkerAlex Coplan1-1/+1
I spotted this whitespace error during the review of https://gcc.gnu.org/pipermail/gcc-patches/2024-April/648846.html gcc/ChangeLog: * config/aarch64/aarch64-ldp-fusion.cc (struct alias_walker): Fix double space after const qualifier on valid ().
2024-04-05ipa: Force args obtined through pass-through maps to the expected type (PR ↵Martin Jambor2-0/+37
113964) Interactions of IPA-CP and IPA-SRA on the same data is a rather big source of issues, I'm afraid. PR 113964 is a situation where IPA-CP propagates an unsigned short in a union parameter into a function which itself calls a different function which has a same union parameter and both these union parameters are split with IPA-SRA. The leaf function however uses a signed short member of the union. In the calling function, we get the unsigned constant as the replacement for the union and it is then passed in the call without any type compatibility checks. Apparently on riscv64 it matters whether the parameter is signed or unsigned short and so the leaf function can see different values. Fixed by using useless_type_conversion_p at the appropriate place and if it fails, use force_value_to type as elsewhere in similar situations. gcc/ChangeLog: 2024-04-04 Martin Jambor <mjambor@suse.cz> PR ipa/113964 * ipa-param-manipulation.cc (ipa_param_adjustments::modify_call): Force values obtined through pass-through maps to the expected split type. gcc/testsuite/ChangeLog: 2024-04-04 Patrick O'Neill <patrick@rivosinc.com> Martin Jambor <mjambor@suse.cz> PR ipa/113964 * gcc.dg/ipa/pr114247.c: New test.
2024-04-05Regenerate common.opt.urlsMark Wielaard1-0/+6
The new support for gcov modified condition/decision coverage introduced two new flags for gcc, -Wcoverage-too-many-conditions and -fcondition-coverage. But didn't regenerate the gcc/common.opt.urls. Fixes: 08a52331803f ("Add condition coverage (MC/DC)") gcc/ChangeLog: * common.opt.urls: Regenerate.
2024-04-05aarch64: Fix bogus cnot optimisation [PR114603]Richard Sandiford3-20/+50
aarch64-sve.md had a pattern that combined: cmpeq pb.T, pa/z, zc.T, #0 mov zd.T, pb/z, #1 into: cnot zd.T, pa/m, zc.T But this is only valid if pa.T is a ptrue. In other cases, the original would set inactive elements of zd.T to 0, whereas the combined form would copy elements from zc.T. gcc/ PR target/114603 * config/aarch64/aarch64-sve.md (@aarch64_pred_cnot<mode>): Replace with... (@aarch64_ptrue_cnot<mode>): ...this, requiring operand 1 to be a ptrue. (*cnot<mode>): Require operand 1 to be a ptrue. * config/aarch64/aarch64-sve-builtins-base.cc (svcnot_impl::expand): Use aarch64_ptrue_cnot<mode> for _x operations that are predicated with a ptrue. Represent other _x operations as fully-defined _m operations. gcc/testsuite/ PR target/114603 * gcc.target/aarch64/sve/acle/general/cnot_1.c: New test.
2024-04-05c-family: remove dead #undefMarek Polacek1-1/+0
The #undef was added in r0-90320-g100d537d7a7b5c but it never did anything. gcc/c-family/ChangeLog: * c-warn.cc (warn_about_parentheses): Remove an #undef.