Skip to content
Snippets Groups Projects
  1. Aug 23, 2023
  2. Aug 22, 2023
    • Juzhe-Zhong's avatar
      RISC-V: Clang format riscv-vsetvl.cc[NFC] · 10a7d31d
      Juzhe-Zhong authored
      Commited.
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc (change_insn): Clang format.
      	(vector_infos_manager::all_same_ratio_p): Ditto.
      	(vector_infos_manager::all_same_avl_p): Ditto.
      	(pass_vsetvl::refine_vsetvls): Ditto.
      	(pass_vsetvl::cleanup_vsetvls): Ditto.
      	(pass_vsetvl::commit_vsetvls): Ditto.
      	(pass_vsetvl::local_eliminate_vsetvl_insn): Ditto.
      	(pass_vsetvl::global_eliminate_vsetvl_insn): Ditto.
      	(pass_vsetvl::compute_probabilities): Ditto.
      10a7d31d
    • Juzhe-Zhong's avatar
      RISC-V: Add riscv-vsetvl.def to t-riscv · b817bfad
      Juzhe-Zhong authored
      This patch will be backport to GCC 13 and commit to trunk.
      gcc/ChangeLog:
      
      	* config/riscv/t-riscv: Add riscv-vsetvl.def
      b817bfad
    • Francois-Xavier Coudert's avatar
      libgomp, testsuite: Do not call nonstandard functions · 0ccfbe64
      Francois-Xavier Coudert authored
      The following functions are not standard, and not always available
      (e.g., on darwin). They should not be called unless available: gamma,
      gammaf, scalb, scalbf, significand, and significandf.
      
      libgomp/ChangeLog:
      
      	* testsuite/lib/libgomp.exp: Add effective target.
      	* testsuite/libgomp.c/simd-math-1.c: Avoid calling nonstandard
      	functions.
      0ccfbe64
    • David Malcolm's avatar
      analyzer: reimplement kf_strlen [PR105899] · 3242fb53
      David Malcolm authored
      
      Reimplement kf_strlen in terms of the new string scanning
      implementation, sharing strlen's implementation with
      __analyzer_get_strlen.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/105899
      	* kf-analyzer.cc (class kf_analyzer_get_strlen): Move to kf.cc.
      	(register_known_analyzer_functions): Use make_kf_strlen.
      	* kf.cc (class kf_strlen::impl_call_pre): Replace with
      	implementation of kf_analyzer_get_strlen from kf-analyzer.cc.
      	Handle "UNKNOWN" return from check_for_null_terminated_string_arg
      	by falling back to a conjured svalue.
      	(make_kf_strlen): New.
      	(register_known_functions): Use make_kf_strlen.
      	* known-function-manager.h (make_kf_strlen): New decl.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/105899
      	* gcc.dg/analyzer/null-terminated-strings-1.c: Update expected
      	results on symbolic values.
      	* gcc.dg/analyzer/strlen-1.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      3242fb53
    • Jason Merrill's avatar
      c++: maybe_substitute_reqs_for fix · f40d24cd
      Jason Merrill authored
      While working on PR109751 I found that maybe_substitute_reqs_for was doing
      the wrong thing for a non-template friend, substituting in the template args
      of the scope's original template rather than those of the instantiation.
      This didn't end up being necessary to fix the PR, but it's still an
      improvement.
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (outer_template_args): Handle non-template argument.
      	* constraint.cc (maybe_substitute_reqs_for): Pass decl to it.
      	* cp-tree.h (outer_template_args): Adjust.
      f40d24cd
    • Jason Merrill's avatar
      c++: constrained hidden friends [PR109751] · 810bcc00
      Jason Merrill authored
      r13-4035 avoided a problem with overloading of constrained hidden friends by
      checking satisfaction, but checking satisfaction early is inconsistent with
      the usual late checking and can lead to hard errors, so let's not do that
      after all.
      
      We were wrongly treating the different instantiations of the same friend
      template as the same function because maybe_substitute_reqs_for was failing
      to actually substitute in the case of a non-template friend.  But we don't
      actually need to do the substitution anyway, because [temp.friend] says that
      such a friend can't be the same as any other declaration.
      
      After fixing that, instead of a redefinition error we got an ambiguous
      overload error, fixed by allowing constrained hidden friends to coexist
      until overload resolution, at which point they probably won't be in the same
      ADL overload set anyway.
      
      And we avoid mangling collisions by following the proposed mangling for
      these friends as a member function with an extra 'F' before the name.  I
      demangle this by just adding [friend] to the name of the function because
      it's not feasible to reconstruct the actual scope of the function since the
      mangling ABI doesn't distinguish between class and namespace scopes.
      
      	PR c++/109751
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (member_like_constrained_friend_p): Declare.
      	* decl.cc (member_like_constrained_friend_p): New.
      	(function_requirements_equivalent_p): Check it.
      	(duplicate_decls): Check it.
      	(grokfndecl): Check friend template constraints.
      	* mangle.cc (decl_mangling_context): Check it.
      	(write_unqualified_name): Check it.
      	* pt.cc (uses_outer_template_parms_in_constraints): Fix for friends.
      	(tsubst_friend_function): Don't check satisfaction.
      
      include/ChangeLog:
      
      	* demangle.h (enum demangle_component_type): Add
      	DEMANGLE_COMPONENT_FRIEND.
      
      libiberty/ChangeLog:
      
      	* cp-demangle.c (d_make_comp): Handle DEMANGLE_COMPONENT_FRIEND.
      	(d_count_templates_scopes): Likewise.
      	(d_print_comp_inner): Likewise.
      	(d_unqualified_name): Handle member-like friend mangling.
      	* testsuite/demangle-expected: Add test.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/concepts-friend11.C: Now works.  Add template.
      	* g++.dg/cpp2a/concepts-friend15.C: New test.
      810bcc00
    • Vineet Gupta's avatar
      RISC-V: output Autovec params explicitly in --help ... · 3571cc93
      Vineet Gupta authored
      
      ... otherwise user has no clue what -param to actually change
      
      gcc/ChangeLog:
      	* config/riscv/riscv.opt: Add --param names
      	riscv-autovec-preference and riscv-autovec-lmul
      
      Signed-off-by: default avatarVineet Gupta <vineetg@rivosinc.com>
      3571cc93
    • Raphael Moreira Zinsly's avatar
      RISC-V: Add multiarch support on riscv-linux-gnu · 47f95bc4
      Raphael Moreira Zinsly authored
      This adds multiarch support to the RISC-V port so that bootstraps work with
      Debian out-of-the-box.  Without this patch the stage1 compiler is unable to
      find headers/libraries when building the stage1 runtime.
      
      This is functionally (and possibly textually) equivalent to Debian's fix for
      the same problem.
      
      gcc/
      	* config/riscv/t-linux: Add MULTIARCH_DIRNAME.
      47f95bc4
    • Tobias Burnus's avatar
      OpenMP: Handle 'all' as category in defaultmap · 0698c9fd
      Tobias Burnus authored
      Both, specifying no category and specifying 'all', implies
      that the implicit-behavior applies to all categories.
      
      gcc/c/ChangeLog:
      
      	* c-parser.cc (c_parser_omp_clause_defaultmap): Parse
      	'all' as category.
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (cp_parser_omp_clause_defaultmap): Parse
      	'all' as category.
      
      gcc/fortran/ChangeLog:
      
      	* gfortran.h (enum gfc_omp_defaultmap_category):
      	Add OMP_DEFAULTMAP_CAT_ALL.
      	* openmp.cc (gfc_match_omp_clauses): Parse
      	'all' as category.
      	* trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
      
      gcc/ChangeLog:
      
      	* tree-core.h (enum omp_clause_defaultmap_kind): Add
      	OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALL.
      	* gimplify.cc (gimplify_scan_omp_clauses): Handle it.
      	* tree-pretty-print.cc (dump_omp_clause): Likewise.
      
      libgomp/ChangeLog:
      
      	* libgomp.texi (OpenMP 5.2 status): Add depobj with
      	destroy-var argument as 'N'. Mark defaultmap with
      	'all' category as 'Y'.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/defaultmap-1.f90: Update dg-error.
      	* c-c++-common/gomp/defaultmap-5.c: New test.
      	* c-c++-common/gomp/defaultmap-6.c: New test.
      	* gfortran.dg/gomp/defaultmap-10.f90: New test.
      	* gfortran.dg/gomp/defaultmap-9.f90: New test.
      0698c9fd
    • Jakub Jelinek's avatar
      doc: Remove obsolete sentence about _Float* not being supported in C++ [PR106652] · 145da6a8
      Jakub Jelinek authored
      As mentioned in the PR, these types are supported in C++ since GCC 13,
      so we shouldn't confuse users.
      
      2023-08-22  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/106652
      	* doc/extend.texi (_Float<n>): Drop obsolete sentence that the
      	types aren't supported in C++.
      145da6a8
    • Juzhe-Zhong's avatar
      VECT: Add LEN_FOLD_EXTRACT_LAST pattern · f4658e02
      Juzhe-Zhong authored
      Hi, Richard and Richi.
      
      This is the last autovec pattern I want to add for RVV (length loop control).
      
      This patch is supposed to handled this following case:
      
      int __attribute__ ((noinline, noclone))
      condition_reduction (int *a, int min_v, int n)
      {
        int last = 66; /* High start value.  */
      
        for (int i = 0; i < n; i++)
          if (a[i] < min_v)
            last = i;
      
        return last;
      }
      
      ARM SVE IR:
      
        ...
        mask__7.11_39 = vect__4.10_37 < vect_cst__38;
        _40 = loop_mask_36 & mask__7.11_39;
        last_5 = .FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32);
        ...
      
      RVV IR, we want to see:
       ...
       loop_len = SELECT_VL
       mask__7.11_39 = vect__4.10_37 < vect_cst__38;
       last_5 = .LEN_FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32, loop_len, bias);
       ...
      
      gcc/ChangeLog:
      
      	* doc/md.texi: Add LEN_FOLD_EXTRACT_LAST pattern.
      	* internal-fn.cc (fold_len_extract_direct): Ditto.
      	(expand_fold_len_extract_optab_fn): Ditto.
      	(direct_fold_len_extract_optab_supported_p): Ditto.
      	* internal-fn.def (LEN_FOLD_EXTRACT_LAST): Ditto.
      	* optabs.def (OPTAB_D): Ditto.
      f4658e02
    • Richard Biener's avatar
      Simplify intereaved store vectorization processing · 2c27600f
      Richard Biener authored
      When doing interleaving we perform code generation when visiting the
      last store of a chain.  We keep track of this via DR_GROUP_STORE_COUNT,
      the following localizes this to the caller of vectorizable_store,
      also avoing redundant non-processing of the other stores.
      
      	* tree-vect-stmts.cc (vectorizable_store): Do not bump
      	DR_GROUP_STORE_COUNT here.  Remove early out.
      	(vect_transform_stmt): Only call vectorizable_store on
      	the last element of an interleaving chain.
      2c27600f
    • Filip Kastl's avatar
      MAINTAINERS: Update my email address · 9e5b47b4
      Filip Kastl authored
      
      Signed-off-by: default avatarFilip Kastl <fkastl@suse.cz>
      
      ChangeLog:
      
      	* MAINTAINERS: Update my email address.
      9e5b47b4
    • Richard Biener's avatar
      tree-optimization/94864 - vector insert of vector extract simplification · 27de9aa1
      Richard Biener authored
      The PRs ask for optimizing of
      
        _1 = BIT_FIELD_REF <b_3(D), 64, 64>;
        result_4 = BIT_INSERT_EXPR <a_2(D), _1, 64>;
      
      to a vector permutation.  The following implements this as
      match.pd pattern, improving code generation on x86_64.
      
      On the RTL level we face the issue that backend patterns inconsistently
      use vec_merge and vec_select of vec_concat to represent permutes.
      
      I think using a (supported) permute is almost always better
      than an extract plus insert, maybe excluding the case we extract
      element zero and that's aliased to a register that can be used
      directly for insertion (not sure how to query that).
      
      The patch FAILs one case in gcc.target/i386/avx512fp16-vmovsh-1a.c
      where we now expand from
      
       __A_28 = VEC_PERM_EXPR <x2.8_9, x1.9_10, { 0, 9, 10, 11, 12, 13, 14, 15 }>;
      
      instead of
      
       _28 = BIT_FIELD_REF <x2.8_9, 16, 0>;
       __A_29 = BIT_INSERT_EXPR <x1.9_10, _28, 0>;
      
      producing a vpblendw instruction instead of the expected vmovsh.  That's
      either a missed vec_perm_const expansion optimization or even better,
      an improvement - Zen4 for example has 4 ports to execute vpblendw
      but only 3 for executing vmovsh and both instructions have the same size.
      
      The patch XFAILs the sub-testcase.
      
      	PR tree-optimization/94864
      	PR tree-optimization/94865
      	PR tree-optimization/93080
      	* match.pd (bit_insert @0 (BIT_FIELD_REF @1 ..) ..): New pattern
      	for vector insertion from vector extraction.
      
      	* gcc.target/i386/pr94864.c: New testcase.
      	* gcc.target/i386/pr94865.c: Likewise.
      	* gcc.target/i386/avx512fp16-vmovsh-1a.c: XFAIL.
      	* gcc.dg/tree-ssa/forwprop-40.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-41.c: Likewise.
      27de9aa1
    • Harald Anlauf's avatar
      Fortran: implement vector sections in DATA statements [PR49588] · d3b5a1bc
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/49588
      	* data.cc (gfc_advance_section): Derive next index set and next offset
      	into DATA variable also for array references using vector sections.
      	Use auxiliary array to keep track of offsets into indexing vectors.
      	(gfc_get_section_index): Set up initial indices also for DATA variables
      	with array references using vector sections.
      	* data.h (gfc_get_section_index): Adjust prototype.
      	(gfc_advance_section): Likewise.
      	* resolve.cc (check_data_variable): Pass vector offsets.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/49588
      	* gfortran.dg/data_vector_section.f90: New test.
      d3b5a1bc
    • Juzhe-Zhong's avatar
      VECT: Support loop len control on EXTRACT_LAST vectorization · c27f0626
      Juzhe-Zhong authored
      
      Hi, @Richi and @Richard, base on previous disscussion, I simpily fix issuses for
      powerpc and s390 with your suggestions:
      
      -  machine_mode len_load_mode = get_len_load_store_mode
      -    (loop_vinfo->vector_mode, true).require ();
      -  machine_mode len_store_mode = get_len_load_store_mode
      -    (loop_vinfo->vector_mode, false).require ();
      +  machine_mode len_load_mode, len_store_mode;
      +  if (!get_len_load_store_mode (loop_vinfo->vector_mode, true)
      +        .exists (&len_load_mode))
      +    return false;
      +  if (!get_len_load_store_mode (loop_vinfo->vector_mode, false)
      +        .exists (&len_store_mode))
      +    return false;
      
      Co-Authored-By: default avatarKewen.Lin <linkw@linux.ibm.com>
      
      gcc/ChangeLog:
      
      	* tree-vect-loop.cc (vect_verify_loop_lens): Add exists check.
      	(vectorizable_live_operation): Add live vectorization for length loop
      	control.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/partial/live-1.c: New test.
      	* gcc.target/riscv/rvv/autovec/partial/live_run-1.c: New test.
      c27f0626
    • liuhongt's avatar
      Testcase fix. · 710d54f4
      liuhongt authored
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/invariant-ternlog-1.c: Only scan %rdx under
      	TARGET_64BIT.
      710d54f4
    • Lehua Ding's avatar
      RISC-V: Change fnms testcases assertion to xfail · eaabae8e
      Lehua Ding authored
      Hi,
      
      This patch fixes inappropriate assertions in fnms testcases since
      we want to generate .COND_FNMS but actually generate .FNMS + .VCOND_MASK.
      A patch to do this optimization will follow.
      
      Best,
      Lehua
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-1.c: Adjust.
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-2.c: Ditto.
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-3.c: Ditto.
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-4.c: Ditto.
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-5.c: Ditto.
      	* gcc.target/riscv/rvv/autovec/cond/cond_fms_fnms-6.c: Ditto.
      eaabae8e
    • David Malcolm's avatar
      analyzer: check format strings for null termination [PR105899] · 3b691e01
      David Malcolm authored
      
      This patch extends -fanalyzer to check the format strings of calls
      to functions marked with '__attribute__ ((format...))'.
      
      The only checking done in this patch is to check that the format string
      is a valid null-terminated string; this patch doesn't attempt to check
      the content of the format string.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/105899
      	* call-details.cc (call_details::call_details): New ctor.
      	* call-details.h (call_details::call_details): New ctor decl.
      	(struct call_arg_details): Move here from region-model.cc.
      	* region-model.cc (region_model::check_call_format_attr): New.
      	(region_model::check_call_args): Call it.
      	(struct call_arg_details): Move it to call-details.h.
      	* region-model.h (region_model::check_call_format_attr): New decl.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/105899
      	* gcc.dg/analyzer/attr-format-1.c: New test.
      	* gcc.dg/analyzer/sprintf-1.c: Update expected results for
      	now-passing tests.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      3b691e01
    • David Malcolm's avatar
      analyzer: add kf_fopen · 4325c827
      David Malcolm authored
      
      Add checking to -fanalyzer that both params of calls to "fopen" are
      valid null-terminated strings.
      
      gcc/analyzer/ChangeLog:
      	* kf.cc (class kf_fopen): New.
      	(register_known_functions): Register it.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/analyzer/fopen-1.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      4325c827
    • David Malcolm's avatar
      analyzer: replace -Wanalyzer-unterminated-string with scan_for_null_terminator [PR105899] · fe97f09a
      David Malcolm authored
      
      In r14-3169-g325f9e88802daa I added check_for_null_terminated_string_arg
      to -fanalyzer, calling it in various places, with a sole check for
      unterminated string constants, adding -Wanalyzer-unterminated-string for
      this case.
      
      This patch adds region_model::scan_for_null_terminator, which simulates
      scanning memory for a zero byte, complaining about uninitiliazed bytes
      and out-of-range accesses seen before any zero byte is seen.
      
      This more flexible approach catches the issues we saw before with
      -Wanalyzer-unterminated-string, and also catches uninitialized runs
      of bytes, and I believe will be a better way to build checking of C
      string operations in the analyzer.
      
      Given that the patch makes -Wanalyzer-unterminated-string redundant
      and that this option was only in trunk for 10 days and has no known
      users, the patch simply removes the option without a compatibility
      fallback.
      
      The patch uses custom events and notes to provide context on where
      the issues are coming from.  For example, given:
      
      null-terminated-strings-1.c: In function ‘test_partially_initialized’:
      null-terminated-strings-1.c:71:3: warning: use of uninitialized value ‘buf[1]’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
         71 |   __analyzer_get_strlen (buf);
            |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
        ‘test_partially_initialized’: events 1-3
          |
          |   69 |   char buf[16];
          |      |        ^~~
          |      |        |
          |      |        (1) region created on stack here
          |   70 |   buf[0] = 'a';
          |   71 |   __analyzer_get_strlen (buf);
          |      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |      |   |
          |      |   (2) while looking for null terminator for argument 1 (‘&buf’) of ‘__analyzer_get_strlen’...
          |      |   (3) use of uninitialized value ‘buf[1]’ here
          |
      analyzer-decls.h:59:22: note: argument 1 of ‘__analyzer_get_strlen’ must be a pointer to a null-terminated string
         59 | extern __SIZE_TYPE__ __analyzer_get_strlen (const char *ptr);
            |                      ^~~~~~~~~~~~~~~~~~~~~
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/105899
      	* analyzer.opt (Wanalyzer-unterminated-string): Delete.
      	* call-details.cc
      	(call_details::check_for_null_terminated_string_arg): Convert
      	return type from void to const svalue *.  Add param "out_sval".
      	* call-details.h
      	(call_details::check_for_null_terminated_string_arg): Likewise.
      	* kf-analyzer.cc (kf_analyzer_get_strlen::impl_call_pre): Wire up
      	to result of check_for_null_terminated_string_arg.
      	* region-model.cc (get_strlen): Delete.
      	(class unterminated_string_arg): Delete.
      	(struct fragment): New.
      	(class iterable_cluster): New.
      	(region_model::get_store_bytes): New.
      	(get_tree_for_byte_offset): New.
      	(region_model::scan_for_null_terminator): New.
      	(region_model::check_for_null_terminated_string_arg): Convert
      	return type from void to const svalue *.  Add param "out_sval".
      	Reimplement in terms of scan_for_null_terminator, dropping the
      	special-case for -Wanalyzer-unterminated-string.
      	* region-model.h (region_model::get_store_bytes): New decl.
      	(region_model::scan_for_null_terminator): New decl.
      	(region_model::check_for_null_terminated_string_arg): Convert
      	return type from void to const svalue *.  Add param "out_sval".
      	* store.cc (concrete_binding::get_byte_range): New.
      	* store.h (concrete_binding::get_byte_range): New decl.
      	(store_manager::get_concrete_binding): New overload.
      
      gcc/ChangeLog:
      	PR analyzer/105899
      	* doc/invoke.texi: Remove -Wanalyzer-unterminated-string.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/105899
      	* gcc.dg/analyzer/error-1.c: Update expected results to reflect
      	reimplementation of unterminated string detection.  Add test
      	coverage for uninitialized buffers.
      	* gcc.dg/analyzer/null-terminated-strings-1.c: Likewise.
      	* gcc.dg/analyzer/putenv-1.c: Likewise.
      	* gcc.dg/analyzer/strchr-1.c: Likewise.
      	* gcc.dg/analyzer/strcpy-1.c: Likewise.
      	* gcc.dg/analyzer/strdup-1.c: Likewise.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      fe97f09a
    • David Malcolm's avatar
      analyzer: handle NULL inner context in region_model_context_decorator · 1e7b0a5d
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	* region-model.cc (region_model_context_decorator::add_event):
      	Handle m_inner being NULL.
      	* region-model.h (class region_model_context_decorator): Likewise.
      	(annotating_context::warn): Likewise.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      1e7b0a5d
    • David Malcolm's avatar
      analyzer: add ability for context to add events to a saved_diagnostic · 2503dd59
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	* diagnostic-manager.cc (saved_diagnostic::add_event): New.
      	(saved_diagnostic::add_any_saved_events): New.
      	(diagnostic_manager::add_event): New.
      	(dedupe_winners::emit_best): New.
      	(diagnostic_manager::emit_saved_diagnostic): Make "sd" param
      	non-const.  Call saved_diagnostic::add_any_saved_events.
      	* diagnostic-manager.h (saved_diagnostic::add_event): New decl.
      	(saved_diagnostic::add_any_saved_events): New decl.
      	(saved_diagnostic::m_saved_events): New field.
      	(diagnostic_manager::add_event): New decl.
      	(diagnostic_manager::emit_saved_diagnostic): Make "sd" param
      	non-const.
      	* engine.cc (impl_region_model_context::add_event): New.
      	* exploded-graph.h (impl_region_model_context::add_event): New decl.
      	* region-model.cc
      	(noop_region_model_context::add_event): New.
      	(region_model_context_decorator::add_event): New.
      	* region-model.h (region_model_context::add_event): New vfunc.
      	(noop_region_model_context::add_event): New decl.
      	(region_model_context_decorator::add_event): New decl.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      2503dd59
    • David Malcolm's avatar
      analyzer: convert note_adding_context to annotating_context · e40a935d
      David Malcolm authored
      
      This is enabling work towards the context being able to inject
      events into diagnostic paths, rather than just notes after the
      warning.
      
      gcc/analyzer/ChangeLog:
      	* region-model.cc
      	(class check_external_function_for_access_attr::annotating_ctxt):
      	Convert to an annotating_context.
      	* region-model.h (class note_adding_context): Rename to...
      	(class annotating_context): ...this, updating the "warn" method.
      	(note_adding_context::make_note): Replace with...
      	(annotating_context::add_annotations): ...this.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      e40a935d
    • GCC Administrator's avatar
      Daily bump. · 5f557210
      GCC Administrator authored
      5f557210
    • Pan Li's avatar
      RISC-V: Support RVV VFWREDUSUM.VS rounding mode intrinsic API · 1d17e3d6
      Pan Li authored
      
      This patch would like to support the rounding mode API for the
      VFWREDUSUM.VS as the below samples
      
      * __riscv_vfwredusum_vs_f32m1_f64m1_rm
      * __riscv_vfwredusum_vs_f32m1_f64m1_rm_m
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vector-builtins-bases.cc
      	(vfwredusum_frm_obj): New declaration.
      	(BASE): Ditto.
      	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
      	* config/riscv/riscv-vector-builtins-functions.def
      	(vfwredusum_frm): New intrinsic function def.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/float-point-wredusum.c: New test.
      1d17e3d6
  3. Aug 21, 2023
    • David Faust's avatar
      bpf: neg instruction does not accept an immediate · e2c42860
      David Faust authored
      The BPF virtual machine does not support neg nor neg32 instructions with
      an immediate.
      
      The erroneous instructions were removed from binutils:
      https://sourceware.org/pipermail/binutils/2023-August/129135.html
      
      Change the define_insn so that an immediate cannot be accepted.
      
      From testing, a neg-immediate was probably never chosen over a
      mov-immediate anyway.
      
      gcc/
      
      	* config/bpf/bpf.md (neg): Second operand must be a register.
      e2c42860
    • Edwin Lu's avatar
      [PATCH] RISC-V: Add Types to Missing Bitmanip Instructions · 36788c9f
      Edwin Lu authored
      This patch updates the bitmanip instructions to ensure that no insn is left
      without a type attribute. Updates a total of 8 insns to have type "bitmanip"
      
      Tested for regressions using rv32/64 multilib with newlib/linux.
      
      gcc/Changelog:
      
      	* config/riscv/bitmanip.md: Added bitmanip type to insns
      	that are missing types.
      36788c9f
    • Thiago Jung Bauermann's avatar
      Remove XFAIL from gcc/testsuite/gcc.dg/unroll-7.c · b369f0ba
      Thiago Jung Bauermann authored
      This test passes since commit e4110308 "Fix undefined behaviour in
      profile_count::differs_from_p", so remove the xfail annotation.
      
      Tested on aarch64-linux-gnu, armv8l-linux-gnueabihf and x86_64-linux-gnu.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/unroll-7.c: Remove xfail.
      b369f0ba
    • Jeff Law's avatar
      [RISCV][committed] Remove spurious newline in ztso sequence · 39491441
      Jeff Law authored
      amo-table-ztso-load-3 the coordination branch after merging up the Ztso changes
      due to a spurious newline in the output causing scan-function-body to fail.
      There's probably an over-zealous .* or similar regexp in the framework.  I
      didn't see it in a quick scan, but could have easily missed it.
      
      Regardless, fixing the extraneous newline is easy :-)
      
      gcc/
      	* config/riscv/sync-ztso.md (atomic_load_ztso<mode>): Avoid extraenous
      	newline.
      39491441
    • Francois-Xavier Coudert's avatar
      aarch64: fix format specifier · 04eea1ec
      Francois-Xavier Coudert authored
      gcc/ChangeLog:
      
      	* config/aarch64/falkor-tag-collision-avoidance.cc (dump_insn_list):
      	Fix format specifier.
      04eea1ec
    • Aldy Hernandez's avatar
      [frange] Return false if nothing changed in union_nans(). · f9ff6fa5
      Aldy Hernandez authored
      When one operand is a known NAN, we always return TRUE from
      union_nans(), even if no change occurred.  This patch fixes the
      oversight.
      
      gcc/ChangeLog:
      
      	* value-range.cc (frange::union_nans): Return false if nothing
      	changed.
      	(range_tests_floats): New test.
      f9ff6fa5
    • Tsukasa OI's avatar
      [PATCH 2/2] RISC-V: Add quotes to #error messages (all) · ab7de14e
      Tsukasa OI authored
      From: Tsukasa OI <research_trasio@irq.a4lg.com>
      
      In commit 1aaf3a64 ("[PATCH] RISC-V: Deduplicate #error messages in
      testsuite"), the author made a mistake to miss the test after adding
      quotes around extension names.  To avoid future errors and for consistency
      with other #error uses in the RISC-V testsuite, this commit quotes all
      unquoted #error messages.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/xtheadba.c: Quote unquoted #error message.
      	* gcc.target/riscv/xtheadbb.c: Ditto.
      	* gcc.target/riscv/xtheadbs.c: Ditto.
      	* gcc.target/riscv/xtheadcmo.c: Ditto.
      	* gcc.target/riscv/xtheadcondmov.c: Ditto.
      	* gcc.target/riscv/xtheadfmemidx.c: Ditto.
      	* gcc.target/riscv/xtheadfmv.c: Ditto.
      	* gcc.target/riscv/xtheadint.c: Ditto.
      	* gcc.target/riscv/xtheadmac.c: Ditto.
      	* gcc.target/riscv/xtheadmemidx.c: Ditto.
      	* gcc.target/riscv/xtheadmempair.c: Ditto.
      	* gcc.target/riscv/xtheadsync.c: Ditto.
      	* gcc.target/riscv/zawrs.c: Ditto.
      	* gcc.target/riscv/zvbb.c: Ditto.
      	* gcc.target/riscv/zvbc.c: Ditto.
      	* gcc.target/riscv/zvkg.c: Ditto.
      	* gcc.target/riscv/zvkned.c: Ditto.
      	* gcc.target/riscv/zvknha.c: Ditto.
      	* gcc.target/riscv/zvknhb.c: Ditto.
      	* gcc.target/riscv/zvksed.c: Ditto.
      	* gcc.target/riscv/zvksh.c: Ditto.
      	* gcc.target/riscv/zvkt.c: Ditto.
      ab7de14e
    • Tsukasa OI's avatar
      [PATCH 1/2] RISC-V: Add quotes to #error messages · 56c28ce7
      Tsukasa OI authored
      In commit 1aaf3a64 ("[PATCH] RISC-V: Deduplicate #error messages in
      testsuite"), the author made a mistake to miss the test after adding
      quotes around extension names.  To avoid future errors and for consistency
      with other #error uses in the RISC-V testsuite, this commit quotes #error
      messages where necessary to avoid current test case failures.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/zvkn.c: Quote #error messages.
      	* gcc.target/riscv/zvkn-1.c: Ditto.
      	* gcc.target/riscv/zvknc.c: Ditto.
      	* gcc.target/riscv/zvknc-1.c: Ditto.
      	* gcc.target/riscv/zvknc-2.c: Ditto.
      	* gcc.target/riscv/zvkng.c: Ditto.
      	* gcc.target/riscv/zvkng-1.c: Ditto.
      	* gcc.target/riscv/zvkng-2.c: Ditto.
      	* gcc.target/riscv/zvks.c: Ditto.
      	* gcc.target/riscv/zvks-1.c: Ditto.
      	* gcc.target/riscv/zvksc.c: Ditto.
      	* gcc.target/riscv/zvksc-1.c: Ditto.
      	* gcc.target/riscv/zvksc-2.c: Ditto.
      	* gcc.target/riscv/zvksg.c: Ditto.
      	* gcc.target/riscv/zvksg-1.c: Ditto.
      	* gcc.target/riscv/zvksg-2.c: Ditto.
      56c28ce7
    • Richard Biener's avatar
      Fix FAIL: gcc.target/i386/pr87007-5.c · 2eaebcf3
      Richard Biener authored
      The following fixes the gcc.target/i386/pr87007-5.c testcase which
      changed code generation again after the recent sinking improvements.
      We now have
      
              vxorps  %xmm0, %xmm0, %xmm0
              vsqrtsd d2(%rip), %xmm0, %xmm0
      
      and a necessary xor again in one case, the other vsqrtsd has
      a register source and a properly zeroing load:
      
              vmovsd  d3(%rip), %xmm0
              testl   %esi, %esi
              jg      .L11
      .L3:
              vsqrtsd %xmm0, %xmm0, %xmm0
      
      the following patch adjusts the scan.
      
      	* gcc.target/i386/pr87007-5.c: Update comment, adjust subtest.
      2eaebcf3
    • Richard Biener's avatar
      Fix gcc.dg/vect/bb-slp-subgroups-2.c with 256bit vectors · e4e6a924
      Richard Biener authored
      The following adds vect128, vect256 and vect512 effective targets
      and adjusts gcc.dg/vect/bb-slp-subgroups-2.c accordingly.
      
      gcc/testsuite/
      	* lib/target-supports.exp: Add vect128, vect256 and vect512
      	effective targets.
      	* gcc.dg/vect/bb-slp-subgroups-2.c: Properly handle the
      	vect256 case.
      e4e6a924
    • Prathamesh Kulkarni's avatar
      Fix gcc.dg/vect/pr65947-7.c failures on aarch64. · dd606dc7
      Prathamesh Kulkarni authored
      gcc/testsuite/ChangeLog:
      	* gcc.dg/vect/pr65947-7.c: Add target check aarch64*-*-* and scan vect
      	dump for pattern "optimizing condition reduction with FOLD_EXTRACT_LAST"
      	for targets that support vect_fold_extract_last.
      dd606dc7
    • Richard Biener's avatar
      Fix gcc.dg/vect/bb-slp-46.c FAIL · 4c5712ff
      Richard Biener authored
      When relaxing vectorization of possibly overflowing reductions I
      failed to update a testcase that will now vectorize and no longer
      test for what it was written for.  The following replaces the
      vectorizable add with a division.
      
      	* gcc.dg/vect/bb-slp-46.c: Use division instead of addition
      	to avoid reduction vectorization.
      4c5712ff
    • liuhongt's avatar
      Adjust testcase for Intel GDS. · 6450397e
      liuhongt authored
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/avx512f-pr88464-2.c: Add -mgather to
      	options.
      	* gcc.target/i386/avx512f-pr88464-3.c: Ditto.
      	* gcc.target/i386/avx512f-pr88464-4.c: Ditto.
      	* gcc.target/i386/avx512f-pr88464-6.c: Ditto.
      	* gcc.target/i386/avx512f-pr88464-7.c: Ditto.
      	* gcc.target/i386/avx512f-pr88464-8.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-10.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-12.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-13.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-14.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-15.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-16.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-2.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-4.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-5.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-6.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-7.c: Ditto.
      	* gcc.target/i386/avx512vl-pr88464-8.c: Ditto.
      6450397e
Loading