Skip to content
Snippets Groups Projects
  1. Feb 02, 2024
  2. Feb 01, 2024
    • Marek Polacek's avatar
      c++: -Wdangling-reference tweak to unbreak aarch64 · 8efcdbf5
      Marek Polacek authored
      My recent -Wdangling-reference change to not warn on std::span-like classes
      unfortunately caused a new warning: extending reference_like_class_p also
      opens the door to new warnings since we use reference_like_class_p for
      checking the return type of the function: either it must be a reference
      or a reference_like_class_p.
      
      We can consider even non-templates as std::span-like to get rid of the
      warning here.
      
      gcc/cp/ChangeLog:
      
      	* call.cc (reference_like_class_p): Consider even non-templates for
      	std::span-like classes.
      
      gcc/ChangeLog:
      
      	* doc/invoke.texi: Update -Wdangling-reference documentation.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/warn/Wdangling-reference21.C: New test.
      8efcdbf5
    • Uros Bizjak's avatar
      i386: Improve *cmp<dwi>_doubleword splitter [PR113701] · 44764984
      Uros Bizjak authored
      The fix for PR70321 introduced a splitter that split a doubleword
      comparison into a pair of XORs followed by an IOR to set the (zero)
      flags register.  To help the reload, splitter forced SUBREG pieces of
      double-word input values to a pseudo, but this regressed
      gcc.target/i386/pr82580.c:
      
      int f0 (U x, U y) { return x == y; }
      
      from:
      	xorq    %rdx, %rdi
      	xorq    %rcx, %rsi
      	xorl    %eax, %eax
      	orq     %rsi, %rdi
      	sete    %al
      	ret
      
      to:
      	xchgq   %rdi, %rsi
      	movq    %rdx, %r8
      	movq    %rcx, %rax
      	movq    %rsi, %rdx
      	movq    %rdi, %rcx
      	xorq    %rax, %rcx
      	xorq    %r8, %rdx
      	xorl    %eax, %eax
      	orq     %rcx, %rdx
      	sete    %al
      	ret
      
      To mitigate the regression, remove this legacy heuristic (workaround?).
      There have been many incremental changes and improvements to x86 TImode
      and register allocation, so this legacy workaround is not only no longer
      useful, but it actually hurts register allocation.  The patched compiler
      now produces:
      
              xchgq   %rdi, %rsi
              xorl    %eax, %eax
              xorq    %rsi, %rdx
              xorq    %rdi, %rcx
              orq     %rcx, %rdx
              sete    %al
              ret
      
      	PR target/113701
      
      gcc/ChangeLog:
      
      	* config/i386/i386.md (*cmp<dwi>_doubleword):
      	Do not force SUBREG pieces to pseudos.
      44764984
    • Jakub Jelinek's avatar
      libgcc: Avoid warnings on __gcc_nested_func_ptr_created [PR113402] · e9b2f15d
      Jakub Jelinek authored
      I'm seeing hundreds of
      In file included from ../../../libgcc/libgcc2.c:56:
      ../../../libgcc/libgcc2.h:32:13: warning: conflicting types for built-in function ‘__gcc_nested_func_ptr_created’; expected ‘void(void *, void *, void *)’
      +[-Wbuiltin-declaration-mismatch]
         32 | extern void __gcc_nested_func_ptr_created (void *, void *, void **);
            |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warnings.
      
      Either we need to add like in r14-6218
        #pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
      (but in that case because of the libgcc2.h prototype (why is it there?)
      it would need to be also with #pragma GCC diagnostic push/pop around),
      or we could go with just following how the builtins are prototyped on the
      compiler side and only cast to void ** when dereferencing (which is in
      a single spot in each TU).
      
      2024-02-01  Jakub Jelinek  <jakub@redhat.com>
      
      	PR libgcc/113402
      	* libgcc2.h (__gcc_nested_func_ptr_created): Change type of last
      	argument from void ** to void *.
      	* config/i386/heap-trampoline.c (__gcc_nested_func_ptr_created):
      	Change type of dst from void ** to void * and cast dst to void **
      	before dereferencing it.
      	* config/aarch64/heap-trampoline.c (__gcc_nested_func_ptr_created):
      	Likewise.
      e9b2f15d
    • Jakub Jelinek's avatar
      libgcc: Fix up i386/t-heap-trampoline [PR113403] · 03519175
      Jakub Jelinek authored
      I'm seeing
      ../../../libgcc/shared-object.mk:14: warning: overriding recipe for target 'heap-trampoline.o'
      ../../../libgcc/shared-object.mk:14: warning: ignoring old recipe for target 'heap-trampoline.o'
      ../../../libgcc/shared-object.mk:17: warning: overriding recipe for target 'heap-trampoline_s.o'
      ../../../libgcc/shared-object.mk:17: warning: ignoring old recipe for target 'heap-trampoline_s.o'
      
      This patch fixes that.
      
      2024-02-01  Jakub Jelinek  <jakub@redhat.com>
      
      	PR libgcc/113403
      	* config/i386/t-heap-trampoline: Add to LIB2ADDEHSHARED
      	i386/heap-trampoline.c rather than aarch64/heap-trampoline.c.
      03519175
    • Patrick Palka's avatar
      libstdc++: Implement P2165R4 changes to std::pair/tuple/etc [PR113309] · 65b4cba9
      Patrick Palka authored
      
      This implements the C++23 paper P2165R4 Compatibility between tuple,
      pair and tuple-like objects, which builds upon many changes from the
      earlier C++23 paper P2321R2 zip.
      
      Some declarations had to be moved around so that they're visible from
      <bits/stl_pair.h> without introducing new includes and bloating the
      header.  In the end, the only new include is for <bits/utility.h> from
      <bits/stl_iterator.h>, for tuple_element_t.
      
      	PR libstdc++/113309
      	PR libstdc++/109203
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_util.h (__detail::__pair_like): Don't
      	define in C++23 mode.
      	(__detail::__pair_like_convertible_from): Adjust as per P2165R4.
      	(__detail::__is_subrange<subrange>): Moved from <ranges>.
      	(__detail::__is_tuple_like_v<subrange>): Likewise.
      	* include/bits/stl_iterator.h: Include <bits/utility.h> for
      	C++23.
      	(__different_from): Move to <concepts>.
      	(__iter_key_t): Adjust for C++23 as per P2165R4.
      	(__iter_val_t): Likewise.
      	* include/bits/stl_pair.h (pair, array): Forward declare.
      	(get): Forward declare all overloads relevant to P2165R4
      	tuple-like constructors.
      	(__is_tuple_v): Define for C++23.
      	(__is_tuple_like_v): Define for C++23.
      	(__tuple_like): Define for C++23 as per P2165R4.
      	(__pair_like): Define for C++23 as per P2165R4.
      	(__eligibile_tuple_like): Define for C++23.
      	(__eligibile_pair_like): Define for C++23.
      	(pair::_S_constructible_from_pair_like): Define for C++23.
      	(pair::_S_convertible_from_pair_like): Define for C++23.
      	(pair::_S_dangles_from_pair_like): Define for C++23.
      	(pair::pair): Define overloads taking a tuple-like type for
      	C++23 as per P2165R4.
      	(pair::_S_assignable_from_tuple_like): Define for C++23.
      	(pair::_S_const_assignable_from_tuple_like): Define for C++23.
      	(pair::operator=): Define overloads taking a tuple-like type for
      	C++23 as per P2165R4.
      	* include/bits/utility.h (ranges::__detail::__is_subrange):
      	Moved from <ranges>.
      	* include/bits/version.def (tuple_like): Define for C++23.
      	* include/bits/version.h: Regenerate.
      	* include/std/concepts (__different_from): Moved from
      	<bits/stl_iterator.h>.
      	(ranges::__swap::__adl_swap): Clarify which __detail namespace.
      	* include/std/map (__cpp_lib_tuple_like): Define C++23.
      	* include/std/ranges (__detail::__is_subrange): Moved to
      	<bits/utility.h>.
      	(__detail::__is_subrange<subrange>): Moved to <bits/ranges_util.h>
      	(__detail::__has_tuple_element): Adjust for C++23 as per P2165R4.
      	(__detail::__tuple_or_pair): Remove as per P2165R4.  Replace all
      	uses with plain tuple as per P2165R4.
      	* include/std/tuple (__cpp_lib_tuple_like): Define for C++23.
      	(__tuple_like_tag_t): Define for C++23.
      	(__tuple_cmp): Forward declare for C++23.
      	(_Tuple_impl::_Tuple_impl): Define overloads taking
      	__tuple_like_tag_t and a tuple-like type for C++23.
      	(_Tuple_impl::_M_assign): Likewise.
      	(tuple::__constructible_from_tuple_like): Define for C++23.
      	(tuple::__convertible_from_tuple_like): Define for C++23.
      	(tuple::__dangles_from_tuple_like): Define for C++23.
      	(tuple::tuple): Define overloads taking a tuple-like type for
      	C++23 as per P2165R4.
      	(tuple::__assignable_from_tuple_like): Define for C++23.
      	(tuple::__const_assignable_from_tuple_like): Define for C++23.
      	(tuple::operator=): Define overloads taking a tuple-like type
      	for C++23 as per P2165R4.
      	(tuple::__tuple_like_common_comparison_category): Define for C++23.
      	(tuple::operator<=>): Define overload taking a tuple-like type
      	for C++23 as per P2165R4.
      	(array, get): Forward declarations moved to <bits/stl_pair.h>.
      	(tuple_cat): Constrain with __tuple_like for C++23 as per P2165R4.
      	(apply): Likewise.
      	(make_from_tuple): Likewise.
      	(__tuple_like_common_reference): Define for C++23.
      	(basic_common_reference): Adjust as per P2165R4.
      	(__tuple_like_common_type): Define for C++23.
      	(common_type): Adjust as per P2165R4.
      	* include/std/unordered_map (__cpp_lib_tuple_like): Define for
      	C++23.
      	* include/std/utility (__cpp_lib_tuple_like): Define for C++23.
      	* testsuite/std/ranges/zip/1.cc (test01): Adjust to handle pair
      	and 2-tuple interchangeably.
      	(test05): New test.
      	* testsuite/20_util/pair/p2165r4.cc: New test.
      	* testsuite/20_util/tuple/p2165r4.cc: New test.
      
      Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
      65b4cba9
    • Patrick Palka's avatar
      libstdc++/pair: Factor out const-assignability helper for C++20 · 87d16238
      Patrick Palka authored
      
      This is consistent with std::tuple's __const_assignable helper, and will
      be useful for implementing the new pair::operator= overloads from P2165R4.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stl_pair.h (pair::_S_const_assignable): Define,
      	factored out from ...
      	(pair::operator=): ... the constraints of the const overloads.
      
      Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
      87d16238
    • John David Anglin's avatar
      Set num_threads to 50 on 32-bit hppa in two libgomp loop tests · b1420971
      John David Anglin authored
      We support a maximum of 50 threads on 32-bit hppa.
      
      2024-02-01  John David Anglin  <danglin@gcc.gnu.org>
      
      libgomp/ChangeLog:
      
      	* testsuite/libgomp.c++/loop-3.C: Set num_threads to 50
      	on 32-bit hppa.
      	* testsuite/libgomp.c/omp-loop03.c: Likewise.
      b1420971
    • John David Anglin's avatar
      xfail gnat.dg/trampoline3.adb scan-assembler-not check on hppa*-*-* · d71c7f10
      John David Anglin authored
      We still require an executable stack for trampolines on hppa*-*-*.
      
      2024-02-01  John David Anglin  <danglin@gcc.gnu.org>
      
      gcc/testsuite/ChangeLog:
      
      	* gnat.dg/trampoline3.adb: xfail scan-assembler-not
      	check on hppa*-*-*.
      d71c7f10
    • John David Anglin's avatar
      hppa: Fix bug in atomic_storedi_1 pattern · f2609475
      John David Anglin authored
      The first alternative stores the floating-point status register
      in the destination.  It should store zero.  We need to copy %fr0
      to another floating-point register to initialize it to zero.
      
      2024-02-01  John David Anglin  <danglin@gcc.gnu.org>
      
      gcc/ChangeLog:
      
      	* config/pa/pa.md (atomic_storedi_1): Fix bug in
      	alternative 1.
      f2609475
    • Patrick Palka's avatar
      c++: ttp TEMPLATE_DECL equivalence [PR112737] · 3ba5be16
      Patrick Palka authored
      
      Here during declaration matching we undesirably consider the two TT{42}
      CTAD expressions to be non-equivalent ultimately because for CTAD
      placeholder equivalence we compare the TEMPLATE_DECLs via pointer identity,
      and here the corresponding TEMPLATE_DECLs for TT are different since
      they're from different scopes.  On the other hand, the corresponding
      TEMPLATE_TEMPLATE_PARMs are deemed equivalent according to cp_tree_equal
      (since they have the same position and template parameters).  This turns
      out to be the root cause of some of the xtreme-header modules regressions.
      
      So this patch relaxes ttp CTAD placeholder equivalence accordingly, by
      comparing the TEMPLATE_TEMPLATE_PARM instead of the TEMPLATE_DECL.  It
      turns out this issue also affects function template-id equivalence as
      with g<TT> in the second testcase, so it makes sense to relax TEMPLATE_DECL
      equivalence more generally in cp_tree_equal.  In passing this patch
      improves ctp_hasher::hash for CTAD placeholders, so that they don't
      all get the same hash.
      
      	PR c++/112737
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
      	Adjust hashing to match cp_tree_equal.
      	(ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
      	* tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
      	for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
      	equivalent.
      	* typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
      	Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/template/ttp42.C: New test.
      	* g++.dg/template/ttp43.C: New test.
      
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      3ba5be16
    • Georg-Johann Lay's avatar
      AVR: Tabify avr.cc · a886a906
      Georg-Johann Lay authored
      gcc/
      	* config/avr/avr.cc: Tabify.
      a886a906
    • Richard Ball's avatar
      middle-end: Fix ICE in poly-int.h due to SLP. · 4571b4d4
      Richard Ball authored
      Adds a check to ensure that the input vector arguments
      to a function are not variable length. Previously, only the
      output vector of a function was checked.
      
      The ICE in question is within the neon-sve-bridge.c test,
      and is related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111268
      
      gcc/ChangeLog:
      	PR tree-optimization/111268
      	* tree-vect-slp.cc (vectorizable_slp_permutation_1):
      	Add variable-length check for vector input arguments
      	to a function.
      4571b4d4
    • Jonathan Wakely's avatar
      libstdc++: Do not use def-file-line for each macro in <bits/version.h> · 314cbfe2
      Jonathan Wakely authored
      These line markers are not needed, because searching <bits/version.def>
      for a macro name works fine. Removing them means that small changes to
      <bits/version.def> do not result in large diffs to <bits/version.h>
      because of all the changed line numbers.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/version.tpl: Do not use def-file-line for each
      	macro being defined.
      	* include/bits/version.h: Regenerate.
      314cbfe2
    • Jonathan Wakely's avatar
      libstdc++: Update expected error for debug/constexpr*_neg.cc tests · 52e9b708
      Jonathan Wakely authored
      We no longer hit a __builtin_unreachable() in these tests, so we need to
      update the dg-error patterns to match _Error_formatter::_M_error().
      
      We can also remove some dg-prune-output directives matching notes saying
      "in 'constexpr' expansion" because that's done globally in prune.exp.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Adjust
      	dg-error pattern.
      	* testsuite/25_algorithms/copy_backward/debug/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.
      52e9b708
    • Jonathan Wakely's avatar
      libstdc++: Fix -Wdeprecated warning about implicit capture of 'this' · e81a6975
      Jonathan Wakely authored
      In C++20 it's deprecated for a [=] lambda capture to capture the 'this'
      pointer. Using resize_and_overwrite with a lambda seems like overkill to
      write three chars to the string anyway. Just resize the string and
      overwrite the end of it directly.
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/internet (network_v4::to_string()):
      	Remove lambda and use of resize_and_overwrite.
      e81a6975
    • Thomas Schwinge's avatar
      GCN: Don't hard-code number of SGPR/VGPR/AVGPR registers · a5eb246e
      Thomas Schwinge authored
      Also add 'STATIC_ASSERT's for number of SGPR/VGPR/AVGPR registers (in
      '#ifndef USED_FOR_TARGET', as otherwise 'STATIC_ASSERT' isn't available).
      
      	gcc/
      	* config/gcn/gcn.cc (gcn_hsa_declare_function_name): Don't
      	hard-code number of SGPR/VGPR/AVGPR registers.
      	* config/gcn/gcn.h: Add a 'STATIC_ASSERT's for number of
      	SGPR/VGPR/AVGPR registers.
      a5eb246e
    • Lewis Hyatt's avatar
      libcpp: Stabilize the location for macros restored after PCH load [PR105608] · 019dc638
      Lewis Hyatt authored
      libcpp currently lacks the infrastructure to assign correct locations to
      macros that were defined prior to loading a PCH and then restored
      afterwards. While I plan to address that fully for GCC 15, this patch
      improves things by using at least a valid location, even if it's not the
      best one. Without this change, libcpp uses pfile->directive_line as the
      location for the restored macros, but this location_t applies to the old
      line map, not the one that was just restored from the PCH, so the resulting
      location is unpredictable and depends on what was stored in the line maps
      before. With this change, all restored macros get assigned locations at the
      line of the #include that triggered the PCH restore. A future patch will
      store the actual file name and line number of each definition and then
      synthesize locations in the new line map pointing to the right place.
      
      gcc/c-family/ChangeLog:
      
      	PR preprocessor/105608
      	* c-pch.cc (c_common_read_pch): Adjust line map so that libcpp
      	assigns a location to restored macros which is the same location
      	that triggered the PCH include.
      
      libcpp/ChangeLog:
      
      	PR preprocessor/105608
      	* pch.cc (cpp_read_state): Set a valid location for restored
      	macros.
      019dc638
    • Marek Polacek's avatar
      c++: ICE with throw inside concept [PR112437] · 65b105b4
      Marek Polacek authored
      We crash in the loop at the end of treat_lvalue_as_rvalue_p for code
      like
      
        template <class T>
        concept Throwable = requires(T x) { throw x; };
      
      because the code assumes that we eventually reach sk_function_parms or
      sk_try and bail, but in a concept we're in a sk_namespace.
      
      We're already checking sk_try so we don't crash in a function-try-block,
      but I've added a test anyway.
      
      	PR c++/112437
      
      gcc/cp/ChangeLog:
      
      	* typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
      	the move on throw of parms loop.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/concepts-throw1.C: New test.
      	* g++.dg/eh/throw4.C: New test.
      65b105b4
    • Monk Chiang's avatar
      RISC-V: Support scheduling for sifive p600 series · ec217f72
      Monk Chiang authored
      Add sifive p600 series scheduler module. For more information
      see https://www.sifive.com/cores/performance-p650-670.
      Add sifive-p650, sifive-p670 for mcpu option will come in separate patches.
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv.md: Add "fcvt_i2f", "fcvt_f2i" type
      	attribute, and include sifive-p600.md.
      	* config/riscv/generic-ooo.md: Update type attribute.
      	* config/riscv/generic.md: Update type attribute.
      	* config/riscv/sifive-7.md: Update type attribute.
      	* config/riscv/sifive-p600.md: New file.
      	* config/riscv/riscv-cores.def (RISCV_TUNE): Add parameter.
      	* config/riscv/riscv-opts.h (enum riscv_microarchitecture_type):
      	Add sifive_p600.
      	* config/riscv/riscv.cc (sifive_p600_tune_info): New.
      	* config/riscv/riscv.h (TARGET_SFB_ALU): Update.
      	* doc/invoke.texi (RISC-V Options): Add sifive-p600-series
      ec217f72
    • Monk Chiang's avatar
      RISC-V: Add minimal support for 7 new unprivileged extensions · 5c18df44
      Monk Chiang authored
      The RISC-V Profiles specification here:
      https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#7-new-isa-extensions
      
      These extensions don't add any new features but
      describe existing features. So this patch only adds parsing.
      
      Za64rs: Reservation set size of 64 bytes
      Za128rs: Reservation set size of 128 bytes
      Ziccif: Main memory supports instruction fetch with atomicity requirement
      Ziccrse: Main memory supports forward progress on LR/SC sequences
      Ziccamoa: Main memory supports all atomics in A
      Zicclsm: Main memory supports misaligned loads/stores
      Zic64b: Cache block size isf 64 bytes
      
      gcc/ChangeLog:
      
      	* common/config/riscv/riscv-common.cc: Add Za64rs, Za128rs,
      	Ziccif, Ziccrse, Ziccamoa, Zicclsm, Zic64b items.
      	* config/riscv/riscv.opt: New macro for 7 new unprivileged
      	extensions.
      	* doc/invoke.texi (RISC-V Options): Add Za64rs, Za128rs,
      	Ziccif, Ziccrse, Ziccamoa, Zicclsm, Zic64b extensions.
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/za-ext.c: New test.
      	* gcc.target/riscv/zi-ext.c: New test.
      5c18df44
    • Rainer Orth's avatar
      Link shared libasan with -z now on Solaris · 099d53e5
      Rainer Orth authored
      g++.dg/asan/default-options-1.C FAILs on Solaris/SPARC and x86:
      
      FAIL: g++.dg/asan/default-options-1.C   -O0  execution test
      FAIL: g++.dg/asan/default-options-1.C   -O1  execution test
      FAIL: g++.dg/asan/default-options-1.C   -O2  execution test
      FAIL: g++.dg/asan/default-options-1.C   -O2 -flto  execution test
      FAIL: g++.dg/asan/default-options-1.C   -O2 -flto -flto-partition=none  execution test
      FAIL: g++.dg/asan/default-options-1.C   -O3 -g  execution test
      FAIL: g++.dg/asan/default-options-1.C   -Os  execution test
      
      The failure is always the same:
      
      AddressSanitizer: CHECK failed: asan_rtl.cpp:397 "((!AsanInitIsRunning() && "ASan init calls itself!")) != (0)" (0x0, 0x0) (tid=1)
      
      This happens because libasan makes unportable assumptions about
      initialization order that don't hold on Solaris.  The problem has
      already been fixed in clang by
      
      	[Driver] Link shared asan runtime lib with -z now on Solaris/x86
      	https://reviews.llvm.org/D156325
      
      where it was way more prevalent.
      
      This patch applies the same fix to gcc.
      
      Tested on i386-pc-solaris2.11 (ld and gld) and sparc-sun-solaris2.11.
      
      2024-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc:
      	* config/sol2.h (LIBASAN_EARLY_SPEC): Add -z now unless
      	-static-libasan.  Add missing whitespace.
      099d53e5
    • Rainer Orth's avatar
      testsuite: i386: Fix gcc.target/i386/pr38534-1.c etc. on Solaris/x86 · 5b9b395b
      Rainer Orth authored
      The gcc.target/i386/pr38534-1.c etc. tests FAIL on 32 and 64-bit
      Solaris/x86:
      
      FAIL: gcc.target/i386/pr38534-1.c scan-assembler-not push
      FAIL: gcc.target/i386/pr38534-2.c scan-assembler-not push
      FAIL: gcc.target/i386/pr38534-3.c scan-assembler-not push
      FAIL: gcc.target/i386/pr38534-4.c scan-assembler-not push
      
      The tests assume the Linux/x86 default of -fomit-frame-pointer, while
      Solaris/x86 defaults to -fno-omit-frame-pointer.
      
      Fixed by specifying -fomit-frame-pointer explicitly.
      
      Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.
      
      2024-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* gcc.target/i386/pr38534-1.c: Add -fomit-frame-pointer to
      	dg-options.
      	* gcc.target/i386/pr38534-2.c: Likewise.
      	* gcc.target/i386/pr38534-3.c: Likewise.
      	* gcc.target/i386/pr38534-4.c: Likewise.
      5b9b395b
    • Rainer Orth's avatar
      testsuite: i386: Fix gcc.target/i386/no-callee-saved-1.c etc. on Solaris/x86 · 7fd4bb1d
      Rainer Orth authored
      The gcc.target/i386/no-callee-saved-[12].c tests FAIL on Solaris/x86:
      
      FAIL: gcc.target/i386/no-callee-saved-1.c scan-assembler-not push
      FAIL: gcc.target/i386/no-callee-saved-2.c scan-assembler-not push
      
      In both cases, the test expect the Linux/x86 default of
      -fomit-frame-pointer, while Solaris/x86 defaults to
      -fno-omit-frame-pointer.
      
      So this patch explicitly specifies -fomit-frame-pointer.
      
      Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.
      
      2024-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* gcc.target/i386/no-callee-saved-1.c: Add -fomit-frame-pointer to
      	dg-options.
      	* gcc.target/i386/no-callee-saved-2.c: Likewise.
      7fd4bb1d
    • Rainer Orth's avatar
      testsuite: i386: Fix gcc.target/i386/avx512vl-stv-rotatedi-1.c on 32-bit Solaris/x86 · 6353c396
      Rainer Orth authored
      gcc.target/i386/avx512vl-stv-rotatedi-1.c FAILs on 32-bit Solaris/x86
      since its introduction in
      
      commit 4814b63c
      Author: Roger Sayle <roger@nextmovesoftware.com>
      Date:   Mon Jul 10 09:04:29 2023 +0100
      
          i386: Add AVX512 support for STV of SI/DImode rotation by constant.
      
      FAIL: gcc.target/i386/avx512vl-stv-rotatedi-1.c scan-assembler-times vpro[lr]q 29
      
      While the test depends on -mstv, 32-bit Solaris/x86 defaults to
      -mstackrealign which is incompatible.
      
      The patch thus specifies -mstv -mno-stackrealign explicitly.
      
      Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.
      
      2024-01-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* gcc.target/i386/avx512vl-stv-rotatedi-1.c: Add -mstv
      	-mno-stackrealign to dg-options.
      6353c396
    • Rainer Orth's avatar
      testsuite: i386: Fix gcc.target/i386/pr70321.c on 32-bit Solaris/x86 · ee7011ea
      Rainer Orth authored
      gcc.target/i386/pr70321.c FAILs on 32-bit Solaris/x86 since its
      introduction in
      
      commit 43201f2c
      Author: Roger Sayle <roger@nextmovesoftware.com>
      Date:   Mon May 30 21:20:09 2022 +0100
      
          PR target/70321: Split double word equality/inequality after STV on x86.
      
      FAIL: gcc.target/i386/pr70321.c scan-assembler-times mov 1
      
      The failure happens because 32-bit Solaris/x86 defaults to
      -fno-omit-frame-pointer.
      
      Fixed by specifying -fomit-frame-pointer explicitly.
      
      Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.
      
      2024-01-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* gcc.target/i386/pr70321.c: Add -fomit-frame-pointer to
      	dg-options.
      ee7011ea
    • Rainer Orth's avatar
      c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as · e98edc6a
      Rainer Orth authored
      The new g++.dg/ext/attr-section2*.C tests FAIL on Solaris/SPARC with the
      native assembler:
      
      +FAIL: g++.dg/ext/attr-section2.C -std=c++14 scan-assembler
      .(section|csect)[ \\\\t]+.foo
      +FAIL: g++.dg/ext/attr-section2.C -std=c++17 scan-assembler
      .(section|csect)[ \\\\t]+.foo
      +FAIL: g++.dg/ext/attr-section2.C -std=c++20 scan-assembler
      .(section|csect)[ \\\\t]+.foo
      
      The problem is that the SPARC assembler requires the section name to be
      double-quoted, like
      
              .section        ".foo%_Z3varIiE",#alloc,#write,#progbits
      
      This patch allows for that.  At the same time, it quotes literal dots in
      the REs.
      
      Tested on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as
      and gas).
      
      2024-01-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* g++.dg/ext/attr-section2.C (scan-assembler): Quote dots.  Allow
      	for double-quoted section name.
      	* g++.dg/ext/attr-section2a.C: Likewise.
      	* g++.dg/ext/attr-section2b.C: Likewise.
      e98edc6a
    • GCC Administrator's avatar
      Daily bump. · dd3455f6
      GCC Administrator authored
      dd3455f6
    • Thomas Schwinge's avatar
      GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description · 31938936
      Thomas Schwinge authored
      They're not used there, and we avoid potentially out-of-sync definitions.
      
      	gcc/
      	* config/gcn/gcn.md (FIRST_SGPR_REG, LAST_SGPR_REG)
      	(FIRST_VGPR_REG, LAST_VGPR_REG, FIRST_AVGPR_REG, LAST_AVGPR_REG):
      	Don't 'define_constants'.
      31938936
    • Thomas Schwinge's avatar
      GCN: Remove 'SGPR_OR_VGPR_REGNO_P' definition · f9eb0212
      Thomas Schwinge authored
      ..., which was always (a) unused, and (b) bogus: always-false.
      
      	gcc/
      	* config/gcn/gcn.h (SGPR_OR_VGPR_REGNO_P): Remove.
      f9eb0212
    • Thomas Schwinge's avatar
      GCN, RDNA 3: Adjust 'sync_compare_and_swap<mode>_lds_insn' · 6c2a40f4
      Thomas Schwinge authored
      For OpenACC/GCN '-march=gfx1100', a lot of libgomp OpenACC test cases FAIL:
      
          /tmp/ccGfLJ8a.mkoffload.2.s:406:2: error: instruction not supported on this GPU
                  ds_cmpst_rtn_b32 v0, v0, v4, v3
                  ^
      
      In RDNA 3, 'ds_cmpst_[...]' has been replaced by 'ds_cmpstore_[...]', and the
      notes for 'ds_cmpst_[...]' in pre-RDNA 3 ISA manuals:
      
          Caution, the order of src and cmp are the *opposite* of the BUFFER_ATOMIC_CMPSWAP opcode.
      
      ..., have been resolved for 'ds_cmpstore_[...]' in the RDNA 3 ISA manual:
      
          In this architecture the order of src and cmp agree with the BUFFER_ATOMIC_CMPSWAP opcode.
      
      ..., and therefore '%2', '%3' now swapped with regards to GCC operand order.
      Most of the affected libgomp OpenACC test cases then PASS their execution test.
      
      	gcc/
      	* config/gcn/gcn.md (sync_compare_and_swap<mode>_lds_insn)
      	[TARGET_RDNA3]: Adjust.
      6c2a40f4
    • Gaius Mulley's avatar
      PR modula2/111627 defend against ICE · 75f49cf8
      Gaius Mulley authored
      
      Although PR 111627 can be fixed by renaming testsuite modules it
      highlighted that a possible ICE can occur if a malformed
      implementation module is actually a program module.  This small
      patch defends against this ICE and checks to see whether the module
      is a DefImp before testing IsDefinitionForC.
      
      gcc/m2/ChangeLog:
      
      	PR modula2/111627
      	PR modula2/112506
      	* gm2-compiler/M2Comp.mod (Pass0CheckMod): Test IsDefImp before
      	checking IsDefinitionForC.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      75f49cf8
    • Richard Biener's avatar
      tree-optimization/113693 - LC SSA and region VN · b84f8a5e
      Richard Biener authored
      The following fixes LC SSA preserving with region VN which was broken
      when availability checking was enhanced to treat not visited value
      numbers as available.  The following makes sure to honor availability
      data we put in place for LC SSA preserving instead.
      
      	PR tree-optimization/113693
      	* tree-ssa-sccvn.cc (rpo_elim::eliminate_avail): Honor avail
      	data when available.
      
      	* gcc.dg/pr113693.c: New testcase.
      b84f8a5e
    • Szabolcs Nagy's avatar
      aarch64: libgcc: Cleanup ELF marking in asm · d85c17a2
      Szabolcs Nagy authored
      Use aarch64-asm.h in asm code consistently, this was started in
      
        commit c608ada2
        Author:     Zac Walker <zacwalker@microsoft.com>
        CommitDate: 2024-01-23 15:32:30 +0000
      
        Ifdef `.hidden`, `.type`, and `.size` pseudo-ops for `aarch64-w64-mingw32` target
      
      But that commit failed to remove some existing markings from asm files,
      which means some objects got double marked with gnu property notes.
      
      libgcc/ChangeLog:
      
      	* config/aarch64/crti.S: Remove stack marking.
      	* config/aarch64/crtn.S: Remove stack marking, include aarch64-asm.h
      	* config/aarch64/lse.S: Remove stack and GNU property markings.
      d85c17a2
    • Jakub Jelinek's avatar
      gimple-low: Remove .ASAN_MARK calls on TREE_STATIC variables [PR113531] · ceb242f5
      Jakub Jelinek authored
      
      Since the r14-1500-g4d935f52b0d5c0 commit we promote an initializer_list
      backing array to static storage where appropriate, but this happens after
      we decided to add it to asan_poisoned_variables.  As a result we add
      unpoison/poison for it to the gimple.  But then sanopt removes the unpoison.
      So the second time we call the function and want to load from the array asan
      still considers it poisoned.
      
      The following patch fixes it by removing the .ASAN_MARK internal calls
      during gimple lowering if they refer to TREE_STATIC vars.
      
      2024-02-01  Jakub Jelinek  <jakub@redhat.com>
      	    Jason Merrill  <jason@redhat.com>
      
      	PR c++/113531
      	* gimple-low.cc (lower_stmt): Remove .ASAN_MARK calls
      	on variables which were promoted to TREE_STATIC.
      
      	* g++.dg/asan/initlist1.C: New test.
      
      Co-authored-by: default avatarJason Merrill <jason@redhat.com>
      ceb242f5
    • Roger Sayle's avatar
      PR target/113560: Enhance is_widening_mult_rhs_p. · 2f14c0db
      Roger Sayle authored
      This patch resolves PR113560, a code quality regression from GCC12
      affecting x86_64, by enhancing the middle-end's tree-ssa-math-opts.cc
      to recognize more instances of widening multiplications.
      
      The widening multiplication perception code identifies cases like:
      
      	_1 = (unsigned __int128) x;
      	__res = _1 * 100;
      
      but in the reported test case, the original input looks like:
      
      	_1 = (unsigned long long) x;
      	_2 = (unsigned __int128) _1;
      	__res = _2 * 100;
      
      which gets optimized by constant folding during tree-ssa to:
      
      	_2 = x & 18446744073709551615;  // x & 0xffffffffffffffff
      	__res = _2 * 100;
      
      where the BIT_AND_EXPR hides (has consumed) the extension operation.
      This reveals the more general deficiency (missed optimization
      opportunity) in widening multiplication perception that additionally
      both
      
      __int128 foo(__int128 x, __int128 y) {
        return (x & 1000) * (y & 1000)
      }
      
      and
      
      unsigned __int128 bar(unsigned __int128 x, unsigned __int128) {
        return (x >> 80) * (y >> 80);
      }
      
      should be recognized as widening multiplications.  Hence rather than
      test explicitly for BIT_AND_EXPR (as in the first version of this patch)
      the more general solution is to make use of range information, as
      provided by tree_non_zero_bits.
      
      As a demonstration of the observed improvements, function foo above
      currently with -O2 compiles on x86_64 to:
      
      foo:	movq    %rdi, %rsi
              movq    %rdx, %r8
              xorl    %edi, %edi
              xorl    %r9d, %r9d
              andl    $1000, %esi
              andl    $1000, %r8d
              movq    %rdi, %rcx
              movq    %r9, %rdx
              imulq   %rsi, %rdx
              movq    %rsi, %rax
              imulq   %r8, %rcx
              addq    %rdx, %rcx
              mulq    %r8
              addq    %rdx, %rcx
              movq    %rcx, %rdx
              ret
      
      with this patch, GCC recognizes the *w and instead generates:
      
      foo:    movq    %rdi, %rsi
              movq    %rdx, %r8
              andl    $1000, %esi
              andl    $1000, %r8d
              movq    %rsi, %rax
              imulq   %r8
              ret
      
      which is perhaps easier to understand at the tree-level where
      
      __int128 foo (__int128 x, __int128 y)
      {
        __int128 _1;
        __int128 _2;
        __int128 _5;
      
        <bb 2> [local count: 1073741824]:
        _1 = x_3(D) & 1000;
        _2 = y_4(D) & 1000;
        _5 = _1 * _2;
        return _5;
      
      }
      
      gets transformed to:
      
      __int128 foo (__int128 x, __int128 y)
      {
        __int128 _1;
        __int128 _2;
        __int128 _5;
        signed long _7;
        signed long _8;
      
        <bb 2> [local count: 1073741824]:
        _1 = x_3(D) & 1000;
        _2 = y_4(D) & 1000;
        _7 = (signed long) _1;
        _8 = (signed long) _2;
        _5 = _7 w* _8;
        return _5;
      }
      
      2023-02-01  Roger Sayle  <roger@nextmovesoftware.com>
      	    Richard Biener  <rguenther@suse.de>
      
      gcc/ChangeLog
      	PR target/113560
      	* tree-ssa-math-opts.cc (is_widening_mult_rhs_p): Use range
      	information via tree_non_zero_bits to check if this operand
      	is suitably extended for a widening (or highpart) multiplication.
      	(convert_mult_to_widen): Insert explicit casts if the RHS or LHS
      	isn't already of the claimed type.
      
      gcc/testsuite/ChangeLog
      	PR target/113560
      	* g++.target/i386/pr113560.C: New test case.
      	* gcc.target/i386/pr113560.c: Likewise.
      	* gcc.dg/pr87954.c: Update test case.
      2f14c0db
    • Edwin Lu's avatar
      Revert "RISC-V: Add non-vector types to dfa pipelines" · fd4829dd
      Edwin Lu authored
      This reverts commit 26c34b80.
      fd4829dd
    • Edwin Lu's avatar
      Revert "RISC-V: Add vector related pipelines" · 2a30dd3a
      Edwin Lu authored
      This reverts commit e56fb037.
      2a30dd3a
    • Edwin Lu's avatar
      Revert "RISC-V: Use default cost model for insn scheduling" · 017b4c2a
      Edwin Lu authored
      This reverts commit 4b799a16.
      017b4c2a
    • Edwin Lu's avatar
      Revert "RISC-V: Enable assert for insn_has_dfa_reservation" · be697c0a
      Edwin Lu authored
      This reverts commit 23cd2961.
      be697c0a
Loading