Skip to content
Snippets Groups Projects
  1. Jan 17, 2022
    • Jonathan Wakely's avatar
      libstdc++: Define <stacktrace> header for C++23 · 3acb929c
      Jonathan Wakely authored
      Add the <stacktrace> header and a new libstdc++_libbacktrace.a library
      that provides the implementation. For now, the new library is only built
      if --enable-libstdcxx-backtrace=yes is used. As with the Filesystem TS,
      the new library is only provided as a static archive.
      
      libstdc++-v3/ChangeLog:
      
      	* acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): New macro.
      	* configure.ac: Use GLIBCXX_ENABLE_BACKTRACE.
      	* include/Makefile.am: Add new header.
      	* include/Makefile.in: Regenerate.
      	* include/std/stacktrace: New header.
      	* include/std/version (__cpp_lib_stacktrace): Define.
      	* Makefile.in: Regenerate.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* doc/Makefile.in: Regenerate.
      	* libsupc++/Makefile.in: Regenerate.
      	* po/Makefile.in: Regenerate.
      	* python/Makefile.in: Regenerate.
      	* src/Makefile.am: Regenerate.
      	* src/Makefile.in: Regenerate.
      	* src/c++11/Makefile.in: Regenerate.
      	* src/c++17/Makefile.in: Regenerate.
      	* src/c++20/Makefile.in: Regenerate.
      	* src/c++98/Makefile.in: Regenerate.
      	* src/filesystem/Makefile.in: Regenerate.
      	* testsuite/Makefile.in: Regenerate.
      	* src/libbacktrace/Makefile.am: New file.
      	* src/libbacktrace/Makefile.in: New file.
      	* src/libbacktrace/backtrace-rename.h: New file.
      	* src/libbacktrace/backtrace-supported.h.in: New file.
      	* src/libbacktrace/config.h.in: New file.
      	* testsuite/lib/libstdc++.exp (check_effective_target_stacktrace):
      	New proc.
      	* testsuite/20_util/stacktrace/entry.cc: New test.
      	* testsuite/20_util/stacktrace/synopsis.cc: New test.
      	* testsuite/20_util/stacktrace/version.cc: New test.
      3acb929c
    • Jonathan Wakely's avatar
      libstdc++: Document final option names for enabling C++20 · 5a3dc58a
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* doc/xml/manual/status_cxx2020.xml: Use final C++20 option
      	names.
      	* doc/html/manual/status.html: Regenerate.
      5a3dc58a
    • Jonathan Wakely's avatar
      libstdc++: Rename non-reserved macros in config header [PR103650] · fa092570
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/103650
      	* include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS.
      	* include/Makefile.in: Regenerate.
      	* testsuite/17_intro/headers/c++1998/103650.cc: New test.
      fa092570
    • Francois-Xavier Coudert's avatar
      Fortran: remove new files introduced by mistake · d573a303
      Francois-Xavier Coudert authored
      These two files were introduced by mistake in
      86e3b476
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/ieee/signaling_3.f90: Remove file.
      
      libgfortran/ChangeLog:
      
      	* ieee/issignaling_fallback.h: Remove file.
      d573a303
    • Martin Liska's avatar
      Make the tests working. · a42805de
      Martin Liska authored
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/uninit-pred-loop-1_b.C: Fix invalid warnings.
      	* g++.dg/uninit-pred-loop-1_c.C: Likewise.
      a42805de
    • Martin Liska's avatar
      Rename test-cases that are not executed. · 91a38a35
      Martin Liska authored
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/uninit-pred-loop-1_a.cc: Moved to...
      	* g++.dg/uninit-pred-loop-1_a.C: ...here.
      	* g++.dg/uninit-pred-loop-1_b.cc: Moved to...
      	* g++.dg/uninit-pred-loop-1_b.C: ...here.
      	* g++.dg/uninit-pred-loop-1_c.cc: Moved to...
      	* g++.dg/uninit-pred-loop-1_c.C: ...here.
      	* g++.dg/uninit-pred-loop_1.cc: Moved to...
      	* g++.dg/uninit-pred-loop_1.C: ...here.
      91a38a35
    • Martin Liska's avatar
      Add check_effective_target_pytest3. · 4460c638
      Martin Liska authored
      gcc/testsuite/ChangeLog:
      
      	* lib/gcov.exp: Use check_effective_target_pytest3.
      	* lib/target-supports.exp: Add check_effective_target_pytest3.
      4460c638
    • Matthias Kretz's avatar
      libstdc++: Don't fail if math_errhandling is not defined · 84eb13b9
      Matthias Kretz authored
      
      Older glibc does not define math_errhandling with -ffast-math, in which
      case floating-point exceptions are not used.
      
      Signed-off-by: default avatarMatthias Kretz <m.kretz@gsi.de>
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd.h (__floating_point_flags): Do
      	not rely on the presence of the math_errhandling macro.
      84eb13b9
    • Martin Liska's avatar
      Start using check-MAINTAINERS.py instead of legacy maintainers-verify.sh. · 57cfcb3e
      Martin Liska authored
      contrib/ChangeLog:
      
      	* maintainers-verify.sh: Removed.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.src/maintainers.exp: Start using check-MAINTAINERS.py.
      	* lib/target-supports.exp: Add check_effective_target_python3.
      57cfcb3e
    • Martin Liska's avatar
      Fix test warnings. · d4c02ec7
      Martin Liska authored
      	PR testsuite/104035
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/torture/pr57993-2.C: Fix warnings.
      d4c02ec7
    • Jonathan Wakely's avatar
      libstdc++: Add 'typename' to dependent types in atomic<shared_ptr<T>> · a923345c
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/bits/shared_ptr_atomic.h (_Sp_atomic): Add typename
      	to qualified-id for dependent type.
      a923345c
    • Thomas Schwinge's avatar
      Extend test cases for references in OpenACC 'private' clauses · b75aab19
      Thomas Schwinge authored
      	libgomp/
      	* testsuite/libgomp.oacc-c++/privatized-ref-2.C: Extend.
      	* testsuite/libgomp.oacc-c++/privatized-ref-3.C: Likewise.
      	* testsuite/libgomp.oacc-fortran/privatized-ref-1.f95: Likewise.
      b75aab19
    • Julian Brown's avatar
      Test cases for references in OpenACC 'private' clauses · fbb43880
      Julian Brown authored
      
      	libgomp/
      	* testsuite/libgomp.oacc-fortran/privatized-ref-1.f95: New test.
      	* testsuite/libgomp.oacc-c++/privatized-ref-2.C: New test.
      	* testsuite/libgomp.oacc-c++/privatized-ref-3.C: New test.
      
      Co-authored-by: default avatarThomas Schwinge <thomas@codesourcery.com>
      fbb43880
    • Thomas Koenig's avatar
      Allow for multiple defaults in endianness and r16 in GFORTRAN_CONVERT_UNIT. · 025a707d
      Thomas Koenig authored
      With this patch, it is possible to specify multiple defaults inthe
      GFORTRAN_CONVERT_UNIT environment variable so that, for example, R16_IEEE
      and BIG_ENDIAN can be specified together.
      
      libgfortran/ChangeLog:
      
      	* runtime/environ.c: Allow for multiple default values so that
      	separate default specifications for IBM long double format and
      	endianness are possible.
      025a707d
    • Kewen Lin's avatar
      rs6000: Use known constant for GET_MODE_NUNITS and similar · b3e77224
      Kewen Lin authored
      This patch is to clean up some codes with GET_MODE_UNIT_SIZE or
      GET_MODE_NUNITS, which can use known constants or just be removed.
      
      Note that Carl Love helped to confirm altivec_vreveti2 introduced
      in r12-1341 is useless and can be removed.
      
      gcc/ChangeLog:
      
      	* config/rs6000/altivec.md (altivec_vreveti2): Remove.
      	* config/rs6000/vsx.md (*vsx_extract_si, *vsx_extract_si_<uns>float_df,
      	*vsx_extract_si_<uns>float_<mode>, *vsx_insert_extract_v4sf_p9): Use
      	known constant values to simplify code.
      b3e77224
    • Haochen Gui's avatar
      rs6000: Split pattern for TI to V1TI move [PR103124] · 240dd6c0
      Haochen Gui authored
      This patch defines a new split pattern for TI to V1TI move.  The pattern concatenates two subreg:DI of a TI to a V2DI.  With the pattern, the subreg pass can do register split for TI when there is a TI to V1TI move.
      
      gcc/
      
      	PR target/103124
      	* config/rs6000/vsx.md (split pattern for TI to V1TI move): Defined.
      
      gcc/testsuite/
      
      	PR target/103124
      	* gcc.target/powerpc/pr103124.c: New testcase.
      240dd6c0
    • GCC Administrator's avatar
      Daily bump. · 1e942d7c
      GCC Administrator authored
      1e942d7c
    • Jonathan Wakely's avatar
      libstdc++: Update C++20 status table · a3269348
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* doc/xml/manual/status_cxx2020.xml: Update.
      	* doc/html/manual/status.html: Regenerate.
      a3269348
    • Jonathan Wakely's avatar
      libstdc++: Implement C++20 atomic<shared_ptr> and atomic<weak_ptr> · 2ac0649d
      Jonathan Wakely authored
      
      This adds another piece of C++20, the std::atomic specializations for
      std::shared_ptr and std::weak_ptr.
      
      The new _Sp_atomic type mimics the structure of shared_ptr<T> and
      weak_ptr<T>, holding a T* pointer (the one returned by get() on a
      shared_ptr/weak ptr) and a _Sp_counted_base<>* pointer to the
      ref-counted control block. For _Sp_atomic the low bit of the control
      block pointer is used as a lock bit, to ensure only one thread will
      access the object at a time.  The pointer is actually stored as a
      uintptr_t to avoid accidental dereferences of the pointer when unlocked
      (which would be a race) or when locked (which would dereference the
      wrong pointer value due to the low bit being set). To get a raw pointer
      to the control block, the lock must be acquired. Converting between a
      _Sp_atomic and a shared_ptr or weak_ptr requires manually adjusting the
      T* and _Sp_counted_base<>* members of the shared/weak ptr, instead of
      going through the public API. This must be done carefully to ensure that
      any change in the number of owners is reflected in a ref-count update.
      
      Co-authored-by: default avatarThomas Rodgers <trodgers@redhat.com>
      Signed-off-by: default avatarThomas Rodgers <trodgers@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/shared_ptr_atomic.h (__cpp_lib_atomic_shared_ptr):
      	New macro.
      	(_Sp_atomic): New class template.
      	(atomic<shared_ptr<T>>, atomic<weak_ptr<T>>): New partial
      	specializations.
      	* include/bits/shared_ptr_base.h (__shared_count, __weak_count)
      	(__shared_ptr, __weak_ptr): Declare _Sp_atomic as a friend.
      	* include/std/version (__cpp_lib_atomic_shared_ptr): New macro.
      	* testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: New
      	test.
      	* testsuite/20_util/weak_ptr/atomic_weak_ptr.cc: New test.
      2ac0649d
  2. Jan 16, 2022
    • Francois-Xavier Coudert's avatar
      Fortran: xfail signaling NaN testcases on x87 · 86e3b476
      Francois-Xavier Coudert authored
      The ABI for x87 and x86-32 is not suitable for passing around
      signaling NaNs in the way IEEE expects. See for example discussion
      in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/ieee/signaling_1.f90: xfail on x87.
      	* gfortran.dg/ieee/signaling_2.f90: xfail on x87.
      86e3b476
    • Francois-Xavier Coudert's avatar
      Fortran: allow IEEE_VALUE to correctly return signaling NaNs · 90045c5d
      Francois-Xavier Coudert authored
      I moved the library implementation of IEEE_VALUE in libgfortran from
      Fortran to C code, which gives us access to GCC's built-ins for NaN generation
      (both quiet and signalling). It will be perform better than the current
      Fortran implementation.
      
      libgfortran/ChangeLog:
      
      	PR fortran/82207
      	* mk-kinds-h.sh: Add values for TINY.
      	* ieee/ieee_arithmetic.F90: Call C helper functions for
      	IEEE_VALUE.
      	* ieee/ieee_helper.c: New functions ieee_value_helper_N for each
      	floating-point type.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/82207
      	* gfortran.dg/ieee/ieee_10.f90: Do not create signaling NaNs.
      	* gfortran.dg/ieee/signaling_2.f90: New test.
      	* gfortran.dg/ieee/signaling_2_c.c: New file.
      90045c5d
    • Jonathan Wakely's avatar
      libstdc++: Ignore deprecated warnings [PR104037] · bca1c431
      Jonathan Wakely authored
      The std::pointer_to_binary_function utility was deprecated in C++11 and
      removed in C++17. Libstdc++ has started to warn about using it, so
      suppress the warnings for this test.
      
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/104037
      	* g++.old-deja/g++.robertl/eb43.C: Ad -Wno-deprecated.
      bca1c431
    • Mikael Morin's avatar
      testsuite: Enrich tests with variants failing on the branch. · 15630e6e
      Mikael Morin authored
      Backporting the fix for pr103789 on the 11 branch revealed a lack of test
      coverage for the tests provided with that fix.  Indeed, the tests use the KIND
      argument of the respective intrinsics only with keyword arguments.
      This adds variants with non-keyword arguments.
      
      The tests enriched this way fail on the branch if the fix is cherry-picked
      straightforwardly.  The fix will have to be tweaked slightly there.
      
      	PR fortran/103789
      	PR fortran/87711
      	PR fortran/97896
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/index_5.f90: Enrich test with usages of INDEX with
      	a non-keyword KIND argument.
      	* gfortran.dg/len_trim.f90: Same for LEN_TRIM.
      	* gfortran.dg/maskl_1.f90: Same for MASKL.
      	* gfortran.dg/maskr_1.f90: Same for MASKR.
      	* gfortran.dg/scan_3.f90: Same for SCAN.
      	* gfortran.dg/verify_3.f90: Same for VERIFY.
      15630e6e
    • Kwok Cheung Yeung's avatar
      amdgcn: Tune default OpenMP/OpenACC GPU utilization · a78b1ab1
      Kwok Cheung Yeung authored
      
      	libgomp/
      	* plugin/plugin-gcn.c (parse_target_attributes): Automatically set
      	the number of teams and threads if necessary.
      	(gcn_exec): Automatically set the number of gangs and workers if
      	necessary.
      
      Co-Authored-By: default avatarAndrew Stubbs <ams@codesourcery.com>
      a78b1ab1
    • Olivier Hainque's avatar
      Add VxWorks fixincludes hack, open posix API for C++ · 9d7e1925
      Olivier Hainque authored
      When system headers expose a strict "open" prototype with
      3 args, arrange to expose a C++ overload with only two.
      
      2021-01-10  Olivier Hainque  <hainque@adacore.com>
      
      	* inclhack.def (vxworks_math_h_fp_c99): New hack.
      	* tests/base/fcntl.h: Update.
      	* fixincl.x: Regenerate.
      9d7e1925
    • Olivier Hainque's avatar
      Add VxWorks fixincludes hack, #include sysLib.h in time.h · 943fad67
      Olivier Hainque authored
      Make sure there is a visible prototype of sysClkRateGet() when
      CLOCKS_PER_SEC is #defined to that in time.h for VxWorks.  This
      would typically be provided by sysLib.h.
      
      2021-01-10  Olivier Hainque  <hainque@adacore.com>
      
      	* inclhack.def (vxworks_time_h_syslib): New hack.
      	* tests/base/time.h: Update.
      	* fixincl.x: Regenerate.
      943fad67
    • Olivier Hainque's avatar
      Add VxWorks fixincludes hack, C99 FP classification · 00cc4126
      Olivier Hainque authored
      Arrange to provide missing defs for C99 FP classification functions
      and constants queried by libstdc++ configure checks (C99 support for C++98)
      
      2021-01-10  Olivier Hainque  <hainque@adacore.com>
      
      	* inclhack.def (vxworks_math_h_fp_c99): New hack.
      	* tests/base/math.h: Update.
      	* fixincl.x: Regenerate.
      00cc4126
    • wwwhhhyyy's avatar
      [i386] GLC tuning: Break false dependency for dest register. · 1c257558
      wwwhhhyyy authored
      For GoldenCove micro-architecture, force insert zero-idiom in asm
      template to break false dependency of dest register for several insns.
      
      The related insns are:
      
      VPERM/D/Q/PS/PD
      VRANGEPD/PS/SD/SS
      VGETMANTSS/SD/SH
      VGETMANDPS/PD - mem version only
      VPMULLQ
      VFMULCSH/PH
      VFCMULCSH/PH
      
      gcc/ChangeLog:
      
      	* config/i386/i386.h (TARGET_DEST_FALSE_DEP_FOR_GLC): New macro.
      	* config/i386/sse.md (<avx512>_<complexopname>_<mode><maskc_name><round_name>):
      	Insert zero-idiom in output template when attr enabled, set new attribute to
      	true for non-mask/maskz insn.
      	(avx512fp16_<complexopname>sh_v8hf<mask_scalarc_name><round_scalarcz_name>):
      	Likewise.
      	(avx512dq_mul<mode>3<mask_name>): Likewise.
      	(<avx2_avx512>_permvar<mode><mask_name>): Likewise.
      	(avx2_perm<mode>_1<mask_name>): Likewise.
      	(avx512f_perm<mode>_1<mask_name>): Likewise.
      	(avx512dq_rangep<mode><mask_name><round_saeonly_name>): Likewise.
      	(avx512dq_ranges<mode><mask_scalar_name><round_saeonly_scalar_name>):
      	Likewise.
      	(<avx512>_getmant<mode><mask_name><round_saeonly_name>): Likewise.
      	(avx512f_vgetmant<mode><mask_scalar_name><round_saeonly_scalar_name>):
      	Likewise.
      	* config/i386/subst.md (mask3_dest_false_dep_for_glc_cond): New
      	subst_attr.
      	(mask4_dest_false_dep_for_glc_cond): Likewise.
      	(mask6_dest_false_dep_for_glc_cond): Likewise.
      	(mask10_dest_false_dep_for_glc_cond): Likewise.
      	(maskc_dest_false_dep_for_glc_cond): Likewise.
      	(mask_scalar4_dest_false_dep_for_glc_cond): Likewise.
      	(mask_scalarc_dest_false_dep_for_glc_cond): Likewise.
      	* config/i386/x86-tune.def (X86_TUNE_DEST_FALSE_DEP_FOR_GLC): New
      	DEF_TUNE enabled for m_SAPPHIRERAPIDS and m_ALDERLAKE
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/avx2-dest-false-dep-for-glc.c: New test.
      	* gcc.target/i386/avx512dq-dest-false-dep-for-glc.c: Ditto.
      	* gcc.target/i386/avx512f-dest-false-dep-for-glc.c: Ditto.
      	* gcc.target/i386/avx512fp16-dest-false-dep-for-glc.c: Ditto.
      	* gcc.target/i386/avx512fp16vl-dest-false-dep-for-glc.c: Ditto.
      	* gcc.target/i386/avx512vl-dest-false-dep-for-glc.c: Ditto.
      1c257558
    • GCC Administrator's avatar
      Daily bump. · 9248ee41
      GCC Administrator authored
      9248ee41
  3. Jan 15, 2022
    • Martin Sebor's avatar
      Add -Wdangling-pointer [PR63272]. · 9d6a0f38
      Martin Sebor authored
      Resolves:
      PR c/63272 - GCC should warn when using pointer to dead scoped variable with
      in the same function
      
      gcc/c-family/ChangeLog:
      
      	PR c/63272
      	* c.opt (-Wdangling-pointer): New option.
      
      gcc/ChangeLog:
      
      	PR c/63272
      	* diagnostic-spec.c (nowarn_spec_t::nowarn_spec_t): Handle
      	-Wdangling-pointer.
      	* doc/invoke.texi (-Wdangling-pointer): Document new option.
      	* gimple-ssa-warn-access.cc (pass_waccess::clone): Set new member.
      	(pass_waccess::check_pointer_uses): New function.
      	(pass_waccess::gimple_call_return_arg): New function.
      	(pass_waccess::gimple_call_return_arg_ref): New function.
      	(pass_waccess::check_call_dangling): New function.
      	(pass_waccess::check_dangling_uses): New function overloads.
      	(pass_waccess::check_dangling_stores): New function.
      	(pass_waccess::check_dangling_stores): New function.
      	(pass_waccess::m_clobbers): New data member.
      	(pass_waccess::m_func): New data member.
      	(pass_waccess::m_run_number): New data member.
      	(pass_waccess::m_check_dangling_p): New data member.
      	(pass_waccess::check_alloca): Check m_early_checks_p.
      	(pass_waccess::check_alloc_size_call): Same.
      	(pass_waccess::check_strcat): Same.
      	(pass_waccess::check_strncat): Same.
      	(pass_waccess::check_stxcpy): Same.
      	(pass_waccess::check_stxncpy): Same.
      	(pass_waccess::check_strncmp): Same.
      	(pass_waccess::check_memop_access): Same.
      	(pass_waccess::check_read_access): Same.
      	(pass_waccess::check_builtin): Call check_pointer_uses.
      	(pass_waccess::warn_invalid_pointer): Add arguments.
      	(is_auto_decl): New function.
      	(pass_waccess::check_stmt): New function.
      	(pass_waccess::check_block): Call check_stmt.
      	(pass_waccess::execute): Call check_dangling_uses,
      	check_dangling_stores.  Empty m_clobbers.
      	* passes.def (pass_warn_access): Invoke pass two more times.
      
      gcc/testsuite/ChangeLog:
      
      	PR c/63272
      	* g++.dg/warn/Wfree-nonheap-object-6.C: Disable valid warnings.
      	* g++.dg/warn/ref-temp1.C: Prune expected warning.
      	* gcc.dg/uninit-pr50476.c: Expect a new warning.
      	* c-c++-common/Wdangling-pointer-2.c: New test.
      	* c-c++-common/Wdangling-pointer-3.c: New test.
      	* c-c++-common/Wdangling-pointer-4.c: New test.
      	* c-c++-common/Wdangling-pointer-5.c: New test.
      	* c-c++-common/Wdangling-pointer-6.c: New test.
      	* c-c++-common/Wdangling-pointer.c: New test.
      	* g++.dg/warn/Wdangling-pointer-2.C: New test.
      	* g++.dg/warn/Wdangling-pointer.C: New test.
      	* gcc.dg/Wdangling-pointer-2.c: New test.
      	* gcc.dg/Wdangling-pointer.c: New test.
      9d6a0f38
    • Martin Sebor's avatar
      Add -Wuse-after-free [PR80532]. · 671a2836
      Martin Sebor authored
      gcc/c-family/ChangeLog
      
      	PR tree-optimization/80532
      	* c.opt (-Wuse-after-free): New options.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/80532
      	* common.opt (-Wuse-after-free): New options.
      	* diagnostic-spec.c (nowarn_spec_t::nowarn_spec_t): Handle
      	OPT_Wreturn_local_addr and OPT_Wuse_after_free_.
      	* diagnostic-spec.h (NW_DANGLING): New enumerator.
      	* doc/invoke.texi (-Wuse-after-free): Document new option.
      	* gimple-ssa-warn-access.cc (pass_waccess::check_call): Rename...
      	(pass_waccess::check_call_access): ...to this.
      	(pass_waccess::check): Rename...
      	(pass_waccess::check_block): ...to this.
      	(pass_waccess::check_pointer_uses): New function.
      	(pass_waccess::gimple_call_return_arg): New function.
      	(pass_waccess::warn_invalid_pointer): New function.
      	(pass_waccess::check_builtin): Handle free and realloc.
      	(gimple_use_after_inval_p): New function.
      	(get_realloc_lhs): New function.
      	(maybe_warn_mismatched_realloc): New function.
      	(pointers_related_p): New function.
      	(pass_waccess::check_call): Call check_pointer_uses.
      	(pass_waccess::execute): Compute and free dominance info.
      
      libcpp/ChangeLog:
      
      	* files.c (_cpp_find_file): Substitute a valid pointer for
      	an invalid one to avoid -Wuse-after-free.
      
      libiberty/ChangeLog:
      
      	* regex.c: Suppress -Wuse-after-free.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/80532
      	* gcc.dg/Wmismatched-dealloc-2.c: Avoid -Wuse-after-free.
      	* gcc.dg/Wmismatched-dealloc-3.c: Same.
      	* gcc.dg/analyzer/file-1.c: Prune expected warning.
      	* gcc.dg/analyzer/file-2.c: Same.
      	* gcc.dg/attr-alloc_size-6.c: Disable -Wuse-after-free.
      	* gcc.dg/attr-alloc_size-7.c: Same.
      	* c-c++-common/Wuse-after-free-2.c: New test.
      	* c-c++-common/Wuse-after-free-3.c: New test.
      	* c-c++-common/Wuse-after-free-4.c: New test.
      	* c-c++-common/Wuse-after-free-5.c: New test.
      	* c-c++-common/Wuse-after-free-6.c: New test.
      	* c-c++-common/Wuse-after-free-7.c: New test.
      	* c-c++-common/Wuse-after-free.c: New test.
      	* g++.dg/warn/Wmismatched-dealloc-3.C: New test.
      	* g++.dg/warn/Wuse-after-free.C: New test.
      671a2836
    • Harald Anlauf's avatar
      Fortran: fix ICE and wrong code with TRANSFER and CHARACTER(kind=4) · 29401b7b
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/83079
      	* target-memory.c (gfc_interpret_character): Result length is
      	in bytes and thus depends on the character kind.
      	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Compute correct
      	string length for the result of the TRANSFER intrinsic and for
      	temporaries for the different character kinds.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/83079
      	* gfortran.dg/transfer_char_kind4.f90: New test.
      29401b7b
    • Matthias Kretz's avatar
      libstdc++: Fix ODR issues with different -m flags · 52d28210
      Matthias Kretz authored
      
      Explicitly support use of the stdx::simd implementation in situations
      where the user links TUs that were compiled with different -m flags. In
      general, this is always a (quasi) ODR violation for inline functions
      because at least codegen may differ in important ways. However, in the
      resulting executable only one (unspecified which one) of them might be
      used. For simd we want to support users to compile code multiple times,
      with different -m flags and have a runtime dispatch to the TU matching
      the target CPU. But if internal functions are not inlined this may lead
      to unexpected performance loss or execution of illegal instructions.
      Therefore, inline functions that are not marked as always_inline must
      use an additional template parameter somewhere in their name, to
      disambiguate between the different -m translations.
      
      Signed-off-by: default avatarMatthias Kretz <m.kretz@gsi.de>
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd.h: Move feature detection bools
      	and add __have_avx512bitalg, __have_avx512vbmi2,
      	__have_avx512vbmi, __have_avx512ifma, __have_avx512cd,
      	__have_avx512vnni, __have_avx512vpopcntdq.
      	(__detail::__machine_flags): New function which returns a unique
      	uint64 depending on relevant -m and -f flags.
      	(__detail::__odr_helper): New type alias for either an anonymous
      	type or a type specialized with the __machine_flags number.
      	(_SimdIntOperators): Change template parameters from _Impl to
      	_Tp, _Abi because _Impl now has an __odr_helper parameter which
      	may be _OdrEnforcer from the anonymous namespace, which makes
      	for a bad base class.
      	(many): Either add __odr_helper template parameter or mark as
      	always_inline.
      	* include/experimental/bits/simd_detail.h: Add defines for
      	AVX512BITALG, AVX512VBMI2, AVX512VBMI, AVX512IFMA, AVX512CD,
      	AVX512VNNI, AVX512VPOPCNTDQ, and AVX512VP2INTERSECT.
      	* include/experimental/bits/simd_builtin.h: Add __odr_helper
      	template parameter or mark as always_inline.
      	* include/experimental/bits/simd_fixed_size.h: Ditto.
      	* include/experimental/bits/simd_math.h: Ditto.
      	* include/experimental/bits/simd_scalar.h: Ditto.
      	* include/experimental/bits/simd_neon.h: Add __odr_helper
      	template parameter.
      	* include/experimental/bits/simd_ppc.h: Ditto.
      	* include/experimental/bits/simd_x86.h: Ditto.
      52d28210
    • Uros Bizjak's avatar
      i386: Improve and optimize ix86_expand_sse_movcc · f4a2cecd
      Uros Bizjak authored
      Modernize ix86_expand_sse_movcc to use expand_simple_{unop,binop}
      infrastructure to avoid manual twiddling with output registers.
      Also fix a couple of inconsistent vector_all_ones_operand usages,
      break a couple of unnecessary else-if chains, eliminate common
      subexpressions and do some general code simplifications.
      
      2022-01-15  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      
      	* config/i386/i386-expand.c (ix86_expand_sse_movcc): Use
      	expand_simple_unop and expand_simple_binop instead of manually
      	constructing NOT, AND and IOR RTXes.  Use vector_all_ones_operand
      	consistently.  Eliminate common subexpressions and simplify code.
      	* config/i386/sse.md (<any_logic:code><MODEF:mode>3): New expander.
      	(<any_logic:code><MODEF:mode>3): Make public.
      f4a2cecd
    • Jonathan Yong's avatar
      libgcc: Fix __gthr_i486_lock_cmp_xchg clobber for Windows · dcf8fe1e
      Jonathan Yong authored
      2022-01-14  David  <gccbugzilla@limegreensocks.com>
      
      libgcc/
      	* config/i386/gthr-win32.c (__gthr_i486_lock_cmp_xchg):
      	Remove inlined version, Windows 95 is no longer relevant.
      	* config/i386/gthr-win32.h
      	(__GTHREAD_I486_INLINE_LOCK_PRIMITIVES): unset.
      dcf8fe1e
    • GCC Administrator's avatar
      Daily bump. · 617db51d
      GCC Administrator authored
      617db51d
  4. Jan 14, 2022
    • Andrew Pinski's avatar
      ada: Fix up handling of ghost units [PR104027] · 952b7dbb
      Andrew Pinski authored
      As reported, libgnat-12.so gets PT_GNU_STACK RWE, which means it doesn't
      work in some SELinux configurations.
      This is caused by the a-nbnbig.o file, which is a ghost unit and since
      r12-5670 the FE emits an object file for it, but exits before compile_file
      has a chance to finalize it e.g. with targetm.asm_out.file_end ()
      that emits the .note.GNU-stack section on various linux targets.
      
      Fixed by not existing but instead returning early to the caller.
      
      2022-01-14  Andrew Pinski  <apinski@marvell.com>
      
      	PR ada/104027
      	* gnat1drv.adb (Gnat1drv): After Back_End.Gen_Or_Update_Object_File
      	goto End_Of_Program.
      952b7dbb
    • David Malcolm's avatar
      analyzer: fix ICE when combining taint states has_ub and has_lb · cc3b67e4
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	* sm-taint.cc (taint_state_machine::combine_states): Handle combination
      	of has_ub and has_lb.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/analyzer/taint-merger.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      cc3b67e4
    • David Malcolm's avatar
      analyzer: fix ICE in taint checker on unary ops [PR104029] · 8931adfa
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/104029
      	* sm-taint.cc (taint_state_machine::alt_get_inherited_state):
      	Remove gcc_unreachable from default case for unary ops.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/104029
      	* gcc.dg/analyzer/pr104029.c: New test.
      	* gcc.dg/analyzer/taint-ops.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      8931adfa
    • Harald Anlauf's avatar
      Fortran: always reject alternate return specifier as argument of intrinsics · 70e24c96
      Harald Anlauf authored
      The intrinsics MOVE_ALLOC, C_F_POINTER, and C_F_PROCPOINTER require
      deferred checks of part of their actual argument types which may be of
      "any" type.  This however excludes alternate return specifiers which
      therefore must be unconditionally rejected for all standard intrinsics.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/99256
      	* intrinsic.c: Do not check formal argument type when checking
      	arguments of intrinsics for alternate return specifiers.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/99256
      	* gfortran.dg/altreturn_11.f90: New test.
      70e24c96
Loading