Skip to content
Snippets Groups Projects
  1. Nov 29, 2021
    • Rasmus Villemoes's avatar
      libgcc: remove crt{begin,end}.o from powerpc-wrs-vxworks target · 3e15df63
      Rasmus Villemoes authored
      Since commit 78e49fb1 (Introduce vxworks specific crtstuff support),
      the generic crtbegin.o/crtend.o have been unnecessary to build. So
      remove them from extra_parts.
      
      This is effectively a revert of commit 9a5b8df7 (libgcc: add
      crt{begin,end} for powerpc-wrs-vxworks target).
      
      libgcc/
      	* config.host (powerpc-wrs-vxworks): Do not add crtbegin.o and
      	crtend.o to extra_parts.
      3e15df63
    • Kewen Lin's avatar
      rs6000/test: Add emulated gather test case · 300dbea1
      Kewen Lin authored
      As verified, the emulated gather capability of vectorizer
      (r12-2733) can help to speed up SPEC2017 510.parest_r on
      Power8/9/10 by 5% ~ 9% with option sets Ofast unroll and
      Ofast lto.
      
      This patch is to add a test case similar to the one in i386
      to add testing coverage for 510.parest_r hotspots.
      
      btw, different from the one in i386, this uses unsigned int
      as INDEXTYPE since the unpack support for unsigned int
      (r12-3134) also matters for the hotspots vectorization.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/powerpc/vect-gather-1.c: New test.
      300dbea1
    • Andrew Pinski's avatar
      Fix PR 19089: Environment variable TMP may yield gcc: abort · 68332ab7
      Andrew Pinski authored
      Even though I cannot reproduce the ICE any more, this is still
      a bug. We check already to see if we can access the directory
      but never check to see if the path is actually a directory.
      
      This adds the check and now we reject the file as not usable
      as a tmp directory.
      
      OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
      
      libiberty/ChangeLog:
      
      	* make-temp-file.c (try_dir): Check to see if the dir
      	is actually a directory.
      68332ab7
    • GCC Administrator's avatar
      Daily bump. · 2f0dd172
      GCC Administrator authored
      2f0dd172
  2. Nov 28, 2021
    • Andrew Pinski's avatar
      Fix PR 62157: disclean in libsanitizer not working · 32377c10
      Andrew Pinski authored
      So what is happening is DIST_SUBDIRS contains the conditional
      directories which is wrong, so we need to force DIST_SUBDIRS
      to be the same as SUBDIRS as recommened by the automake manual.
      
      OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
      Also now make distclean works inside libsanitizer directory.
      
      libsanitizer/ChangeLog:
      
      	PR sanitizer/62157
      	* Makefile.am: Force DIST_SUBDIRS to be SUBDIRS.
      	* Makefile.in: Regenerate.
      	* asan/Makefile.in: Likewise.
      	* hwasan/Makefile.in: Likewise.
      	* interception/Makefile.in: Likewise.
      	* libbacktrace/Makefile.in: Likewise.
      	* lsan/Makefile.in: Likewise.
      	* sanitizer_common/Makefile.in: Likewise.
      	* tsan/Makefile.in: Likewise.
      	* ubsan/Makefile.in: Likewise.
      32377c10
    • Jan Hubicka's avatar
      Compare guessed and feedback frequencies during profile feedback stream-in · 2899d49e
      Jan Hubicka authored
      This patch adds simple code to dump and compare frequencies of basic blocks
      read from the profile feedback and frequencies guessed statically.
      It dumps basic blocks in the order of decreasing frequencies from feedback
      along with guessed frequencies and histograms.
      
      It makes it to possible spot basic blocks in hot regions that are considered
      cold by guessed profile or vice versa.
      
      I am trying to figure out how realistic our profile estimate is compared to
      read one on exchange2 (looking again into PR98782.  There IRA now places spills
      into hot regions of code while with older (and worse) profile it did not.
      Catch is that the function is very large and has 9 nested loops, so it is hard
      to figure out how to improve the profile estimate and/or IRA.
      
      gcc/ChangeLog:
      
      2021-11-28  Jan Hubicka  <hubicka@ucw.cz>
      
      	* profile.c: Include sreal.h
      	(struct bb_stats): New.
      	(cmp_stats): New function.
      	(compute_branch_probabilities): Output bb stats.
      2899d49e
    • Jan Hubicka's avatar
      Improve -fprofile-report · d1471457
      Jan Hubicka authored
      Profile-report was never properly updated after switch to new profile
      representation.  This patch fixes the way profile mismatches are calculated:
      we used to collect separately count and freq mismatches, while now we have
      only counts & probabilities.  So we verify
       - in count: that total count of incomming edges is close to acutal count of
         the BB
       - out prob: that total sum of outgoing edge edge probabilities is close
         to 1 (except for BB containing noreturn calls or EH).
      
      Moreover I added dumping of absolute data which is useful to plot them: with
      Martin Liska we plan to setup regular testing so we keep optimizers profie
      updates bit under control.
      
      Finally I added both static and dynamic stats about mismatches - static one is
      simply number of inconsistencies in the cfg while dynamic is scaled by the
      profile - I think in order to keep eye on optimizers the first number is quite
      relevant. WHile when tracking why code quality regressed the second number
      matters more.
      
      2021-11-28  Jan Hubicka  <hubicka@ucw.cz>
      
      	* cfghooks.c: Include sreal.h, profile.h.
      	(profile_record_check_consistency): Fix checking of count counsistency;
      	record also dynamic mismatches.
      	* cfgrtl.c (rtl_account_profile_record): Similarly.
      	* tree-cfg.c (gimple_account_profile_record): Likewise.
      	* cfghooks.h (struct profile_record): Remove num_mismatched_freq_in,
      	num_mismatched_freq_out, turn time to double, add
      	dyn_mismatched_prob_out, dyn_mismatched_count_in,
      	num_mismatched_prob_out; remove num_mismatched_count_out.
      	* passes.c (account_profile_1): New function.
      	(account_profile_in_list): New function.
      	(pass_manager::dump_profile_report): Rewrite.
      	(execute_one_ipa_transform_pass): Check profile consistency after
      	running all passes.
      	(execute_all_ipa_transforms): Remove cfun test; record all transform
      	methods.
      	(execute_one_pass): Fix collecting of profile stats.
      d1471457
    • Jakub Jelinek's avatar
      libstdc++: Implement std::byteswap for C++23 · 7393fa8b
      Jakub Jelinek authored
      This patch attempts to implement P1272R4 (except for the std::bit_cast
      changes in there which seem quite unrelated to this and will need to be
      fixed on the compiler side).
      While at least for GCC __builtin_bswap{16,32,64,128} should work fine
      in constant expressions, I wonder about other compilers, so I'm using
      a fallback implementation for constexpr evaluation always.
      If you think that is unnecessary, I can drop the
      __cpp_if_consteval >= 202106L &&
      if !consteval
        {
      and
        }
      and reformat.
      The fallback implementation is an attempt to make it work even for integral
      types that don't have number of bytes divisible by 2 or when __CHAR_BIT__
      is e.g. 16.
      
      2021-11-28  Jakub Jelinek  <jakub@redhat.com>
      
      	* include/std/bit (__cpp_lib_byteswap, byteswap): Define.
      	* include/std/version (__cpp_lib_byteswap): Define.
      	* testsuite/26_numerics/bit/bit.byteswap/byteswap.cc: New test.
      	* testsuite/26_numerics/bit/bit.byteswap/version.cc: New test.
      7393fa8b
    • Martin Liska's avatar
      d: fix thinko in optimize attr parsing · 7a66c490
      Martin Liska authored
      gcc/d/ChangeLog:
      
      	* d-attribs.cc (parse_optimize_options): Fix thinko.
      7a66c490
    • GCC Administrator's avatar
      Daily bump. · d62c8c74
      GCC Administrator authored
      d62c8c74
  3. Nov 27, 2021
    • John David Anglin's avatar
      Fix typo in t-dimode · 14dd0921
      John David Anglin authored
      2021-11-27  John David Anglin  <danglin@gcc.gnu.org>
      
      libgcc/ChangeLog:
      
      	* config/pa/t-dimode (lib2difuncs): Fix typo.
      14dd0921
    • Petter Tomner's avatar
      jit: Change printf specifiers for size_t to %zu · 1e534084
      Petter Tomner authored
      Change four occurances of %ld specifier for size_t to %zu for clean 32bit builds.
      
      Signed-off-by
      2021-11-27	Petter Tomner	<tomner@kth.se>
      
      gcc/jit/
      	* libgccjit.c: %ld -> %zu
      1e534084
    • Jakub Jelinek's avatar
      x86: Fix up x86_{,64_}sh{l,r}d patterns [PR103431] · f7e4f57f
      Jakub Jelinek authored
      The following testcase is miscompiled because the x86_{,64_}sh{l,r}d
      patterns don't properly describe what the instructions do.  One thing
      is left out, in particular that there is initial count &= 63 for
      sh{l,r}dq and initial count &= 31 for sh{l,r}d{l,w}.  And another thing
      not described properly, in particular the behavior when count (after the
      masking) is 0.  The pattern says it is e.g.
      res = (op0 << op2) | (op1 >> (64 - op2))
      but that triggers UB on op1 >> 64.  For op2 0 we actually want
      res = (op0 << op2) | 0
      When constants are propagated to these patterns during RTL optimizations,
      both such problems trigger wrong-code issues.
      This patch represents the patterns as e.g.
      res = (op0 << (op2 & 63)) | (unsigned long long) ((uint128_t) op1 >> (64 - (op2 & 63)))
      so there is both the initial masking and op2 == 0 behavior results in
      zero being ored.
      The patch introduces alternate patterns for constant op2 where
      simplify-rtx.c will fold those expressions into simple numbers,
      and define_insn_and_split pre-reload splitter for how the patterns
      looked before into the new form, so that it can pattern match during
      combine even computations that assumed the shift amount will be in
      the range of 1 .. bitsize-1.
      
      2021-11-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/103431
      	* config/i386/i386.md (x86_64_shld, x86_shld, x86_64_shrd, x86_shrd):
      	Change insn pattern to accurately describe the instructions.
      	(*x86_64_shld_1, *x86_shld_1, *x86_64_shrd_1, *x86_shrd_1): New
      	define_insn patterns.
      	(*x86_64_shld_2, *x86_shld_2, *x86_64_shrd_2, *x86_shrd_2): New
      	define_insn_and_split patterns.
      	(*ashl<dwi>3_doubleword_mask, *ashl<dwi>3_doubleword_mask_1,
      	*<insn><dwi>3_doubleword_mask, *<insn><dwi>3_doubleword_mask_1,
      	ix86_rotl<dwi>3_doubleword, ix86_rotr<dwi>3_doubleword): Adjust
      	splitters for x86_{,64_}sh{l,r}d pattern changes.
      
      	* gcc.dg/pr103431.c: New test.
      f7e4f57f
    • Jakub Jelinek's avatar
      bswap: Fix UB in find_bswap_or_nop_finalize [PR103435] · 567d5f3d
      Jakub Jelinek authored
      On gcc.c-torture/execute/pr103376.c in the following code we trigger UB
      in the compiler.  n->range is 8 because it is 64-bit load and rsize is 0
      because it is a bswap sequence with load and known to be 0:
        /* Find real size of result (highest non-zero byte).  */
        if (n->base_addr)
          for (tmpn = n->n, rsize = 0; tmpn; tmpn >>= BITS_PER_MARKER, rsize++);
        else
          rsize = n->range;
      The shifts then shift uint64_t by 64 bits.  For this case mask is 0
      and we want both *cmpxchg and *cmpnop as 0, the operation can be done as
      both nop and bswap and callers will prefer nop.
      
      2021-11-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/103435
      	* gimple-ssa-store-merging.c (find_bswap_or_nop_finalize): Avoid UB if
      	n->range - rsize == 8, just clear both *cmpnop and *cmpxchg in that
      	case.
      567d5f3d
    • Roger Sayle's avatar
      [Committed] Fix new ivopts-[89].c test cases for -m32. · d9c8a023
      Roger Sayle authored
      2021-11-27  Roger Sayle  <roger@nextmovesoftware.com>
      
      gcc/testsuite/ChangeLog
      	* gcc.dg/tree-ssa/ivopts-8.c: Fix new test case for -m32.
      	* gcc.dg/tree-ssa/ivopts-9.c: Likewise.
      d9c8a023
    • GCC Administrator's avatar
      Daily bump. · f4ed2e3a
      GCC Administrator authored
      f4ed2e3a
    • Martin Jambor's avatar
      ipa: Fix CFG fix-up in IPA-CP transform phase (PR 103441) · 9e2e4739
      Martin Jambor authored
      I forgot that IPA passes before ipa-inline must not return
      TODO_cleanup_cfg from their transformation function because ordinary
      CFG cleanup does not remove call graph edges associated with removed
      call statements but must use
      delete_unreachable_blocks_update_callgraph instead.  This patch fixes
      that error.
      
      gcc/ChangeLog:
      
      2021-11-26  Martin Jambor  <mjambor@suse.cz>
      
      	PR ipa/103441
      	* ipa-prop.c (ipcp_transform_function): Call
      	delete_unreachable_blocks_update_callgraph instead of returning
      	TODO_cleanup_cfg.
      9e2e4739
  4. Nov 26, 2021
    • Jonathan Wakely's avatar
      libstdc++: Fix test that fails in C++20 mode · 52b76943
      Jonathan Wakely authored
      This test was written to verify that the LWG 3265 changes work. But
      those changes were superseded by LWG 3435, and the test is now incorrect
      according to the current draft. The assignment operator is now
      constrained to also require convertibility, which makes the test fail.
      
      Change the Iter type to be convertible from int*, but make it throw an
      exception if that conversion is used. Change the test from compile-only
      to run, so we verify that the exception isn't thrown.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/24_iterators/move_iterator/dr3265.cc: Fix test to
      	account for LWG 3435 resolution.
      52b76943
    • Jonathan Wakely's avatar
      libstdc++: Fix trivial relocation for constexpr std::vector · 33adfd0d
      Jonathan Wakely authored
      When implementing constexpr std::vector I added a check for constant
      evaluation in vector::_S_use_relocate(), so that we would not try to relocate
      trivial objects by using memmove. But I put it in the constexpr function
      that decides whether to relocate or not, and calls to that function are
      always constant evaluated. This had the effect of disabling relocation
      entirely, even in non-constexpr vectors.
      
      This removes the check in _S_use_relocate() and modifies the actual
      relocation algorithm, __relocate_a_1, to use the non-trivial
      implementation instead of memmove when called during constant
      evaluation.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stl_uninitialized.h (__relocate_a_1): Do not use
      	memmove during constant evaluation.
      	* include/bits/stl_vector.h (vector::_S_use_relocate()): Do not
      	check is_constant_evaluated in always-constexpr function.
      33adfd0d
    • Jonathan Wakely's avatar
      libstdc++: Remove workaround for FE bug in std::tuple [PR96592] · 76c6be48
      Jonathan Wakely authored
      The FE bug was fixed, so we don't need this workaround now.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/96592
      	* include/std/tuple (tuple::is_constructible): Remove.
      76c6be48
    • Harald Anlauf's avatar
      Fortran: improve check of arguments to the RESHAPE intrinsic · 4d540c7a
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/103411
      	* check.c (gfc_check_reshape): Improve check of size of source
      	array for the RESHAPE intrinsic against the given shape when pad
      	is not given, and shape is a parameter.  Try other simplifications
      	of shape.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/103411
      	* gfortran.dg/pr68153.f90: Adjust test to improved check.
      	* gfortran.dg/reshape_7.f90: Likewise.
      	* gfortran.dg/reshape_9.f90: New test.
      4d540c7a
    • Iain Sandoe's avatar
      libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF. · caa04517
      Iain Sandoe authored
      
      Recent improvements to null address warnings notice that for
      targets that do not support HAVE_ELF_STYLE_WEAKREF the dummy stub
      implementation of __cxa_get_globals() means that the address can
      never be null.
      
      Fixed by removing the test for such targets.
      
      Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
      
      libitm/ChangeLog:
      
      	* eh_cpp.cc (GTM::gtm_thread::init_cpp_exceptions): If the
      	target does not support HAVE_ELF_STYLE_WEAKREF then do not
      	try to test the __cxa_get_globals against NULL.
      caa04517
    • Siddhesh Poyarekar's avatar
      tree-object-size: Abstract object_sizes array · 4a200759
      Siddhesh Poyarekar authored
      
      Put all accesses to object_sizes behind functions so that we can add
      dynamic capability more easily.
      
      gcc/ChangeLog:
      
      	* tree-object-size.c (object_sizes_grow, object_sizes_release,
      	object_sizes_unknown_p, object_sizes_get, object_size_set_force,
      	object_sizes_set): New functions.
      	(addr_object_size, compute_builtin_object_size,
      	expr_object_size, call_object_size, unknown_object_size,
      	merge_object_sizes, plus_stmt_object_size,
      	cond_expr_object_size, collect_object_sizes_for,
      	check_for_plus_in_loops_1, init_object_sizes,
      	fini_object_sizes): Adjust.
      
      Signed-off-by: default avatarSiddhesh Poyarekar <siddhesh@gotplt.org>
      4a200759
    • Siddhesh Poyarekar's avatar
      tree-object-size: Replace magic numbers with enums · 35c8bbe9
      Siddhesh Poyarekar authored
      
      A simple cleanup to allow inserting dynamic size code more easily.
      
      gcc/ChangeLog:
      
      	* tree-object-size.c: New enum.
      	(object_sizes, computed, addr_object_size,
      	compute_builtin_object_size, expr_object_size, call_object_size,
      	merge_object_sizes, plus_stmt_object_size,
      	collect_object_sizes_for, init_object_sizes, fini_object_sizes,
      	object_sizes_execute): Replace magic numbers with enums.
      
      Signed-off-by: default avatarSiddhesh Poyarekar <siddhesh@gotplt.org>
      35c8bbe9
    • Roger Sayle's avatar
      ivopts: Improve code generated for very simple loops. · b41be002
      Roger Sayle authored
      This patch tidies up the code that GCC generates for simple loops,
      by selecting/generating a simpler loop bound expression in ivopts.
      The original motivation came from looking at the following loop (from
      gcc.target/i386/pr90178.c)
      
      int *find_ptr (int* mem, int sz, int val)
      {
        for (int i = 0; i < sz; i++)
          if (mem[i] == val)
            return &mem[i];
        return 0;
      }
      
      which GCC currently compiles to:
      
      find_ptr:
              movq    %rdi, %rax
              testl   %esi, %esi
              jle     .L4
              leal    -1(%rsi), %ecx
              leaq    4(%rdi,%rcx,4), %rcx
              jmp     .L3
      .L7:    addq    $4, %rax
              cmpq    %rcx, %rax
              je      .L4
      .L3:    cmpl    %edx, (%rax)
              jne     .L7
              ret
      .L4:    xorl    %eax, %eax
              ret
      
      Notice the relatively complex leal/leaq instructions, that result
      from ivopts using the following expression for the loop bound:
      inv_expr 2:     ((unsigned long) ((unsigned int) sz_8(D) + 4294967295)
      		* 4 + (unsigned long) mem_9(D)) + 4
      
      which results from NITERS being (unsigned int) sz_8(D) + 4294967295,
      i.e. (sz - 1), and the logic in cand_value_at determining the bound
      as BASE + NITERS*STEP at the start of the final iteration and as
      BASE + NITERS*STEP + STEP at the end of the final iteration.
      
      Ideally, we'd like the middle-end optimizers to simplify
      BASE + NITERS*STEP + STEP as BASE + (NITERS+1)*STEP, especially
      when NITERS already has the form BOUND-1, but with type conversions
      and possible overflow to worry about, the above "inv_expr 2" is the
      best that can be done by fold (without additional context information).
      
      This patch improves ivopts' cand_value_at by instead of using just
      the tree expression for NITERS, passing the data structure that
      explains how that expression was derived.  This allows us to peek
      under the surface to check that NITERS+1 doesn't overflow, and in
      this patch to use the SSA_NAME already holding the required value.
      
      In the motivating loop above, inv_expr 2 now becomes:
      (unsigned long) sz_8(D) * 4 + (unsigned long) mem_9(D)
      
      And as a result, on x86_64 we now generate:
      
      find_ptr:
              movq    %rdi, %rax
              testl   %esi, %esi
              jle     .L4
              movslq  %esi, %rsi
              leaq    (%rdi,%rsi,4), %rcx
              jmp     .L3
      .L7:    addq    $4, %rax
              cmpq    %rcx, %rax
              je      .L4
      .L3:    cmpl    %edx, (%rax)
              jne     .L7
              ret
      .L4:    xorl    %eax, %eax
              ret
      
      This improvement required one minor tweak to GCC's testsuite for
      gcc.dg/wrapped-binop-simplify.c, where we again generate better
      code, and therefore no longer find as many optimization opportunities
      in later passes (vrp2).
      
      Previously:
      
      void v1 (unsigned long *in, unsigned long *out, unsigned int n)
      {
        int i;
        for (i = 0; i < n; i++) {
          out[i] = in[i];
        }
      }
      
      on x86_64 generated:
      v1:	testl   %edx, %edx
              je      .L1
              movl    %edx, %edx
              xorl    %eax, %eax
      .L3:	movq    (%rdi,%rax,8), %rcx
              movq    %rcx, (%rsi,%rax,8)
              addq    $1, %rax
              cmpq    %rax, %rdx
              jne     .L3
      .L1:	ret
      
      and now instead generates:
      v1:	testl   %edx, %edx
              je      .L1
              movl    %edx, %edx
              xorl    %eax, %eax
              leaq    0(,%rdx,8), %rcx
      .L3:	movq    (%rdi,%rax), %rdx
              movq    %rdx, (%rsi,%rax)
              addq    $8, %rax
              cmpq    %rax, %rcx
              jne     .L3
      .L1:	ret
      
      2021-11-26  Roger Sayle  <roger@nextmovesoftware.com>
      
      gcc/ChangeLog
      	* tree-ssa-loop-ivopts.c (cand_value_at): Take a class
      	tree_niter_desc* argument instead of just a tree for NITER.
      	If we require the iv candidate value at the end of the final
      	loop iteration, try using the original loop bound as the
      	NITER for sufficiently simple loops.
      	(may_eliminate_iv): Update (only) call to cand_value_at.
      
      gcc/testsuite/ChangeLog
      	* gcc.dg/wrapped-binop-simplify.c: Update expected test result.
      	* gcc.dg/tree-ssa/ivopts-5.c: New test case.
      	* gcc.dg/tree-ssa/ivopts-6.c: New test case.
      	* gcc.dg/tree-ssa/ivopts-7.c: New test case.
      	* gcc.dg/tree-ssa/ivopts-8.c: New test case.
      	* gcc.dg/tree-ssa/ivopts-9.c: New test case.
      b41be002
    • Jonathan Wakely's avatar
      libstdc++: Ensure dg-add-options comes after dg-options · 665f726b
      Jonathan Wakely authored
      This is what the docs say is required.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/29_atomics/atomic_float/1.cc: Reorder directives.
      665f726b
    • Jonathan Wakely's avatar
      libstdc++: Fix dg-do directive for tests supposed to be run · 0a12bd92
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* testsuite/23_containers/unordered_map/modifiers/move_assign.cc:
      	Change dg-do compile to run.
      	* testsuite/27_io/basic_istream/extractors_character/wchar_t/lwg2499.cc:
      	Likewise.
      0a12bd92
    • Jonathan Wakely's avatar
      libstdc++: Remove redundant xfail selectors in dg-do compile tests · 1ecc9ba5
      Jonathan Wakely authored
      An 'xfail' selector means the test is expected to fail at runtime, so is
      ignored for a compile-only test. The way to mark a compile-only test as
      failing is with dg-error (which these already do).
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc:
      	Remove xfail selector.
      	* testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc:
      	Likewise.
      	Likewise.
      	* testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc:
      	Likewise.
      	* testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc:
      	Likewise.
      	* testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc:
      	Likewise.
      	* testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc:
      	Likewise.
      	* testsuite/23_containers/span/101411.cc: Likewise.
      	* testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Likewise.
      	* testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/equal/constexpr_neg.cc: Likewise.
      	* testsuite/25_algorithms/equal/debug/constexpr_neg.cc: Likewise.
      	* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc:
      	Likewise.
      	* testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc:
      	Likewise.
      1ecc9ba5
    • Martin Liska's avatar
      d: fix ASAN in option processing · f1ec39c8
      Martin Liska authored
      Fixes:
      
      ==129444==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000666ca5c at pc 0x000000ef094b bp 0x7fffffff8180 sp 0x7fffffff8178
      READ of size 4 at 0x00000666ca5c thread T0
          #0 0xef094a in parse_optimize_options ../../gcc/d/d-attribs.cc:855
          #1 0xef0d36 in d_handle_optimize_attribute ../../gcc/d/d-attribs.cc:916
          #2 0xef107e in d_handle_optimize_attribute ../../gcc/d/d-attribs.cc:887
          #3 0xff85b1 in decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../gcc/attribs.c:829
          #4 0xef2a91 in apply_user_attributes(Dsymbol*, tree_node*) ../../gcc/d/d-attribs.cc:427
          #5 0xf7b7f3 in get_symbol_decl(Declaration*) ../../gcc/d/decl.cc:1346
          #6 0xf87bc7 in get_symbol_decl(Declaration*) ../../gcc/d/decl.cc:967
          #7 0xf87bc7 in DeclVisitor::visit(FuncDeclaration*) ../../gcc/d/decl.cc:808
          #8 0xf83db5 in DeclVisitor::build_dsymbol(Dsymbol*) ../../gcc/d/decl.cc:146
      
      for the following test-case: gcc/testsuite/gdc.dg/attr_optimize1.d.
      
      gcc/d/ChangeLog:
      
      	* d-attribs.cc (parse_optimize_options): Check index before
      	accessing cl_options.
      f1ec39c8
    • Jan Hubicka's avatar
      Minor ipa-modref tweaks · 2cadaa1f
      Jan Hubicka authored
      To make dumps easier to read modref now dumps cgraph_node name rather then
      cfun name in function being analysed and I also fixed minor issue with ECF
      flags merging when updating inline summary.
      
      gcc/ChangeLog:
      
      2021-11-26  Jan Hubicka  <hubicka@ucw.cz>
      
      	* ipa-modref.c (analyze_function): Drop parameter F and dump
      	cgraph node name rather than cfun name.
      	(modref_generate): Update.
      	(modref_summaries::insert):Update.
      	(modref_summaries_lto::insert):Update.
      	(pass_modref::execute):Update.
      	(ipa_merge_modref_summary_after_inlining): Improve combining of
      	ECF_FLAGS.
      2cadaa1f
    • Jan Hubicka's avatar
      Fix failure in inlline-9.c testcase · 906cad89
      Jan Hubicka authored
      gcc/testsuite/ChangeLog:
      
      2021-11-26  Jan Hubicka  <hubicka@ucw.cz>
      
      	* gcc.dg/ipa/inline-9.c: Update template.c
      906cad89
    • Jonathan Wakely's avatar
      libstdc++: Move std::to_address tests to more appropriate place · 0178b73a
      Jonathan Wakely authored
      Some of the checks in 20_util/pointer_traits/lwg3545.cc really belong in
      20_util/to_address/lwg3545 instead.
      
      This also fixes the ordering of the dg-options and dg-do directives.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/pointer_traits/lwg3545.cc: Move to_address
      	tests to ...
      	* testsuite/20_util/to_address/lwg3545.cc: ... here. Add -std
      	option before checking effective target.
      0178b73a
    • Jan Hubicka's avatar
      Fix handling of in_flags in update_escape_summary_1 · a70faf6e
      Jan Hubicka authored
      update_escape_summary_1 has thinko where it compues proper min_flags but then
      stores original value (ignoring the fact whether there was a dereference
      in the escape point).
      
      	PR ipa/102943
      	* ipa-modref.c (update_escape_summary_1): Fix handling of min_flags.
      a70faf6e
    • Jakub Jelinek's avatar
      c++: Fix up taking address of an immediate function diagnostics [PR102753] · 8dedf065
      Jakub Jelinek authored
      On Wed, Oct 20, 2021 at 07:16:44PM -0400, Jason Merrill wrote:
      > or an unevaluated operand, or a subexpression of an immediate invocation.
      >
      > Hmm...that suggests that in consteval23.C, bar(foo) should also be OK,
      
      The following patch handles that by removing the diagnostics about taking
      address of immediate function from cp_build_addr_expr_1, and instead diagnoses
      it in cp_fold_r.  To do that with proper locations, the patch attempts to
      ensure that ADDR_EXPRs of immediate functions get EXPR_LOCATION set and
      adds a PTRMEM_CST_LOCATION for PTRMEM_CSTs.  Also, evaluation of
      std::source_location::current() is moved from genericization to cp_fold.
      
      2021-11-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/102753
      	* cp-tree.h (struct ptrmem_cst): Add locus member.
      	(PTRMEM_CST_LOCATION): Define.
      	* tree.c (make_ptrmem_cst): Set PTRMEM_CST_LOCATION to input_location.
      	(cp_expr_location): Return PTRMEM_CST_LOCATION for PTRMEM_CST.
      	* typeck.c (build_x_unary_op): Overwrite PTRMEM_CST_LOCATION for
      	PTRMEM_CST instead of calling maybe_wrap_with_location.
      	(cp_build_addr_expr_1): Don't diagnose taking address of
      	immediate functions here.  Instead when taking their address make
      	sure the returned ADDR_EXPR has EXPR_LOCATION set.
      	(expand_ptrmemfunc_cst): Copy over PTRMEM_CST_LOCATION to ADDR_EXPR's
      	EXPR_LOCATION.
      	(convert_for_assignment): Use cp_expr_loc_or_input_loc instead of
      	EXPR_LOC_OR_LOC.
      	* pt.c (tsubst_copy): Use build1_loc instead of build1.  Ensure
      	ADDR_EXPR of immediate function has EXPR_LOCATION set.
      	* cp-gimplify.c (cp_fold_r): Diagnose taking address of immediate
      	functions here.  For consteval if don't walk THEN_CLAUSE.
      	(cp_genericize_r): Move evaluation of calls to
      	std::source_location::current from here to...
      	(cp_fold): ... here.  Don't assert calls to immediate functions must
      	be source_location_current_p, instead only constant evaluate
      	calls to source_location_current_p.
      
      	* g++.dg/cpp2a/consteval20.C: Add some extra tests.
      	* g++.dg/cpp2a/consteval23.C: Likewise.
      	* g++.dg/cpp2a/consteval25.C: New test.
      	* g++.dg/cpp2a/srcloc20.C: New test.
      8dedf065
    • konglin1's avatar
      i386: vcvtph2ps and vcvtps2ph should be used to convert _Float16 to SFmode with -mf16c [PR 102811] · 90cb088e
      konglin1 authored
      Add define_insn extendhfsf2 and truncsfhf2 for target_f16c.
      
      gcc/ChangeLog:
      
      	PR target/102811
      	* config/i386/i386.c (ix86_can_change_mode_class): Allow 16 bit data in XMM register
      	for TARGET_SSE2.
      	* config/i386/i386.md (extendhfsf2): Add extenndhfsf2 for TARGET_F16C.
      	(extendhfdf2): Restrict extendhfdf for TARGET_AVX512FP16 only.
      	(*extendhf<mode>2): Rename from extendhf<mode>2.
      	(truncsfhf2): Likewise.
      	(truncdfhf2): Likewise.
      	(*trunc<mode>2): Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/102811
      	* gcc.target/i386/pr90773-21.c: Allow pextrw instead of movw.
      	* gcc.target/i386/pr90773-23.c: Ditto.
      	* gcc.target/i386/avx512vl-vcvtps2ph-pr102811.c: New test.
      90cb088e
    • liuhongt's avatar
      Fix typo in r12-5486. · 379be00f
      liuhongt authored
      gcc/ChangeLog:
      
      	PR middle-end/103419
      	* match.pd: Fix typo, use the type of second parameter, not
      	first one.
      379be00f
    • GCC Administrator's avatar
      Daily bump. · 091ccc06
      GCC Administrator authored
      091ccc06
  5. Nov 25, 2021
    • Jonathan Wakely's avatar
      libstdc++: Remove dg-error that no longer happens · 9664c465
      Jonathan Wakely authored
      There was a c++11_only dg-error in this testcase, for a "body of
      constexpr function is not a return statement" diagnostic that was bogus,
      but happened because the return statement was ill-formed. A change to
      G++ earlier this month means that diagnostic is no longer emitted, so
      remove the dg-error.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/tuple/comparison_operators/overloaded2.cc:
      	Remove dg-error for C++11_only error.
      9664c465
    • Jonathan Wakely's avatar
      libstdc++: Make std::pointer_traits SFINAE-friendly [PR96416] · b8018e5c
      Jonathan Wakely authored
      This implements the resolution I'm proposing for LWG 3545, to avoid hard
      errors when using std::to_address for types that make pointer_traits
      ill-formed.
      
      Consistent with std::iterator_traits, instantiating std::pointer_traits
      for a non-pointer type will be well-formed, but give an empty type with
      no member types. This avoids the problematic cases for std::to_address.
      Additionally, the pointer_to member is now only declared when the
      element type is not cv void (and for C++20, when the function body would
      be well-formed). The rebind member was already SFINAE-friendly in our
      implementation.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/96416
      	* include/bits/ptr_traits.h (pointer_traits): Reimplement to be
      	SFINAE-friendly (LWG 3545).
      	* testsuite/20_util/pointer_traits/lwg3545.cc: New test.
      	* testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line.
      	* testsuite/20_util/to_address/lwg3545.cc: New test.
      b8018e5c
    • Jan Hubicka's avatar
      Remove forgotten early return in ipa_value_range_from_jfunc · 1b0acc4b
      Jan Hubicka authored
      gcc/ChangeLog:
      
      	* ipa-cp.c (ipa_value_range_from_jfunc): Remove forgotten early return.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/ipa/inline10.c: New test.
      1b0acc4b
Loading