Skip to content
Snippets Groups Projects
  1. Jul 27, 2023
  2. Jul 26, 2023
  3. Jul 25, 2023
  4. Jul 24, 2023
  5. Jul 23, 2023
  6. Jul 22, 2023
  7. Jul 21, 2023
  8. Jul 20, 2023
    • Andrew Carlotti's avatar
      aarch64: Remove architecture dependencies from intrinsics · 9aac37ab
      Andrew Carlotti authored
      Many intrinsics currently depend on both an architecture version and a
      feature, despite the corresponding instructions being available within
      GCC at lower architecture versions.
      
      LLVM has already removed these explicit architecture version
      dependences; this patch does the same for GCC. Note that +fp16 does not
      imply +simd, so we need to add an explicit +simd for the Neon fp16
      intrinsics.
      
      Binutils did not previously support all of these architecture+feature
      combinations, but this problem is already reachable from GCC.  For
      example, compiling the test gcc.target/aarch64/usadv16qi-dotprod.c
      with -O3 -march=armv8-a+dotprod has resulted in an assembler error since
      GCC 10.  This is fixed in Binutils 2.41.
      
      This patch retains explicit architecture version dependencies for
      features that do not currently have a separate feature flag.
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64.h (TARGET_MEMTAG): Remove armv8.5
      	dependency.
      	* config/aarch64/arm_acle.h: Remove unnecessary armv8.x
      	dependencies from target pragmas.
      	* config/aarch64/arm_fp16.h (target): Likewise.
      	* config/aarch64/arm_neon.h (target): Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/feature-bf16-backport.c: New test.
      	* gcc.target/aarch64/feature-dotprod-backport.c: New test.
      	* gcc.target/aarch64/feature-fp16-backport.c: New test.
      	* gcc.target/aarch64/feature-fp16-scalar-backport.c: New test.
      	* gcc.target/aarch64/feature-fp16fml-backport.c: New test.
      	* gcc.target/aarch64/feature-i8mm-backport.c: New test.
      	* gcc.target/aarch64/feature-memtag-backport.c: New test.
      	* gcc.target/aarch64/feature-sha3-backport.c: New test.
      	* gcc.target/aarch64/feature-sm4-backport.c: New test.
      9aac37ab
    • Richard Biener's avatar
      85759829
    • Haochen Jiang's avatar
      Correct Granite Rapids{, D} documentation · ff565e12
      Haochen Jiang authored
      gcc/Changelog:
      
      	* doc/invoke.texi: Remove AVX512VP2INTERSECT in
      	Granite Rapids{, D} from documentation.
      ff565e12
    • GCC Administrator's avatar
      Daily bump. · a5aac58f
      GCC Administrator authored
      a5aac58f
  9. Jul 19, 2023
    • Jonathan Wakely's avatar
      libstdc++: Fix preprocessor conditions for std::from_chars [PR109921] · cd2f934b
      Jonathan Wakely authored
      We use the from_chars_strtod function with __strtof128 to read a
      _Float128 value, but from_chars_strtod is not defined unless uselocale
      is available. This can lead to compilation failures for some targets,
      because we try to define the _Float128 overload in terms of a
      non-existing from_chars_strtod function.
      
      Only try to use __strtof128 if uselocale is available and therefore we
      can use the from_chars_strtod function template.
      
      This is a simpler change than r14-1431-g7037e7b6e4ac41 on trunk, because
      that caused unwanted ABI regressions (PR libstdc++/110077).
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/109921
      	* src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS):
      	Only define when USE_STRTOD_FOR_FROM_CHARS is also defined.
      	(USE_STRTOD_FOR_FROM_CHARS): Do not undefine when long double is
      	binary64.
      	(from_chars(const char*, const char*, double&, chars_format)):
      	Check __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ here.
      cd2f934b
    • Patrick Palka's avatar
      c++: constrained surrogate call functions [PR110535] · 92f6240b
      Patrick Palka authored
      We weren't checking constraints on pointer/reference-to-function conversion
      functions during overload resolution, which caused us to ICE on the first
      testcase and reject the second testcase.
      
      	PR c++/110535
      
      gcc/cp/ChangeLog:
      
      	* call.cc (add_conv_candidate): Check constraints.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/concepts-surrogate1.C: New test.
      	* g++.dg/cpp2a/concepts-surrogate2.C: New test.
      
      (cherry picked from commit 1e0f37df)
      92f6240b
    • Jonathan Wakely's avatar
      libstdc++: Fix iostream init for Clang on darwin [PR110432] · 61bf34d1
      Jonathan Wakely authored
      
      The __has_attribute(init_priority) check in <iostream> is true for Clang
      on darwin, which means that user code including <iostream> thinks the
      library will initialize the global streams. However, when libstdc++ is
      built by GCC on darwin, the __has_attribute(init_priority) check is
      false, which means that the library thinks that user code will do the
      initialization when <iostream> is included. This means that the
      initialization is never done.
      
      Add an autoconf check so that the header and the library both make their
      decision based on the static properties of GCC at build time, with a
      consistent outcome.
      
      As a belt and braces check, also do the initialization in <iostream> if
      the compiler including that header doesn't support the attribute (even
      if the library also containers the initialization). This might result in
      redundant initialization done in <iostream>, but ensures the
      initialization happens somewhere if there's any doubt about the
      attribute working correctly due to missing linker support.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/110432
      	* acinclude.m4 (GLIBCXX_CHECK_INIT_PRIORITY): New.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Use GLIBCXX_CHECK_INIT_PRIORITY.
      	* include/std/iostream: Use new autoconf macro as well as
      	__has_attribute.
      	* src/c++98/ios_base_init.h: Use new autoconf macro instead of
      	__has_attribute.
      
      Reviewed-by: default avatarPatrick Palka <ppalka@redhat.com>
      (cherry picked from commit fe2651af)
      61bf34d1
    • Patrick Palka's avatar
      c++: extend lookup_template_class shortcut [PR110122] · 33a84d43
      Patrick Palka authored
      Here when substituting the injected class name A during regeneration of
      the lambda, we find ourselves in lookup_template_class for A<V> with
      V=_ZTAXtl3BarEE (i.e. the template parameter object for Foo{}).  The call
      to coerce_template_parms within then undesirably tries to make a copy of
      this class NTTP argument, which fails because Foo is not copyable.  But it
      seems clear that this testcase shouldn't require copyability of Foo.
      
      lookup_template_class has a shortcut for looking up the current class
      scope, which would avoid the problematic coerce_template_parms call, but
      the shortcut doesn't trigger because it only considers the innermost
      class scope which in this case in the lambda type.  So this patch fixes
      this by extending the lookup_template_class shortcut to consider outer
      class scopes too (and skipping over lambda types since they are never
      specialized from lookup_template_class).  We also need to avoid calling
      coerce_template_parms when specializing a templated non-template nested
      class for the first time (such as A::B in the testcase).  Coercion should
      be unnecessary there because the innermost arguments belong to the context
      and so should have already been coerced.
      
      	PR c++/110122
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (lookup_template_class): Extend shortcut for looking up the
      	current class scope to consider outer class scopes too, and use
      	current_nonlambda_class_type instead of current_class_type.  Only
      	call coerce_template_parms when specializing a primary template.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/nontype-class57.C: New test.
      	* g++.dg/cpp2a/nontype-class58.C: New test.
      
      (cherry picked from commit 682d401a)
      33a84d43
    • Jakub Jelinek's avatar
      wide-int: Fix up wi::divmod_internal [PR110731] · f76f411f
      Jakub Jelinek authored
      As the following testcase shows, wi::divmod_internal doesn't handle
      correctly signed division with precision > 64 when the dividend (and likely
      divisor as well) is the type's minimum and the precision isn't divisible
      by 64.
      
      A few lines above what the patch hunk changes is:
        /* Make the divisor and dividend positive and remember what we
           did.  */
        if (sgn == SIGNED)
          {
            if (wi::neg_p (dividend))
              {
                neg_dividend = -dividend;
                dividend = neg_dividend;
                dividend_neg = true;
              }
            if (wi::neg_p (divisor))
              {
                neg_divisor = -divisor;
                divisor = neg_divisor;
                divisor_neg = true;
              }
          }
      i.e. we negate negative dividend or divisor and remember those.
      But, after we do that, when unpacking those values into b_dividend and
      b_divisor we need to always treat the wide_ints as UNSIGNED,
      because divmod_internal_2 performs an unsigned division only.
      Now, if precision <= 64, we don't reach here at all, earlier code
      handles it.  If dividend or divisor aren't the most negative values,
      the negation clears their most significant bit, so it doesn't really
      matter if we unpack SIGNED or UNSIGNED.  And if precision is multiple
      of HOST_BITS_PER_WIDE_INT, there is no difference in behavior, while
      -0x80000000000000000000000000000000 negates to
      -0x80000000000000000000000000000000 the unpacking of it as SIGNED
      or UNSIGNED works the same.
      In the testcase, we have signed precision 119 and the dividend is
      val = { 0, 0xffc0000000000000 }, len = 2, precision = 119
      both before and after negation.
      Divisor is
      val = { 2 }, len = 1, precision = 119
      But we really want to divide 0x400000000000000000000000000000 by 2
      unsigned and then negate at the end.
      If it is unsigned precision 119 division
      0x400000000000000000000000000000 by 2
      dividend is
      val = { 0, 0xffc0000000000000 }, len = 2, precision = 119
      but as we unpack it UNSIGNED, it is unpacked into
      0, 0, 0, 0x00400000
      
      The following patch fixes it by always using UNSIGNED unpacking
      because we've already negated negative values at that point if
      sgn == SIGNED and so most negative constants should be treated as
      positive.
      
      2023-07-19  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/110731
      	* wide-int.cc (wi::divmod_internal): Always unpack dividend and
      	divisor as UNSIGNED regardless of sgn.
      
      	* gcc.dg/pr110731.c: New test.
      
      (cherry picked from commit ece79960)
      f76f411f
    • Maciej W. Rozycki's avatar
      testsuite: Require vectors of doubles for pr97428.c · f1d8558a
      Maciej W. Rozycki authored
      The pr97428.c test assumes support for vectors of doubles, but some
      targets only support vectors of floats, causing this test to fail with
      such targets.  Limit this test to targets that support vectors of
      doubles then.
      
      	gcc/testsuite/
      	* gcc.dg/vect/pr97428.c: Limit to `vect_double' targets.
      
      (cherry picked from commit 5d9fc2ac)
      f1d8558a
    • Iain Sandoe's avatar
      Darwin: Use -platform_version when available [PR110624]. · 4adf49a4
      Iain Sandoe authored
      
      Later versions of the static linker support a more flexible flag to
      describe the OS, OS version and SDK used to build the code.  This
      replaces the functionality of '-mmacosx_version_min' (which is now
      deprecated, leading to the diagnostic described in the PR).
      
      We now use the platform_version flag when available which avoids the
      diagnostic.
      
      Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
      
      	PR target/110624
      
      gcc/ChangeLog:
      
      	* config/darwin.h (DARWIN_PLATFORM_ID): New.
      	(LINK_COMMAND_A): Use DARWIN_PLATFORM_ID to pass OS, OS version
      	and SDK data to the static linker.
      
      (cherry picked from commit 032b5da1)
      4adf49a4
    • Iain Sandoe's avatar
      testsuite, Darwin: Remove an unnecessary flags addition. · c042baa9
      Iain Sandoe authored
      
      The addition of the multiply_defined suppress flag has been handled for some
      considerable time now in the Darwin specs; remove it from the testsuite libs.
      Avoid duplicates in the specs.
      
      Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
      
      gcc/ChangeLog:
      
      	* config/darwin.h: Avoid duplicate multiply_defined specs on
      	earlier Darwin versions with shared libgcc.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/lib/libstdc++.exp: Remove additional flag handled
      	by Darwin specs.
      
      gcc/testsuite/ChangeLog:
      
      	* lib/g++.exp: Remove additional flag handled by Darwin specs.
      	* lib/obj-c++.exp: Likewise.
      
      (cherry picked from commit 3c776fdf)
      c042baa9
    • GCC Administrator's avatar
      Daily bump. · 220275a2
      GCC Administrator authored
      220275a2
  10. Jul 18, 2023
    • Harald Anlauf's avatar
      Fortran: intrinsics and deferred-length character arguments [PR95947,PR110658] · ccf94ab2
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/95947
      	PR fortran/110658
      	* trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
      	whose result characteristics depends on the first argument and which
      	can be of type character, the character length will not be deferred.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/95947
      	PR fortran/110658
      	* gfortran.dg/deferred_character_37.f90: New test.
      
      (cherry picked from commit 95ddd265)
      ccf94ab2
    • Florian Weimer's avatar
      libgcc: Fix -Wint-conversion warning in find_fde_tail · 6f9dfb4d
      Florian Weimer authored
      Fixes commit r14-1614-g49310a99330849 ("libgcc: Fix eh_frame fast path
      in find_fde_tail").
      
      libgcc/
      
      	PR libgcc/110179
      	* unwind-dw2-fde-dip.c (find_fde_tail): Add cast to avoid
      	implicit conversion of pointer value to integer.
      
      (cherry picked from commit 104b0900)
      6f9dfb4d
    • Florian Weimer's avatar
      libgcc: Fix eh_frame fast path in find_fde_tail · 7302f8a2
      Florian Weimer authored
      The eh_frame value is only used by linear_search_fdes, not the binary
      search directly in find_fde_tail, so the bug is not immediately
      apparent with most programs.
      
      Fixes commit e724b048 ("libgcc:
      Special-case BFD ld unwind table encodings in find_fde_tail").
      
      libgcc/
      
      	PR libgcc/109712
      	* unwind-dw2-fde-dip.c (find_fde_tail): Correct fast path for
      	parsing eh_frame.
      
      (cherry picked from commit 49310a99)
      7302f8a2
    • Ju-Zhe Zhong's avatar
      RISC-V: Bugfix for riscv-vsetvl pass. · a1322d76
      Ju-Zhe Zhong authored
      This patch comes from part of below change, which locate one bug of rvv
      vsetvel pass when auto-vectorization.
      
      https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624523.html
      
      
      
      Unforunately, It is not easy to reproduce this bug by intrinsic APIs
      but it is worth to backport to GCC 13.
      
      Signed-off-by: default avatarJu-Zhe Zhong <juzhe.zhong@rivai.ai>
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc (gen_vsetvl_pat): Add vl parameter.
      	(change_vsetvl_insn): Ditto.
      	(change_insn): Add validate change as well as assert.
      	(pass_vsetvl::backward_demand_fusion): Allow forward.
      a1322d76
    • Jonathan Wakely's avatar
      libstdc++: Fix std::__uninitialized_default_n for constant evaluation [PR110542] · a32d4a34
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/110542
      	* include/bits/stl_uninitialized.h (__uninitialized_default_n):
      	Do not use std::fill_n during constant evaluation.
      
      (cherry picked from commit 83cae6c4)
      a32d4a34
    • Jonathan Wakely's avatar
      libstdc++: Implement P2538R1 ADL-proof std::projected · d96e4962
      Jonathan Wakely authored
      This was recently approved for C++26, but there's no harm in
      implementing it unconditionally for C++20 and C++23. As it says in the
      paper, it doesn't change the meaning of any valid code. It only enables
      things that were previously ill-formed for questionable reasons.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/iterator_concepts.h (projected): Replace class
      	template with alias template denoting an ADL-proofed helper.
      	(incremental_traits<projected<Iter, Proj>>): Remove.
      	* testsuite/24_iterators/indirect_callable/projected-adl.cc:
      	New test.
      
      (cherry picked from commit 6eafdfc7)
      d96e4962
    • Jonathan Wakely's avatar
      libstdc++: Fix --enable-cstdio=stdio_pure [PR110574] · 5342e3cc
      Jonathan Wakely authored
      When configured with --enable-cstdio=stdio_pure we need to consistently
      use fseek and not mix seeks on the file descriptor with reads and writes
      on the FILE stream.
      
      There are also a number of bugs related to error handling and return
      values, because fread and fwrite return 0 on error, not -1, and fseek
      returns 0 on success, not the file offset.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/110574
      	* acinclude.m4 (GLIBCXX_CHECK_LFS): Check for fseeko and ftello
      	and define _GLIBCXX_USE_FSEEKO_FTELLO.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* config/io/basic_file_stdio.cc (xwrite) [_GLIBCXX_USE_STDIO_PURE]:
      	Check for fwrite error correctly.
      	(__basic_file<char>::xsgetn) [_GLIBCXX_USE_STDIO_PURE]: Check for
      	fread error correctly.
      	(get_file_offset): New function.
      	(__basic_file<char>::seekoff) [_GLIBCXX_USE_STDIO_PURE]: Use
      	fseeko if available. Use get_file_offset instead of return value
      	of fseek.
      	(__basic_file<char>::showmanyc): Use get_file_offset.
      
      (cherry picked from commit 2f6bbc9a)
      5342e3cc
    • Tianqiang Shuai's avatar
      libstdc++: Fix fwrite error parameter · c9da7491
      Tianqiang Shuai authored
      The first parameter of fwrite should be the const char* __s which want
      write to FILE *__file, rather than the FILE *__file write to the FILE
      *__file.
      
      libstdc++-v3/ChangeLog:
      
      	* config/io/basic_file_stdio.cc (xwrite) [USE_STDIO_PURE]: Fix
      	first argument.
      
      (cherry picked from commit bb4f8f14)
      c9da7491
    • Jonathan Wakely's avatar
      libstdc++: Disable std::forward_list tests for C++98 mode · 813722fb
      Jonathan Wakely authored
      These tests fail with -std=gnu++98/-D_GLIBCXX_DEBUG in the runtest
      flags. They should require the c++11 effective target.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/23_containers/forward_list/debug/iterator1_neg.cc:
      	Skip as UNSUPPORTED for C++98 mode.
      	* testsuite/23_containers/forward_list/debug/iterator3_neg.cc:
      	Likewise.
      
      (cherry picked from commit cd9964b7)
      813722fb
    • Jonathan Wakely's avatar
      libstdc++: Fix <iosfwd> synopsis test · d2c737c4
      Jonathan Wakely authored
      The <syncstream> header is only supported for the cxx11 ABI. The
      declarations of basic_syncbuf, basic_osyncstream, syncbuf and
      osyncstream were already correctly guarded by a check for
      _GLIBCXX_USE_CXX11_ABI, but the wsyncbuf and wosyncstream declarations
      were not.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/27_io/headers/iosfwd/synopsis.cc: Make wsyncbuf and
      	wosyncstream depend on _GLIBCXX_USE_CXX11_ABI.
      
      (cherry picked from commit f9f05e48)
      d2c737c4
    • Jonathan Wakely's avatar
      libstdc++: Fix src/c++20/tzdb.cc for non-constexpr std::mutex · c17539d7
      Jonathan Wakely authored
      Building libstdc++ reportedly fails for targets without lock-free
      std::atomic<T*> which don't define __GTHREAD_MUTEX_INIT:
      
      src/c++20/tzdb.cc:110:21: error: 'constinit' variable 'std::chrono::{anonymous}::list_mutex' does not have a constant initializer
      src/c++20/tzdb.cc:110:21: error: call to non-'constexpr' function 'std::mutex::mutex()'
      
      The solution implemented by this commit is to use a local static mutex
      when it can't be constinit, so that it's constructed on first use.
      
      With this change, we can also simplify the preprocessor logic for
      defining USE_ATOMIC_SHARED_PTR. It now depends on the same conditions as
      USE_ATOMIC_LIST_HEAD, so in theory we could have a single macro. Keeping
      them separate would allow us to replace the use of atomic<shared_ptr<T>>
      with a mutex if that performs better, without having to give up on the
      lock-free cache for fast access to the list head.
      
      libstdc++-v3/ChangeLog:
      
      	* src/c++20/tzdb.cc (USE_ATOMIC_SHARED_PTR): Define consistently
      	with USE_ATOMIC_LIST_HEAD.
      	(list_mutex): Replace global object with function. Use local
      	static object when std::mutex constructor isn't constexpr.
      
      (cherry picked from commit 5dfdf0ae)
      c17539d7
    • Jonathan Wakely's avatar
      libstdc++: Qualify calls to std::_Destroy and _Destroy_aux · dae96358
      Jonathan Wakely authored
      These calls should be qualified to prevent ADL, which can cause errors
      for incomplete types that are associated classes.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/alloc_traits.h (_Destroy): Qualify call.
      	* include/bits/stl_construct.h (_Destroy, _Destroy_n): Likewise.
      	* testsuite/23_containers/vector/cons/destroy-adl.cc: New test.
      
      (cherry picked from commit 33245d6b)
      dae96358
    • Jonathan Wakely's avatar
      libstdc++: Qualify calls to debug mode helpers · 5439234b
      Jonathan Wakely authored
      These functions should be qualified to disable unwanted ADL.
      
      The overload of __check_singular_aux for safe iterators was previously
      being found by ADL, because it wasn't declared before __check_singular.
      Add a declaration so that it can be found by qualified lookup.
      
      libstdc++-v3/ChangeLog:
      
      	* include/debug/helper_functions.h (__get_distance)
      	(__check_singular, __valid_range_aux, __valid_range): Qualify
      	calls to disable ADL.
      	(__check_singular_aux(const _Safe_iterator_base*)): Declare
      	overload that was previously found via ADL.
      
      (cherry picked from commit fa98bc42)
      5439234b
    • GCC Administrator's avatar
      Daily bump. · 2b4ca304
      GCC Administrator authored
      2b4ca304
  11. Jul 17, 2023
    • Patrick Palka's avatar
      c++: mangling template-id of unknown template [PR110524] · 04e88088
      Patrick Palka authored
      This fixes a crash when mangling an ADL-enabled call to a template-id
      naming an unknown template (as per P0846R0).
      
      	PR c++/110524
      
      gcc/cp/ChangeLog:
      
      	* mangle.cc (write_expression): Handle TEMPLATE_ID_EXPR
      	whose template is already an IDENTIFIER_NODE.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/fn-template26.C: New test.
      
      (cherry picked from commit 97ceaa11)
      04e88088
Loading