Skip to content
Snippets Groups Projects
  1. Aug 30, 2022
    • Richard Biener's avatar
      tree-optimization/67196 - normalize use predicates earlier · 61051ee5
      Richard Biener authored
      The following makes sure to have use predicates simplified and
      normalized before doing uninit_analysis::overlap because that
      otherwise cannot pick up all flag setting cases.  This fixes
      half of the issue in PR67196 and conveniently resolves the
      XFAIL in gcc.dg/uninit-pred-7_a.c.
      
      	PR tree-optimization/67196
      	* gimple-predicate-analysis.cc (uninit_analysis::is_use_guarded):
      	Simplify and normalize use prediates before first use.
      
      	* gcc.dg/uninit-pred-7_a.c: Un-XFAIL.
      61051ee5
    • Martin Liska's avatar
      libsanitizer: update LOCAL_PATCHES · 70b2e511
      Martin Liska authored
      libsanitizer/ChangeLog:
      
      	* LOCAL_PATCHES: Update.
      70b2e511
    • Martin Liska's avatar
      libsanitizer: Apply local patches · 76ae5366
      Martin Liska authored
      76ae5366
    • Martin Liska's avatar
      libsanitizer: update build system · 789573a5
      Martin Liska authored
      libsanitizer/ChangeLog:
      
      	* sanitizer_common/Makefile.am: Remove sanitizer_openbsd.
      	* sanitizer_common/Makefile.in: Regenerate.
      789573a5
    • Martin Liska's avatar
    • Richard Biener's avatar
      Remove GENERIC expr building from predicate analysis, improve dumps · bdd3547a
      Richard Biener authored
      The following removes duplicate dumping and makes the predicate
      dumping more readable.  That makes the GENERIC predicate build
      routines unused which is also nice.
      
      	* gimple-predicate-analysis.cc (dump_pred_chain): Fix
      	parentizing and AND prepending.
      	(predicate::dump): Do not dump the GENERIC expanded
      	predicate, properly parentize and prepend ORs to the
      	piecewise predicate dump.
      	(build_pred_expr): Remove.
      bdd3547a
    • Aldy Hernandez's avatar
      Implement relational operators for frange with endpoints. · 4fbe3e6a
      Aldy Hernandez authored
      This is the implementation of the relational range operators for
      frange.  These are the core operations that require specific FP domain
      knowledge.
      
      gcc/ChangeLog:
      
      	* range-op-float.cc (finite_operand_p): New.
      	(build_le): New.
      	(build_lt): New.
      	(build_ge): New.
      	(build_gt): New.
      	(foperator_equal::fold_range): New implementation with endpoints.
      	(foperator_equal::op1_range): Same.
      	(foperator_not_equal::fold_range): Same.
      	(foperator_not_equal::op1_range): Same.
      	(foperator_lt::fold_range): Same.
      	(foperator_lt::op1_range): Same.
      	(foperator_lt::op2_range): Same.
      	(foperator_le::fold_range): Same.
      	(foperator_le::op1_range): Same.
      	(foperator_le::op2_range): Same.
      	(foperator_gt::fold_range): Same.
      	(foperator_gt::op1_range): Same.
      	(foperator_gt::op2_range): Same.
      	(foperator_ge::fold_range): Same.
      	(foperator_ge::op1_range): Same.
      	(foperator_ge::op2_range): Same.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/recip-3.c: Avoid premature optimization so test
      	has a chance to succeed.
      4fbe3e6a
    • Aldy Hernandez's avatar
      Add support for floating point endpoints to frange. · 8bb1df03
      Aldy Hernandez authored
      The current implementation of frange is just a type with some bits to
      represent NAN and INF.  We can do better and represent endpoints to
      ultimately solve longstanding PRs such as PR24021.  This patch adds
      these endpoints.  In follow-up patches I will add support for a bare
      bones PLUS_EXPR range-op-float entry to solve the PR.
      
      I have chosen to use REAL_VALUE_TYPEs for the endpoints, since that's
      what we use underneath the trees.  This will be somewhat analogous to
      our eventual use of wide-ints in the irange.  No sense going through
      added levels of indirection if we can avoid it.  That, plus real.*
      already has a nice API for dealing with floats.
      
      With this patch, ranges will be closed float point intervals, which
      make the implementation simpler, since we don't have to keep track of
      open/closed intervals.  This is conservative enough for use in the
      ranger world, as we'd rather err on the side of more elements in a
      range, than less.
      
      For example, even though we cannot precisely represent the open
      interval (3.0, 5.0) with this approach, it is perfectably reasonable
      to represent it as [3.0, 5.0] since the closed interval is a super set
      of the open one.  In the VRP/ranger world, it is always better to
      err on the side of more information in a range, than not.  After all,
      when we don't know anything about a range, we just use VARYING which
      is a fancy term for a range spanning the entire domain.
      
      Since REAL_VALUE_TYPEs have properly defined infinity and NAN
      semantics, all the math can be made to work:
      
      [-INF, 3.0] !NAN        => Numbers <= 3.0 (NAN cannot happen)
      [3.0, 3.0]  		=> 3.0 or NAN.
      [3.0, +INF]             => Numbers >= 3.0 (NAN is possible)
      [-INF, +INF]            => VARYING (NAN is possible)
      [-INF, +INF] !NAN       => Entire domain.  NAN cannot happen.
      
      Also, since REAL_VALUE_TYPEs can represent the minimum and maximum
      representable values of a TYPE_MODE, we can disambiguate between them
      and negative and positive infinity (see get_max_float in real.cc).
      
      This also makes the math all work.  For example, suppose we know
      nothing about x and y (VARYING).  On the TRUE side of x > y, we can
      deduce that:
      
              (a) x cannot be NAN
              (b) y cannot be NAN
              (c) y cannot be +INF.
      
      (c) means that we can drop the upper bound of "y" from +INF to the
      maximum representable value for its type.
      
      Having endpoints with different representation for infinity and the
      maximum representable values, means we can drop the +-INF properties
      we currently have in the frange.
      
      gcc/ChangeLog:
      
      	* range-op-float.cc (frange_set_nan): New.
      	(frange_drop_inf): New.
      	(frange_drop_ninf): New.
      	(foperator_equal::op1_range): Adjust for endpoints.
      	(foperator_lt::op1_range): Same.
      	(foperator_lt::op2_range): Same.
      	(foperator_gt::op1_range): Same.
      	(foperator_gt::op2_range): Same.
      	(foperator_unordered::op1_range): Same.
      	* value-query.cc (range_query::get_tree_range): Same.
      	* value-range-pretty-print.cc (vrange_printer::visit): Same.
      	* value-range-storage.cc (frange_storage_slot::get_frange): Same.
      	* value-range.cc (frange::set): Same.
      	(frange::normalize_kind): Same.
      	(frange::union_): Same.
      	(frange::intersect): Same.
      	(frange::operator=): Same.
      	(early_nan_resolve): New.
      	(frange::contains_p): New.
      	(frange::singleton_p): New.
      	(frange::set_nonzero): New.
      	(frange::nonzero_p): New.
      	(frange::set_zero): New.
      	(frange::zero_p): New.
      	(frange::set_nonnegative): New.
      	(frange_float): New.
      	(frange_nan): New.
      	(range_tests_nan): New.
      	(range_tests_signed_zeros): New.
      	(range_tests_floats): New.
      	(range_tests): New.
      	* value-range.h (frange::lower_bound): New.
      	(frange::upper_bound): New.
      	(vrp_val_min): Use real_inf with a sign instead of negating inf.
      	(frange::frange): New.
      	(frange::set_varying): Adjust for endpoints.
      	(real_max_representable): New.
      	(real_min_representable): New.
      8bb1df03
    • Aldy Hernandez's avatar
      A == 0 ? A : -A same as -A (when A is 0.0) · df8fe4ad
      Aldy Hernandez authored
      The upcoming work for frange triggers a regression in
      gcc.dg/tree-ssa/phi-opt-24.c.
      
      For -O2 -fno-signed-zeros, we fail to transform the following into -A:
      
      float f0(float A)
      {
        //     A == 0? A : -A    same as -A
        if (A == 0)  return A;
        return -A;
      }
      
      This is because the abs/negative match.pd pattern here:
      
      /* abs/negative simplifications moved from fold_cond_expr_with_comparison,
         Need to handle (A - B) case as fold_cond_expr_with_comparison does.
         Need to handle UN* comparisons.
         ...
         ...
      
      Sees IL that has the 0.0 propagated.
      
      Instead of:
      
        <bb 2> [local count: 1073741824]:
        if (A_2(D) == 0.0)
          goto <bb 4>; [34.00%]
        else
          goto <bb 3>; [66.00%]
      
        <bb 3> [local count: 708669601]:
        _3 = -A_2(D);
      
        <bb 4> [local count: 1073741824]:
        # _1 = PHI <A_2(D)(2), _3(3)>
      
      It now sees:
      
        <bb 4> [local count: 1073741824]:
        # _1 = PHI <0.0(2), _3(3)>
      
      which it leaves untouched, causing the if conditional to survive.
      
      Changing integger_zerop to zerop fixes the problem.
      
      I did not include a testcase, as it's just phi-opt-24.c which will get
      triggered when I commit the frange with endpoints work.
      
      gcc/ChangeLog:
      
      	* match.pd ((cmp @0 zerop) real_zerop (negate@1 @0)): Add variant
      	for real zero.
      df8fe4ad
    • Martin Liska's avatar
      s390: fix build on 32-bit hosts · 34ad7155
      Martin Liska authored
      Fixes build on i686:
      
      gcc/config/s390/s390.cc: In function 'bool s390_rtx_costs(rtx, machine_mode, int, int, int*, bool)':
      gcc/config/s390/s390.cc:3728:63: error: cannot convert 'long int*' to 'long long int*'
      
      gcc/ChangeLog:
      
      	* config/s390/s390.cc (s390_rtx_costs): Use proper type as
      	  argument.
      34ad7155
    • Richard Biener's avatar
      Use reachability analysis to improve uninit diagnostic · f71abacf
      Richard Biener authored
      This patch does what the comment in uninit diagnostic suggests.
      When the value-numbering run done without optimizing figures there's
      a fallthru path, consider blocks on it as always executed.
      
      	* tree-ssa-uninit.cc (warn_uninitialized_vars): Pre-compute
      	the set of fallthru reachable blocks from function entry
      	and use that to determine wlims.always_executed.
      f71abacf
    • Richard Biener's avatar
      tree-optimization/63660 - testcase for fixed PR · bfaa6807
      Richard Biener authored
      This adds a testcase for the PR which was fixed with r13-2155-gbaa3ffb19c54fa
      
      	PR tree-optimization/63660
      	* gcc.dg/uninit-pr63660.c: New testcase.
      bfaa6807
    • Richard Biener's avatar
      tree-optimization/56654 - sort uninit candidates after RPO · 8a63343a
      Richard Biener authored
      The following sorts the immediate uses of a possibly uninitialized
      SSA variable after their RPO order so we prefer warning for an
      earlier occuring use rather than issueing the diagnostic for the
      first uninitialized immediate use.
      
      The sorting will inevitably be imperfect but it also allows us to
      optimize the expensive predicate check for the case where there
      are multiple uses in the same basic-block which is a nice side-effect.
      
      	PR tree-optimization/56654
      	* tree-ssa-uninit.cc (cand_cmp): New.
      	(find_uninit_use): First process all PHIs and collect candidate
      	stmts, then sort those after RPO.
      	(warn_uninitialized_phi): Pass on bb_to_rpo.
      	(execute_late_warn_uninitialized): Compute and pass on
      	reverse lookup of RPO number from basic block index.
      8a63343a
    • Richard Biener's avatar
      Make uninit PHI processing more consistent · 4a8f98fa
      Richard Biener authored
      Currently the main working of the maybe-uninit pass is to scan over
      all PHIs with possibly undefined arguments, diagnosing whether there's
      a direct not guarded use.  For not guarded uses in PHIs those are queued for
      later processing and to make the uninit analysis PHI def handling work,
      mark the PHI def as possibly uninitialized.  But this happens only
      for those PHI uses that happen to be seen before a direct not guarded
      use and whether all arguments of a PHI node which are defined by a PHI
      are properly marked as maybe uninitialized depends on the processing
      order.
      
      The following changes the uninit pass to perform an RPO walk over
      the function, ensuring that PHI argument defs are visited before
      the PHI node (besides backedge uses which we ignore already),
      getting rid of the worklist.  It also makes sure to process all
      PHI uses, but recording those that are properly guarded so they
      are not treated as maybe undefined when processing the PHI use
      later.
      
      Overall this should make behavior more consistent, avoid some
      false negative because of the previous early out and order issue,
      and avoid some false positive because of the missed recording
      of guarded PHI uses.
      
      The patch correctly diagnoses an uninitalized use of 'regnum'
      in store_bit_field_1 and also diagnoses an uninitialized use of
      best_match::m_best_candidate_len in c-decl.cc which I've chosen to
      silence by initializing m_best_candidate_len.  The warning is
      a false positive but GCC cannot see that m_best_candidate_len is
      initialized when m_best_candidate is not NULL so from this
      perspective this was a false negative.  I've added
      g++.dg/uninit-pred-5.C with a reduced testcase that nicely shows
      how the previous behavior missed the diagnostic because the
      worklist ended up visiting the PHI with the dependend uninit
      value before visiting the PHIs producing it.
      
      	* gimple-predicate-analysis.h (uninit_analysis::operator()):
      	Remove.
      	* gimple-predicate-analysis.cc
      	(uninit_analysis::collect_phi_def_edges): Use phi_arg_set,
      	simplify a bit.
      	* tree-ssa-uninit.cc (defined_args): New global.
      	(compute_uninit_opnds_pos): Mask with the recorded set
      	of guarded maybe-uninitialized uses.
      	(uninit_undef_val_t::operator()): Remove.
      	(find_uninit_use): Process all PHI uses, recording the
      	guarded ones and marking the PHI result as uninitialized
      	consistently.
      	(warn_uninitialized_phi): Adjust.
      	(execute_late_warn_uninitialized): Get rid of the PHI worklist
      	and instead walk the function in RPO order.
      	* spellcheck.h (best_match::m_best_candidate_len): Initialize.
      
      	* g++.dg/uninit-pred-5.C: New testcase.
      4a8f98fa
    • Tamar Christina's avatar
      middle-end: fix min/max phiopts reduction [PR106744] · 37ebaabd
      Tamar Christina authored
      This corrects the argument usage to use them in the order that they occur in
      the comparisons in gimple.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/106744
      	* tree-ssa-phiopt.cc (minmax_replacement): Correct arguments.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/106744
      	* gcc.dg/tree-ssa/minmax-10.c: Make runtime test.
      	* gcc.dg/tree-ssa/minmax-11.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-12.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-13.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-14.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-15.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-16.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-3.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-4.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-5.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-6.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-7.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-8.c: Likewise.
      	* gcc.dg/tree-ssa/minmax-9.c: Likewise.
      37ebaabd
    • Tamar Christina's avatar
      middle-end: intialize regnum in store_bit_field_1 · 368dbb23
      Tamar Christina authored
      This initializes regnum to 0 for when undefined_p.
      0 is the right default as it's supposed to get the lowpart
      when undefined.
      
      gcc/ChangeLog:
      
      	* expmed.cc (store_bit_field_1): Initialize regnum to 0.
      368dbb23
    • GCC Administrator's avatar
      Daily bump. · 0b47752e
      GCC Administrator authored
      0b47752e
  2. Aug 29, 2022
    • Marek Polacek's avatar
      c++: Fix C++11 attribute propagation [PR106712] · 98973354
      Marek Polacek authored
      When we have
      
        [[noreturn]] int fn1 [[nodiscard]](), fn2();
      
      "noreturn" should apply to both fn1 and fn2 but "nodiscard" only to fn1:
      [dcl.pre]/3: "The attribute-specifier-seq appertains to each of
      the entities declared by the declarators of the init-declarator-list."
      [dcl.spec.general]: "The attribute-specifier-seq affects the type
      only for the declaration it appears in, not other declarations involving
      the same type."
      
      As Ed Catmur correctly analyzed, this is because, for the test above,
      we call start_decl with prefix_attributes=noreturn, but this line:
      
        attributes = attr_chainon (attributes, prefix_attributes);
      
      results in attributes == prefix_attributes, because chainon sees
      that attributes is null so it just returns prefix_attributes.  Then
      in grokdeclarator we reach
      
        *attrlist = attr_chainon (*attrlist, declarator->std_attributes);
      
      which modifies prefix_attributes so now it's "noreturn, nodiscard"
      and so fn2 is wrongly marked nodiscard as well.  Fixed by reversing
      the order of arguments to attr_chainon.  That way, we tack the prefix
      attributes onto ->std_attributes, avoiding modifying prefix_attributes.
      
      	PR c++/106712
      
      gcc/cp/ChangeLog:
      
      	* decl.cc (grokdeclarator): Reverse the order of arguments to
      	attr_chainon.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/gen-attrs-77.C: New test.
      98973354
    • David Faust's avatar
      bpf: handle anonymous members in CO-RE reloc [PR106745] · b504149d
      David Faust authored
      The old method for computing a member index for a CO-RE relocation
      relied on a name comparison, which could SEGV if the member in question
      is itself part of an anonymous inner struct or union.
      
      This patch changes the index computation to not rely on a name, while
      maintaining the ability to account for other sibling fields which may
      not have a representation in BTF.
      
      gcc/ChangeLog:
      
      	PR target/106745
      	* config/bpf/coreout.cc (bpf_core_get_sou_member_index): Fix
      	computation of index for anonymous members.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/106745
      	* gcc.target/bpf/core-pr106745.c: New test.
      b504149d
    • Jose E. Marchesi's avatar
      bpf: define __bpf__ as well as __BPF__ as a target macro · c68b5c07
      Jose E. Marchesi authored
      LLVM defines both __bpf__ and __BPF_ as target macros.
      GCC was defining only __BPF__.
      
      This patch defines __bpf__ as a target macro for BPF.
      Tested in bpf-unknown-none.
      
      gcc/ChangeLog:
      
      	* config/bpf/bpf.cc (bpf_target_macros): Define __bpf__ as a
      	target macro.
      c68b5c07
    • H.J. Lu's avatar
      x86: Handle V16BF in ix86_avx256_split_vector_move_misalign · 60d1d296
      H.J. Lu authored
      Handle E_V16BFmode in ix86_avx256_split_vector_move_misalign and add
      V16BF to V_256H iterator.
      
      gcc/
      
      	PR target/106748
      	* config/i386/i386-expand.cc
      	(ix86_avx256_split_vector_move_misalign): Handle E_V16BFmode.
      	* config/i386/sse.md (V_256H): Add V16BF.
      
      gcc/testsuite/
      
      	PR target/106748
      	* gcc.target/i386/pr106748.c: New test.
      60d1d296
    • Xi Ruoyao's avatar
      LoongArch: testsuite: refine __tls_get_addr tests with tls_native · feeb9314
      Xi Ruoyao authored
      If GCC is not built with a working linker for the target (developers
      occansionally build such a "minimal" GCC for testing and debugging),
      TLS will be emulated and __tls_get_addr won't be used.  Refine those
      tests depending on __tls_get_addr with tls_native to avoid test
      failures.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/loongarch/func-call-medium-1.c: Refine test
      	depending on __tls_get_addr with { target tls_native }.
      	* gcc.target/loongarch/func-call-medium-2.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-3.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-4.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-5.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-6.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-7.c: Likewise.
      	* gcc.target/loongarch/func-call-medium-8.c: Likewise.
      	* gcc.target/loongarch/tls-gd-noplt.c: Likewise.
      feeb9314
    • Robin Dapp's avatar
      s390: Change SET rtx_cost handling. · 1930c5d0
      Robin Dapp authored
      The IF_THEN_ELSE detection currently prevents us from properly costing
      register-register moves which causes the lower-subreg pass to assume that
      a VR-VR move is as expensive as two GPR-GPR moves.
      
      This patch adds handling for SETs containing REGs as well as MEMs and is
      inspired by the aarch64 implementation.
      
      gcc/ChangeLog:
      
      	* config/s390/s390.cc (s390_address_cost): Declare.
      	(s390_hard_regno_nregs): Declare.
      	(s390_rtx_costs): Add handling for REG and MEM in SET.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/vector/vec-sum-across-no-lower-subreg-1.c: New test.
      1930c5d0
    • Robin Dapp's avatar
      s390: Recognize reverse/element swap permute patterns. · 34895b66
      Robin Dapp authored
      This adds functions to recognize reverse/element swap permute patterns
      for vler, vster as well as vpdi and rotate.
      
      gcc/ChangeLog:
      
      	* config/s390/s390.cc (expand_perm_with_vpdi): Recognize swap pattern.
      	(is_reverse_perm_mask): New function.
      	(expand_perm_with_rot): Recognize reverse pattern.
      	(expand_perm_with_vstbrq): New function.
      	(expand_perm_with_vster): Use vler/vster for element reversal on z15.
      	(vectorize_vec_perm_const_1): Use.
      	(s390_vectorize_vec_perm_const): Add expand functions.
      	* config/s390/vx-builtins.md: Prefer vster over vler.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/vector/vperm-rev-z14.c: New test.
      	* gcc.target/s390/vector/vperm-rev-z15.c: New test.
      	* gcc.target/s390/zvector/vec-reve-store-byte.c: Adjust test
      	expectation.
      34895b66
    • Robin Dapp's avatar
      s390: Implement vec_extract via vec_select. · bde28df1
      Robin Dapp authored
      vec_select can handle dynamic/runtime masks nowadays.  Therefore we can
      get rid of the UNSPEC_VEC_EXTRACT that was preventing further
      optimizations like combining instructions with vec_extract patterns.
      
      gcc/ChangeLog:
      
      	* config/s390/s390.md: Remove UNSPEC_VEC_EXTRACT.
      	* config/s390/vector.md: Rewrite patterns to use vec_select.
      	* config/s390/vx-builtins.md (vec_scatter_element<V_HW_2:mode>_SI):
      	Likewise.
      bde28df1
    • Robin Dapp's avatar
      s390: Use vpdi and verllg in vec_reve. · 8cdebe08
      Robin Dapp authored
      Swapping the two elements of a V2DImode or V2DFmode vector can be done
      with vpdi instead of using the generic way of loading a permutation mask
      from the literal pool and vperm.
      
      Analogous to the V2DI/V2DF case reversing the elements of a four-element
      vector can be done by first swapping the elements of the first
      doubleword as well the ones of the second one and subsequently rotate
      the doublewords by 32 bits.
      
      gcc/ChangeLog:
      
      	PR target/100869
      	* config/s390/vector.md (@vpdi4_2<mode>): New pattern.
      	(rotl<mode>3_di): New pattern.
      	* config/s390/vx-builtins.md: Use vpdi and verll for reversing
      	elements.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/zvector/vec-reve-int-long.c: New test.
      8cdebe08
    • Robin Dapp's avatar
      s390: Add z15 to s390_issue_rate. · c2f4a1b7
      Robin Dapp authored
      Be more explicit by mentioning z15 in s390_issue_rate.
      
      gcc/ChangeLog:
      
      	* config/s390/s390.cc (s390_issue_rate): Add z15.
      c2f4a1b7
    • Robin Dapp's avatar
      s390: Add -munroll-only-small-loops. · af895511
      Robin Dapp authored
      Inspired by Power we also introduce -munroll-only-small-loops.  This
      implies activating -funroll-loops and -munroll-only-small-loops at -O2 and
      above.
      
      gcc/ChangeLog:
      
      	* common/config/s390/s390-common.cc: Enable -funroll-loops and
      	-munroll-only-small-loops for OPT_LEVELS_2_PLUS_SPEED_ONLY.
      	* config/s390/s390.cc (s390_loop_unroll_adjust): Do not unroll
      	loops larger than 12 instructions.
      	(s390_override_options_after_change): Set unroll options.
      	(s390_option_override_internal): Likewise.
      	* config/s390/s390.opt: Document munroll-only-small-loops.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/vector/vec-copysign.c: Do not unroll.
      	* gcc.target/s390/zvector/autovec-double-quiet-uneq.c: Dito.
      	* gcc.target/s390/zvector/autovec-double-signaling-ltgt.c: Dito.
      	* gcc.target/s390/zvector/autovec-float-quiet-uneq.c: Dito.
      	* gcc.target/s390/zvector/autovec-float-signaling-ltgt.c: Dito.
      af895511
    • Richard Biener's avatar
      Refactor init_use_preds and find_control_equiv_block · 9b3cd175
      Richard Biener authored
      The following inlines find_control_equiv_block and is_loop_exit
      into init_use_preds and refactors that for better readability and
      similarity with the post-dominator walk in compute_control_dep_chain.
      
      	* gimple-predicate-analysis.cc (is_loop_exit,
      	find_control_equiv_block): Inline into single caller ...
      	(uninit_analysis::init_use_preds): ... here and refactor.
      9b3cd175
    • Richard Biener's avatar
      Improve compute_control_dep_chain documentation · 3358c24a
      Richard Biener authored
      The following refactors compute_control_dep_chain slightly by
      inlining is_loop_exit and factoring the check on the loop
      invariant condition.  It also adds a comment as of how I
      understand the code and it's current problem.
      
      	* gimple-predicate-analysis.cc (compute_control_dep_chain):
      	Inline is_loop_exit and refactor, add comment about
      	loop exits.
      3358c24a
    • Kito Cheng's avatar
      RISC-V: Suppress -Wclass-memaccess warning · 7b9b6969
      Kito Cheng authored
      poly_int64 is non-trivial type, we need to clean up manully instead
      of memset to prevent this warning.
      
      ../../gcc/gcc/config/riscv/riscv.cc: In function 'void riscv_compute_frame_info()':
      ../../gcc/gcc/config/riscv/riscv.cc:4113:10: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct riscv_frame_info'; use assignment or value-initialization instead [-Werror=class-memaccess]
       4113 |   memset (frame, 0, sizeof (*frame));
            |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../gcc/gcc/config/riscv/riscv.cc:101:17: note: 'struct riscv_frame_info' declared here
        101 | struct GTY(())  riscv_frame_info {
            |                 ^~~~~~~~~~~~~~~~
      cc1plus: all warnings being treated as errors
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv.cc (riscv_frame_info): Introduce `reset(void)`;
      	(riscv_frame_info::reset(void)): New.
      	(riscv_compute_frame_info): Use riscv_frame_info::reset instead
      	of memset when clean frame.
      7b9b6969
    • zhongjuzhe's avatar
      RISC-V: Add RVV registers · 31380d4b
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.cc (riscv_v_ext_vector_mode_p): New function.
      	(riscv_classify_address): Disallow PLUS/LO_SUM/CONST_INT address types for RVV.
      	(riscv_address_insns): Add RVV modes condition.
      	(riscv_binary_cost): Ditto.
      	(riscv_rtx_costs): Adjust cost for RVV.
      	(riscv_secondary_memory_needed): Add RVV modes condition.
      	(riscv_hard_regno_nregs): Add RVV register allocation.
      	(riscv_hard_regno_mode_ok): Add RVV register allocation.
      	(riscv_class_max_nregs): Add RVV register allocation.
      	* config/riscv/riscv.h (DWARF_FRAME_REGNUM): Add VL/VTYPE and vector registers in Dwarf.
      	(UNITS_PER_V_REG): New macro.
      	(FIRST_PSEUDO_REGISTER): Adjust first pseudo num for RVV.
      	(V_REG_FIRST): New macro.
      	(V_REG_LAST): Ditto.
      	(V_REG_NUM): Ditto.
      	(V_REG_P): Ditto.
      	(VL_REG_P): Ditto.
      	(VTYPE_REG_P): Ditto.
      	(RISCV_DWARF_VL): Ditto.
      	(RISCV_DWARF_VTYPE): Ditto.
      	(enum reg_class): Add RVV register types.
      	(REG_CLASS_CONTENTS): Add RVV register types.
      	* config/riscv/riscv.md: Add VL/VTYPE register number constants.
      31380d4b
    • zhongjuzhe's avatar
      RISC-V: Add RVV instructions classification · b8426900
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.md: Add new type for vector instructions.
      b8426900
    • GCC Administrator's avatar
      Daily bump. · b37f96f1
      GCC Administrator authored
      b37f96f1
  3. Aug 28, 2022
    • Peter Bergner's avatar
      rs6000: Allow conversions of MMA pointer types [PR106017] · 1ae1325f
      Peter Bergner authored
      GCC incorrectly disables conversions between MMA pointer types, which
      are allowed with clang.  The original intent was to disable conversions
      between MMA types and other other types, but pointer conversions should
      have been allowed.  The fix is to just remove the MMA pointer conversion
      handling code altogether.
      
      gcc/
      	PR target/106017
      	* config/rs6000/rs6000.cc (rs6000_invalid_conversion): Remove handling
      	of MMA pointer conversions.
      
      gcc/testsuite/
      	PR target/106017
      	* gcc.target/powerpc/pr106017.c: New test.
      1ae1325f
    • GCC Administrator's avatar
      Daily bump. · 6b226ef7
      GCC Administrator authored
      6b226ef7
  4. Aug 27, 2022
    • Iain Buclaw's avatar
      d: Merge upstream dmd 817610b16d, phobos b578dfad9 · b7a586be
      Iain Buclaw authored
      D front-end changes:
      
          - Import latest bug fixes to mainline.
      
      Phobos changes:
      
          - Import latest bug fixes to mainline.
          - std.logger module has been moved out of experimental.
          - Removed std.experimental.typecons module.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 817610b16d.
      	* d-ctfloat.cc (CTFloat::parse): Update for new front-end interface.
      	* d-lang.cc (d_parse_file): Likewise.
      	* expr.cc (ExprVisitor::visit (AssignExp *)): Remove handling of array
      	assignments to non-trivial static and dynamic arrays.
      	* runtime.def (ARRAYASSIGN): Remove.
      	(ARRAYASSIGN_L): Remove.
      	(ARRAYASSIGN_R): Remove.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 817610b16d.
      	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add
      	core/internal/array/arrayassign.d.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/MERGE: Merge upstream phobos b578dfad9.
      	* src/Makefile.am (PHOBOS_DSOURCES): Remove
      	std/experimental/typecons.d. Add std/logger package.
      	* src/Makefile.in: Regenerate.
      b7a586be
    • Patrick Palka's avatar
      libstdc++: Add test for std::con/disjunction's base class · cace77f4
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/logical_traits/requirements/base_classes.cc: New test.
      cace77f4
    • Jakub Jelinek's avatar
      Require fgraphite effective target for pr106737.c test [PR106737] · 4d291ca6
      Jakub Jelinek authored
      The test uses -floop-parallelize-all which emits a sorry when graphite
      isn't configured in.
      
      2022-08-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/106737
      	* gcc.dg/autopar/pr106737.c: Require fgraphite effective target.
      4d291ca6
    • Xi Ruoyao's avatar
      contrib: modernize gen_autofdo_event.py · 15289576
      Xi Ruoyao authored
      Python 2 has been EOL'ed for two years.  egrep has been deprecated
      for many years and the next grep release will start to print warning if
      it is used.
      
      -E option may be unsupported by some non-POSIX grep implementations, but
      gcc-auto-profile won't work on non-Linux systems anyway.
      
      contrib/ChangeLog:
      
      	* gen_autofdo_event.py: Port to Python 3, and use grep -E
      	instead of egrep.
      
      gcc/ChangeLog:
      
      	* config/i386/gcc-auto-profile: Regenerate.
      15289576
Loading