Commit Graph

191042 Commits

Author SHA1 Message Date
Jonathan Wakely
fa092570fb libstdc++: Rename non-reserved macros in config header [PR103650]
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.
2022-01-17 12:08:26 +00:00
Francois-Xavier Coudert
d573a303be Fortran: remove new files introduced by mistake
These two files were introduced by mistake in
86e3b476d5

gcc/testsuite/ChangeLog:

	* gfortran.dg/ieee/signaling_3.f90: Remove file.

libgfortran/ChangeLog:

	* ieee/issignaling_fallback.h: Remove file.
2022-01-17 12:15:27 +01:00
Martin Liska
a42805deb8 Make the tests working.
gcc/testsuite/ChangeLog:

	* g++.dg/uninit-pred-loop-1_b.C: Fix invalid warnings.
	* g++.dg/uninit-pred-loop-1_c.C: Likewise.
2022-01-17 12:13:00 +01:00
Martin Liska
91a38a35a7 Rename test-cases that are not executed.
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.
2022-01-17 12:12:55 +01:00
Martin Liska
4460c638fa Add check_effective_target_pytest3.
gcc/testsuite/ChangeLog:

	* lib/gcov.exp: Use check_effective_target_pytest3.
	* lib/target-supports.exp: Add check_effective_target_pytest3.
2022-01-17 11:28:47 +01:00
Matthias Kretz
84eb13b9d6 libstdc++: Don't fail if math_errhandling is not defined
Older glibc does not define math_errhandling with -ffast-math, in which
case floating-point exceptions are not used.

Signed-off-by: Matthias 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.
2022-01-17 11:27:32 +01:00
Martin Liska
57cfcb3eb2 Start using check-MAINTAINERS.py instead of legacy maintainers-verify.sh.
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.
2022-01-17 11:23:17 +01:00
Martin Liska
d4c02ec777 Fix test warnings.
PR testsuite/104035

gcc/testsuite/ChangeLog:

	* g++.dg/torture/pr57993-2.C: Fix warnings.
2022-01-17 10:55:55 +01:00
Jonathan Wakely
a923345c72 libstdc++: Add 'typename' to dependent types in atomic<shared_ptr<T>>
libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr_atomic.h (_Sp_atomic): Add typename
	to qualified-id for dependent type.
2022-01-17 09:48:09 +00:00
Thomas Schwinge
b75aab194e Extend test cases for references in OpenACC 'private' clauses
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.
2022-01-17 08:57:27 +01:00
Julian Brown
fbb438808e Test cases for references in OpenACC 'private' clauses
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: Thomas Schwinge <thomas@codesourcery.com>
2022-01-17 08:57:20 +01:00
Thomas Koenig
025a707d28 Allow for multiple defaults in endianness and r16 in GFORTRAN_CONVERT_UNIT.
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.
2022-01-17 07:29:35 +01:00
Kewen Lin
b3e77224ed rs6000: Use known constant for GET_MODE_NUNITS and similar
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.
2022-01-16 23:43:23 -06:00
Haochen Gui
240dd6c063 rs6000: Split pattern for TI to V1TI move [PR103124]
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.
2022-01-17 13:27:16 +08:00
GCC Administrator
1e942d7c05 Daily bump. 2022-01-17 00:16:24 +00:00
Jonathan Wakely
a326934886 libstdc++: Update C++20 status table
libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2020.xml: Update.
	* doc/html/manual/status.html: Regenerate.
2022-01-17 00:06:28 +00:00
Jonathan Wakely
2ac0649d7b libstdc++: Implement C++20 atomic<shared_ptr> and atomic<weak_ptr>
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: Thomas Rodgers <trodgers@redhat.com>
Signed-off-by: Thomas 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.
2022-01-17 00:06:28 +00:00
Francois-Xavier Coudert
86e3b476d5 Fortran: xfail signaling NaN testcases on x87
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.
2022-01-17 00:02:51 +01:00
Francois-Xavier Coudert
90045c5df5 Fortran: allow IEEE_VALUE to correctly return signaling NaNs
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.
2022-01-16 22:57:45 +01:00
Jonathan Wakely
bca1c431af libstdc++: Ignore deprecated warnings [PR104037]
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.
2022-01-16 20:18:10 +00:00
Mikael Morin
15630e6e9e testsuite: Enrich tests with variants failing on the branch.
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.
2022-01-16 19:13:01 +01:00
Kwok Cheung Yeung
a78b1ab1df amdgcn: Tune default OpenMP/OpenACC GPU utilization
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: Andrew Stubbs  <ams@codesourcery.com>
2022-01-16 17:25:36 +01:00
Olivier Hainque
9d7e19255c Add VxWorks fixincludes hack, open posix API for C++
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.
2022-01-16 09:22:14 +00:00
Olivier Hainque
943fad6702 Add VxWorks fixincludes hack, #include sysLib.h in time.h
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.
2022-01-16 09:22:14 +00:00
Olivier Hainque
00cc412660 Add VxWorks fixincludes hack, C99 FP classification
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.
2022-01-16 09:22:14 +00:00
wwwhhhyyy
1c2575586c [i386] GLC tuning: Break false dependency for dest register.
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.
2022-01-16 12:43:02 +08:00
GCC Administrator
9248ee4147 Daily bump. 2022-01-16 00:16:26 +00:00
Martin Sebor
9d6a0f388e Add -Wdangling-pointer [PR63272].
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.
2022-01-15 16:45:56 -07:00
Martin Sebor
671a283636 Add -Wuse-after-free [PR80532].
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.
2022-01-15 16:45:24 -07:00
Harald Anlauf
29401b7b45 Fortran: fix ICE and wrong code with TRANSFER and CHARACTER(kind=4)
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.
2022-01-15 22:33:00 +01:00
Matthias Kretz
52d2821038 libstdc++: Fix ODR issues with different -m flags
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: Matthias 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.
2022-01-15 21:05:17 +01:00
Uros Bizjak
f4a2cecd68 i386: Improve and optimize ix86_expand_sse_movcc
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.
2022-01-15 20:59:57 +01:00
Jonathan Yong
dcf8fe1eea libgcc: Fix __gthr_i486_lock_cmp_xchg clobber for Windows
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.
2022-01-15 13:32:05 +00:00
GCC Administrator
617db51d7e Daily bump. 2022-01-15 00:16:27 +00:00
Andrew Pinski
952b7dbb41 ada: Fix up handling of ghost units [PR104027]
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.
2022-01-14 23:58:38 +01:00
David Malcolm
cc3b67e401 analyzer: fix ICE when combining taint states has_ub and has_lb
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: David Malcolm <dmalcolm@redhat.com>
2022-01-14 17:51:26 -05:00
David Malcolm
8931adfa05 analyzer: fix ICE in taint checker on unary ops [PR104029]
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: David Malcolm <dmalcolm@redhat.com>
2022-01-14 17:50:37 -05:00
Harald Anlauf
70e24c9682 Fortran: always reject alternate return specifier as argument of intrinsics
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.
2022-01-14 21:48:15 +01:00
Eric Botcazou
c76b3bc55b Fix reverse scalar storage order issues in IPA-SRA
The IPA-SRA pass introduced in GCC 10 does not always play nice with the
reverse scalar storage order that can be used in structures/records/unions.
Reading the code, the pass apparently correctly detects it but fails to
propagate the information to the rewriting phase in some cases and, in
particular, does not stream it for LTO.

gcc/
	* ipa-param-manipulation.c (ipa_dump_adjusted_parameters): Dump
	reverse flag as "reverse" for the sake of consistency.
	* ipa-sra.c: Fix copyright year.
	(ipa_sra_function_summaries::duplicate): Copy the reverse flag.
	(dump_isra_access): Tweak dump line.
	(isra_write_node_summary): Write the reverse flag.
	(isra_read_node_info): Read it.
	(pull_accesses_from_callee): Test its consistency and copy it.

gcc/testsuite/
	* gnat.dg/lto25.adb: New test.
	* gnat.dg/opt96.adb: Likewise.
	* gnat.dg/opt96_pkg.ads, gnat.dg/opt96_pkg.adb: New helper.
2022-01-14 19:53:04 +01:00
Richard Sandiford
79ae13067f vect: Fix uninitialised variable PR104026
As noted by Tobias in the PR, the loop_vec_info constructor wasn't
initializing the new partial_load_store_bias field.

gcc/
	PR middle-end/104026
	* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
	partial_load_store_bias.
2022-01-14 18:41:12 +00:00
Harald Anlauf
a4a8ae123c Fortran: fix ICE overloading elemental intrinsics
gcc/fortran/ChangeLog:

	PR fortran/103782
	* expr.c (gfc_simplify_expr): Adjust logic for when to scalarize a
	call of an intrinsic which may have been overloaded.

gcc/testsuite/ChangeLog:

	PR fortran/103782
	* gfortran.dg/overload_4.f90: New test.
2022-01-14 19:16:04 +01:00
Martin Sebor
72332337e3 Use enclosing object size if it's smaller than member [PR 101475].
Resolves:
PR middle-end/101475 - missing -Wstringop-overflow storing a compound literal

gcc/ChangeLog:

	PR middle-end/101475
	* pointer-query.cc (handle_component_ref): Use the size of
	the enclosing object if it's smaller than the member.

gcc/testsuite/ChangeLog:

	PR middle-end/101475
	* gcc.dg/Wstringop-overflow-15.c: Remove xfails.
	* gcc.dg/Wstringop-overflow-68.c: Adjust, remove xfails.
	* gcc.dg/Wstringop-overflow-88.c: New test.
2022-01-14 11:13:08 -07:00
Martin Sebor
1e6294bb15 Test to verify -Wformat-overflow uses context-sensitive ranges.
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf-warn-28.c: New test.
2022-01-14 09:59:53 -07:00
Martin Liska
d82a54f564 configure: Regenerate.
Regenerate after change made in g:7c6ae994fb587c19ca14aebe18dbc9aca83be609.

gcc/ChangeLog:

	* configure: Regenerate.
2022-01-14 16:52:15 +01:00
Uros Bizjak
6795e6ae66 libstdc++: Fix 22_locale/numpunct/members/char/3.cc execution test
The test fails on Fedora 33+ because nl_NL locale got thousands
separator defined.  Use one of ar_SA, bg_BG, bs_BA, pt_PT
or plain C locale instead.

2022-01-14  Uroš Bizjak  <ubizjak@gmail.com>

libstdc++-v3/ChangeLog:

	* testsuite/22_locale/numpunct/members/char/3.cc:
	Require pt_PT locale instead of nl_NL.
	(test02): Use pt_PT locale instead of nl_NL.
2022-01-14 16:21:57 +01:00
Martin Liska
0dd4283a4b testsuite: fix dh-warning typo.
gcc/testsuite/ChangeLog:

	* c-c++-common/Walloca-larger-than.c: Fix typo.
2022-01-14 16:15:35 +01:00
Uros Bizjak
ffb7d4b2b7 i386: Mark some of strict_low_part insn constraints earlyclobbered
While there is practically impossible that input registers are matched
with in-out register, better mark the output operand of the split alternative
as earlyclobbered - we do output early to the output operand when
the insn is split.

2022-01-14  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/i386.md (*add<mode>_1_slp"):
	Mark alternative 1 output operand earlyclobbered.
	(*sub<mode>_1_slp): Ditto.
	(*and<mode>_1_slp): Ditto.
	(*<code><mode>_1_slp): Ditto.
	(*neg<mode>_1_slp): Ditto.
	(*one_cmpl<mode>_1_slp): Ditto.
	(*ashl<mode>3_1_slp): Ditto.
	(*<insn><mode>3_1_slp): Ditto.
	(*<insn><mode>3_1_slp): Ditto.
2022-01-14 16:06:00 +01:00
Martin Liska
74abb0beb4 testsuite: rename 2 files.
gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/pr56868.cpp: Moved to...
	* g++.dg/cpp0x/pr56868.C: ...here.
	* gcc.dg/torture/pr57993-2.cpp: Moved to...
	* g++.dg/torture/pr57993-2.C: ...here.
2022-01-14 15:22:40 +01:00
Martin Liska
d8b6447613 testsuite: rename files in c-c++-common.
gcc/testsuite/ChangeLog:

	* c-c++-common/Walloca-larger-than.C: Moved to...
	* c-c++-common/Walloca-larger-than.c: ...here.
2022-01-14 15:06:23 +01:00
Chung-Lin Tang
cd7484d05c openmp: Fix ICE in [PR103705]
Fix ICE for cases like:
  #pragma omp target update from(s[0].a[0:1])

where multiple ARRAY_REF nodes exist and require more than one peeling
during [c_]finish_omp_clauses.

	PR c++/103705

gcc/c/ChangeLog:

	* c-typeck.c (c_finish_omp_clauses): Also continue peeling off of
	outer node for ARRAY_REFs.

gcc/cp/ChangeLog:

	* semantics.c (finish_omp_clauses): Also continue peeling off of
	outer node for ARRAY_REFs.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/pr103705.c: New test.
2022-01-14 21:58:34 +08:00