Commit Graph

226372 Commits

Author SHA1 Message Date
Andrew Pinski
7a456056ff testsuite/aarch64: Fix aarch64/signbitv2sf.c [PR122522]
The problem here is after some heurstics changes the check
loop is now unrolled so we eliminate the array. This means
the check for not having -2147483648 no longer works as
we don't handle SLP in this case.
So the best option is to force the check loop not to unroll
(no vectorize) as this is just testing we SLP the normal
signbit places rather than dealing with the checking loop.

Pushed as obvious after testing the testcase on aarch64-linux-gnu.

	PR testsuite/122522
gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/signbitv2sf.c (main): Disable
	unrolling and vectorizer for the checking loop.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2026-01-13 11:49:07 -08:00
Martin Uecker
e2acc3d38e c: fix checking ICE related to transparent unions and atomic [PR123309]
When matching function arguments in composite_type_internal and one
type comes from a transparent union, it is possible to end up with
atomic and non-atomic types because this case is not handled correctly.
The type matching logic is rewritten in a cleaner way to use helper
functions and to not walk the argument lists three times.  With this
change, a checking assertion can be added to test for matching qualifiers
for pointers. (In general, this assumption is still violated for
function return types.)

	PR c/123309

gcc/c/ChangeLog:
	* c-typeck.cc (transparent_union_replacement): New function.
	(composite_type_internal): Rewrite logic.
	(type_lists_compatible_p): Remove dead code for NULL arguments.

gcc/testsuite/ChangeLog:
	* gcc.dg/pr123309.c: New test.
	* gcc.dg/union-composite-type.c: New test.
2026-01-13 20:32:56 +01:00
Tomasz Kamiński
76ad28b112 libstdc++: Fix handling iterators with proxy subscript in heap algorithms.
This patch replaces uses of subscripts in heap algorithms, that where introduced
in r16-4100-gaaeca77a79a9a8 with dereference of advanced iterators.

The Cpp17RandomAccessIterator requirements, allows operator[] to return any
type that is convertible to reference, however user-provided comparators are
required only to accept result of dereferencing the iterator (i.e. reference
directly). This is visible, when comparator defines operator() for which
template arguments can be deduduced from reference (which will fail on proxy)
or that accepts types convertible from reference (see included tests).

For test we introduce a new proxy_random_access_iterator_wrapper iterator
in testsuite_iterators.h, that returns a proxy type from subscript operator.
This is separate type (instead of additional template argument and aliases),
as it used for test that work with C++98.

libstdc++-v3/ChangeLog:

	* include/bits/stl_heap.h (std::__is_heap_until, std::__push_heap)
	(std::__adjust_heap): Replace subscript with dereference of
	advanced iterator.
	* testsuite/util/testsuite_iterators.h (__gnu_test::subscript_proxy)
	(__gnu_test::proxy_random_access_iterator_wrapper): Define.
	* testsuite/25_algorithms/sort_heap/check_proxy_brackets.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2026-01-13 19:14:26 +01:00
Jerry DeLisle
17582084fa Fortran: Detect missing quote in namelist read.
PR libfortran/123012

libgfortran/ChangeLog:

	* io/list_read.c (read_character): Add new check after
	get_string and provide better comments.

gcc/testsuite/ChangeLog:

	* gfortran.dg/namelist_101.f90: New test.
2026-01-13 09:55:12 -08:00
Andrew Pinski
e0a8b63625 ifcvt: Improve cmp?a&b:a to try with -1 [PR123312]
After the current improvements to ifcvt, on some targets for
cmp?a&b:a it is better to produce `(cmp?b:-1) & a` rather than
`(!cmp?a:0)|(a & b)`. So this extends noce_try_cond_zero_arith (with
a rename to noce_try_cond_arith) to see if `cmp ? a : -1` is cheaper than
`!cmp?a:0`.

Bootstrapped and tested on x86_64-linux-gnu.

	PR rtl-optimization/123312
gcc/ChangeLog:

	* ifcvt.cc (noce_try_cond_zero_arith): Rename to ...
	(noce_try_cond_arith): This. For AND try `cmp ? a : -1`
	also to see which one cost less.
	(noce_process_if_block): Handle the rename.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2026-01-13 09:52:31 -08:00
Jonathan Yong
ecc06d4563 winnt-utf8.manifest: make long path aware
Based on:
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#longpathaware

gcc:
	* config/i386/winnt-utf8.manifest: enable longPathAware.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
2026-01-13 17:41:10 +00:00
Jonathan Yong
610466e9f3 winnt-utf8.manifest: Use XML example from Microsoft
Based on example from:
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activecodepage

	PR driver/108865

gcc:
	* config/i386/winnt-utf8.manifest: correct XML tags

Signed-off-by: Jonathan Yong <10walls@gmail.com>
2026-01-13 17:41:09 +00:00
Jeff Law
77ff7c2bb2 [PR tree-optimization/123530] Fix ICE in recently added match.pd pattern
The gimple optimization passes can create negative shift counts and pass them
into the simplification routines as seen by the code in pr123530.  If we then
call tree_to_uhwi on those values we get a nice little ICE.

This guards the tree_to_uhwi calls on tree_fits_uhwi_p and resolves the ICE.  I
just protected them all in this recently added pattern.

Bootstrapped and regression tested on x86 and riscv.  Also tested on the rest
of the embedded targets without any regressions.

Pushing to the trunk.

	PR tree-optimization/123530
gcc/
	* match.pd (reassociating xor to enable rotations): Verify constants
	fit into a uhwi before trying to extract them as a uhwi.

gcc/testsuite/
	* gcc.dg/torture/pr123530.c: New test.
2026-01-13 07:16:05 -07:00
Richard Biener
e787d5ace5 middle-end/123573 - fix VEC_PERM folding more
The following fixes the fix from r16-6709-ga4716ece529dfd some
more by making sure permute to one operand folding faces same
element number vectors but also insert a VIEW_CONVERT_EXPR for
the case one is VLA and one is VLS (when the VLA case is actually
constant, like with -msve-vector-bits=128).  It also makes the
assert that output and input element numbers match done in
fold_vec_perm which this pattern eventually dispatches to into
a check (as the comment already indicates).

Testcases are in the target specific aarch64 testsuite already.

	PR middle-end/123573
	* fold-const.cc (fold_vec_perm): Actually check, not assert,
	that input and output vector element numbers agree.
	* match.pd (vec_perm @0 @1 @2): Make sure element numbers
	are the same when folding to an input vector and wrap that
	inside a VIEW_CONVERT_EXPR.
2026-01-13 14:39:58 +01:00
Robin Dapp
939dd2324e forwprop: Fix type mismatch in vec constructor [PR123525].
This issue got raised after r16-6671 in which I removed checks for
number-of-element equality.  In the splat case with conversion:

  vector(16) int w;
  vector(8) long int v;
  _13 = BIT_FIELD_REF <w_12(D), 32, 160>;
  _2 = (long int) _13;
  _3 = (long int) _13;
  ...
  _9 = (long int) _13;
  _1 = {_2, _3, _4, _5, _6, _7, _8, _9};

right now we do
  _16 = VEC_PERM_EXPR <w_12(D), w_12(D), { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }>;
  _17 = VIEW_CONVERT_EXPR<vector(8) intD.6>(_16);

where the view convert is actually an optimized
  _17 = BIT_FIELD_REF (_16, 512, 0);

512 is the size of the unconverted source but we should actually use the
converted source type.  That's what this patch does.

	PR tree-optimization/123525

gcc/ChangeLog:

	* tree-ssa-forwprop.cc (simplify_vector_constructor): Use
	converted source type for conversion bit field ref.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/pr123525.c: New test.
	* g++.dg/vect/pr123525-2.cc: New test.
2026-01-13 12:47:38 +01:00
Robin Dapp
0616834fef if-conv: Prevent vector types in scalar cond reduction [PR123301].
Currently we allow vector types in scalar conditional reductions by
accident (via the GNU vector extension).  This patch prevents that.

	PR tree-optimization/123301

gcc/ChangeLog:

	* tree-if-conv.cc (convert_scalar_cond_reduction):
	Disallow vector types.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/pr123301.c: New test.
2026-01-13 12:47:38 +01:00
Robin Dapp
659f4d0e1e rtlanal: Determine nonzero bits of popcount from operand [PR123501].
The PR involves large mask vectors (e.g. V128BI) from which we take
the popcount.  Currently a (popcount:DI (V128BI)) is assumed to have
at most 8 set bits as we assume the popcount operand also has DImode.

This patch uses the operand mode for unary operations and thus
calculates a proper nonzero-bits mask.

We could do the same estimate for ctz and clz but they use nonzero in a
non-poly way and I didn't want to change more than necessary.  Therefore
the patch just returns -1 when we have a different operand mode for
ctz/clz.

	PR rtl-optimization/123501
	PR rtl-optimization/123444

gcc/ChangeLog:

	* rtlanal.cc (nonzero_bits1): Use operand mode instead of
	operation mode.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/reduc/pr123501.c: New test.
2026-01-13 12:47:38 +01:00
Thomas Schwinge
105fddf356 amdgcn: Adjust failure mode for gfx908 USM: 'libgomp.fortran/map-alloc-comp-9-usm.f90'
The change/rationale that commit 1cf9fda493
"amdgcn: Adjust failure mode for gfx908 USM" applied to a number of test cases
likewise applies to 'libgomp.fortran/map-alloc-comp-9-usm.f90'.

	libgomp/
	* testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90: Require
	working Unified Shared Memory to run the test.
2026-01-13 11:10:03 +01:00
Thomas Schwinge
954f804b73 openmp: Bump Version from 4.5 to 5.2 (2/4): Some more '-Wno-deprecated-openmp'
These changes should've been included in
commit 382edf047e
"openmp: Bump Version from 4.5 to 5.2 (2/4)", to avoid some more instances of:

    warning: use of 'omp declare target' as a synonym for 'omp begin declare target' has been deprecated since OpenMP 5.2 [-Wdeprecated-openmp]

    warning: 'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' [-Wdeprecated-openmp]

    Warning: Non-C_PTR type argument at (1) is deprecated, use HAS_DEVICE_ADDR [-Wdeprecated-openmp]

    Warning: 'to' clause with 'declare target' at (1) deprecated since OpenMP 5.2, use 'enter' [-Wdeprecated-openmp]

	libgomp/
	* testsuite/libgomp.c++/examples-4/declare_target-2.C: Add
	'-Wno-deprecated-openmp'.
	* testsuite/libgomp.c/declare-variant-3-sm30.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm35.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm37.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm52.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm53.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm61.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm70.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm75.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm80.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm89.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c:
	Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1030.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1031.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1032.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1033.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1034.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1035.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1036.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx11-generic.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1100.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1101.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1102.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1103.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1150.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1151.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1152.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx1153.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c:
	Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx9-generic.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx900.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx902.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx904.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx906.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx908.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx909.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx90a.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx90c.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx942.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx950.c: Likewise.
	* testsuite/libgomp.c/examples-4/async_target-2.c: Likewise.
	* testsuite/libgomp.c/interop-hsa.c: Likewise.
	* testsuite/libgomp.c/target-20.c: Likewise.
	* testsuite/libgomp.c/target-simd-clone-1.c: Likewise.
	* testsuite/libgomp.c/target-simd-clone-2.c: Likewise.
	* testsuite/libgomp.c/target-simd-clone-3.c: Likewise.
	* testsuite/libgomp.fortran/alloc-managed-1.f90: Likewise.
	* testsuite/libgomp.fortran/target9.f90: Likewise.
2026-01-13 11:08:34 +01:00
Thomas Schwinge
ba21851b8d openmp: Bump Version from 4.5 to 5.2 (2/4): 'libgomp.oacc-c-c++-common/vred2d-128.c' [PR123098]
'libgomp.oacc-c-c++-common/vred2d-128.c' had gotten '-Wno-deprecated-openmp'
applied as part of commit 382edf047e
"openmp: Bump Version from 4.5 to 5.2 (2/4)", which conceptually doesn't make
sense, as 'libgomp.oacc-c-c++-common/vred2d-128.c' isn't an OpenMP test case.
In commit 9c119b0fdd
"openmp: Limit - reduction -Wdeprecated-openmp diagnostics to OpenMP, testsuite fixes [PR123098]",
the erroneous diagnostic got disabled, so we don't need
'-Wno-deprecated-openmp' anymore.

	PR testsuite/123098
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Remove
	'-Wno-deprecated-openmp'.
2026-01-13 11:07:21 +01:00
Jakub Jelinek
8a99fdb704 Use -latomic_asneeded or -lgcc_s_asneeded to workaround libtool issues [PR123396]
On Mon, Jan 12, 2026 at 12:13:35PM +0100, Florian Weimer wrote:
> One way to work around the libtool problem would be to stick the
> as-needed into an existing .so linker script, or create a new one under
> a different name (say libatomic_optional.so) that has AS_NEEDED in it,
> and link with -latomic_optional.  Then libtool would not have to be
> taught about --push-state/--pop-state etc.

That seems to work.

So far bootstrapped (c,c++,fortran,lto only) and make install tested
on x86_64-linux, tested on a small program without need to libatomic and
struct S { char a[25]; };
_Atomic struct S s;

int main () { struct S t = s; s = t; }
which does at -O0.
Before this patch I got
for i in `find x86_64-pc-linux-gnu/ -name lib\*.so.\*.\*`; do ldd -u $i 2>&1 | grep -q libatomic.so.1 && echo $i; done
x86_64-pc-linux-gnu/libsanitizer/ubsan/.libs/libubsan.so.1.0.0
x86_64-pc-linux-gnu/libsanitizer/asan/.libs/libasan.so.8.0.0
x86_64-pc-linux-gnu/libsanitizer/hwasan/.libs/libhwasan.so.0.0.0
x86_64-pc-linux-gnu/libsanitizer/lsan/.libs/liblsan.so.0.0.0
x86_64-pc-linux-gnu/libsanitizer/tsan/.libs/libtsan.so.2.0.0
x86_64-pc-linux-gnu/32/libsanitizer/ubsan/.libs/libubsan.so.1.0.0
x86_64-pc-linux-gnu/32/libsanitizer/asan/.libs/libasan.so.8.0.0
x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6.0.35
x86_64-pc-linux-gnu/libgcobol/.libs/libgcobol.so.2.0.0
x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.35
With this patch it prints nothing.

2026-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR libstdc++/123396
gcc/
	* configure.ac (gcc_cv_ld_use_as_needed_ldscript): New test.
	(USE_LD_AS_NEEDED_LDSCRIPT): New AC_DEFINE.
	* gcc.cc (LINK_LIBATOMIC_SPEC): Use "-latomic_asneeded" instead
	of LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION
	if USE_LD_AS_NEEDED_LDSCRIPT is defined.
	(init_gcc_specs): Use "-lgcc_s_asneeded" instead of
	LD_AS_NEEDED_OPTION " -lgcc_s " LD_NO_AS_NEEDED_OPTION
	if USE_LD_AS_NEEDED_LDSCRIPT is defined.
	* config.in: Regenerate.
	* configure: Regenerate.
libatomic/
	* acinclude.m4 (LIBAT_BUILD_ASNEEDED_SOLINK): New AM_CONDITIONAL.
	* libatomic_asneeded.so: New file.
	* libatomic_asneeded.a: New file.
	* Makefile.am (toolexeclib_DATA): Set if LIBAT_BUILD_ASNEEDED_SOLINK.
	(all-local): Install those files into gcc subdir.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
libgcc/
	* config/t-slibgcc (SHLIB_ASNEEDED_SOLINK,
	SHLIB_MAKE_ASNEEDED_SOLINK, SHLIB_INSTALL_ASNEEDED_SOLINK): New
	vars.
	(SHLIB_LINK): Include $(SHLIB_MAKE_ASNEEDED_SOLINK).
	(SHLIB_INSTALL): Include $(SHLIB_INSTALL_ASNEEDED_SOLINK).
2026-01-13 10:06:47 +01:00
Paul Thomas
fdfb045223 Fortran: Check constant PDT type specification parameters [PR112460]
2026-01-14  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/112460
	* array.cc (resolve_array_list): Stash the first PDT element
	and check its type specification parameters against those of
	subsequent elements.
	* expr.cc (get_parm_list_from_expr): New function to extract the
	type spec lists from expressions to be compared.
	(gfc_check_type_spec_parms): New function to compare type spec
	lists between two expressions. Emit an error if any constant
	values are different.
	(gfc_check_assign): Check that the PDT type specification parms
	are the same on lhs and rhs.
	* gfortran.h : Add prototype for gfc_check_type_spec_parms.
	* trans-expr.cc (copyable_array_p): PDT arrays are not copyable

gcc/testsuite
	PR fortran/112460
	* gfortran.dg/pdt_81.f03: New test.
2026-01-13 08:19:05 +00:00
Richard Biener
47d09318c4 tree-optimization/123539 - signed UB in vector reduction
With previous changes I overlooked one use of vectype.

	PR tree-optimization/123539
	* tree-vect-loop.cc (vect_create_epilog_for_reduction):
	Use the compute vectype to pun down to smaller or element
	size for by-element reductions.
2026-01-13 09:08:32 +01:00
Andrew Pinski
f8a2eb766f xfail store_merging_19.c for the same reason as store_merging_18.c
store_merging_19.c is almost the same as store_merging_18.c except
it has assume align in it to allow it work on strict align targets.
Somehow when I was looking at the testresults I noticed 18 but not 19
when I was looking into failures.

Pushed as obvious.

gcc/testsuite/ChangeLog:

	* gcc.dg/store_merging_19.c: xfail.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2026-01-12 21:10:44 -08:00
Kito Cheng
cbb9d38152 VN: Fix VN ICE for large _BitInt types
gcc.dg/torture/bitint-18.c triggers an ICE in push_partial_def when
compiling for RISC-V with -O2.  The issue occurs because
build_nonstandard_integer_type cannot handle bit widths larger than
MAX_FIXED_MODE_SIZE.

For BITINT_TYPE with maxsizei > MAX_FIXED_MODE_SIZE, use build_bitint_type
instead of build_nonstandard_integer_type, similar to what tree-sra.cc does.

gcc/ChangeLog:

	* tree-ssa-sccvn.cc (vn_walk_cb_data::push_partial_def): Use
	build_bitint_type for BITINT_TYPE when maxsizei exceeds
	MAX_FIXED_MODE_SIZE.
2026-01-13 11:23:40 +08:00
Kito Cheng
808b684172 RISC-V: Add support for _BitInt [PR117581]
This patch implements _BitInt support for RISC-V target by defining the
type layout and ABI requirements.  The limb mode selection is based on
the bit width, using appropriate integer modes from QImode to TImode.
The implementation also adds the necessary libgcc version symbols for
_BitInt runtime support functions.

Changes in v3:
- Require sync_char_short effective target for bitint-64.c, bitint-82.c
  and bitint-84.c tests since they use atomic operations.
- Add -fno-section-anchors to bitint-32-on-rv64.c and adjust expected
  assembly output patterns.

Changes in v2:
- limb_mode use up to XLEN when N > XLEN, which is different setting from
  the abi_limb_mode.
- Adding missing floatbitinthf in libgcc.

gcc/ChangeLog:

	PR target/117581
	* config/riscv/riscv.cc (riscv_bitint_type_info): New function.
	(TARGET_C_BITINT_TYPE_INFO): Define.

gcc/testsuite/ChangeLog:

	PR target/117581
	* gcc.dg/torture/bitint-64.c: Add sync_char_short effective target
	requirement.
	* gcc.dg/torture/bitint-82.c: Likewise.
	* gcc.dg/torture/bitint-84.c: Likewise.
	* gcc.target/riscv/bitint-32-on-rv64.c: New test.
	* gcc.target/riscv/bitint-alignments.c: New test.
	* gcc.target/riscv/bitint-args.c: New test.
	* gcc.target/riscv/bitint-sizes.c: New test.

libgcc/ChangeLog:

	PR target/117581
	* config/riscv/libgcc-riscv.ver: New file.
	* config/riscv/t-elf (SHLIB_MAPFILES): Add libgcc-riscv.ver.
	* config/riscv/t-softfp32 (softfp_extras): Add floatbitinttf and
	fixtfbitint.
2026-01-13 11:23:40 +08:00
H.J. Lu
e6470a44a2 pr122458.c: Replace .quad with .dc.a
Replace .quad with .dc.a to avoid

/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/tools-build/gcc/build-x86_64-linux/gcc/ /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/ipa/pr122458.c -m32 -fdiagnostics-plain-output -O2 -lm -o pr122458.exe
/usr/local/bin/as: /tmp/cc9Bw0pX.o: unsupported relocation type: 0x1
/tmp/ccGrIiOC.s: Assembler messages:
/tmp/ccGrIiOC.s:4: Error: cannot represent relocation type BFD_RELOC_64
compiler exited with status 1
FAIL: gcc.dg/ipa/pr122458.c (test for excess errors)

for 32-bit targets.

	PR ipa/122458
	* gcc.dg/ipa/pr122458.c: Replace .quad with .dc.a.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2026-01-13 11:17:57 +08:00
liuhongt
808fc71d15 Add TARGET_MMX_WITH_SSE to the condition of all 64-bit _Float16 vector related patterns.
gcc/ChangeLog:

	PR target/123484
	* config/i386/mmx.md (divv4hf3): Add TARGET_MMX_WITH_SSE to
	the condition.
	(cmlav4hf4): Ditto.
	(cmla_conjv4hf4): Ditto.
	(cmulv4hf3): Ditto.
	(cmul_conjv4hf3): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr123484.c: New test.
2026-01-12 18:05:47 -08:00
GCC Administrator
7c3584be8c Daily bump. 2026-01-13 00:16:32 +00:00
Andrew Pinski
50df2b1884 match: Simplify (T1)(a bit_op (T2)b) to ((T1)a bit_op b) When b is T1 type and truncating from T2 [PR122845]
This adds the simpliciation of:
```
  <unnamed-signed:3> _1;

  _2 = (signed char) _1;
  _3 = _2 ^ -47;
  _4 = (<unnamed-signed:3>) _3;
```

to:
```
  <unnamed-signed:3> _n;
  _4 = _1 ^ -47;
```

This also fixes PR 122843 by optimizing out the xor such that we get:
```
  _1 = b.a;
  _21 = (<unnamed-signed:3>) t_23(D);
  // t_23 in the original testcase was 200 so this is reduced to 0
  _5 = _1 ^ _21;
  # .MEM_24 = VDEF <.MEM_13>
  b.a = _5;
```
And then there is no cast catch this pattern:
`(bit_xor (convert1? (bit_xor:c @0 @1)) (convert2? (bit_xor:c @0 @2)))`
As we get:
```
  _21 = (<unnamed-signed:3>) t_23(D);
  _5 = _1 ^ _21;
  _22 = (<unnamed-signed:3>) t_23(D);
  _7 = _5 ^ _22;
  _25 = (<unnamed-signed:3>) t_23(D);
  _8 = _7 ^ _25;
  _26 = (<unnamed-signed:3>) t_23(D);
  _9 = _7 ^ _26;
```
After unrolling and then fre will optimize away all of those xor.

Bootstrapped and tested on x86_64-linux-gnu.

	PR tree-optimization/122845
	PR tree-optimization/122843
gcc/ChangeLog:

	* match.pd (`(T1)(a bit_op (T2)b)`): Also
	simplify if T1 is the same type as b and T2 is wider
	type than T1.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/bitops-12.c: New test.
	* gcc.dg/tree-ssa/bitops-13.c: New test.
	* gcc.dg/store_merging_18.c: xfail store merging.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2026-01-12 14:16:20 -08:00
Steven G. Kargl
4cf4b2cd2a Fortran: Add additional checks for constant expressions.
PR fortran/91960

gcc/fortran/ChangeLog:

	* resolve.cc (resolve_fl_parameter): Check the righthand symbol
	is a constant expression.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr69962.f90: Adjust testcase to ignore new error message.
	* gfortran.dg/pr91960_1.f90: New test.
	* gfortran.dg/pr91960_2.f90: New test.
2026-01-12 14:06:04 -08:00
Patrick Palka
716f4482c5 c++: deferred noexcept parsing for friend tmpl spec [PR123189]
Since we now defer noexcept parsing for templated friends, a couple of
routines related to deferred parsing need to be updated to cope with friend
template specializations -- their TI_TEMPLATE is a TREE_LIST rather than
a TEMPLATE_DECL, and they don't introduce new template parameters.

	PR c++/123189

gcc/cp/ChangeLog:

	* name-lookup.cc (binding_to_template_parms_of_scope_p):
	Gracefully handle TEMPLATE_INFO whose TI_TEMPLATE is a TREE_LIST.
	* pt.cc (maybe_begin_member_template_processing): For a friend
	template specialization consider its class context instead.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/noexcept92.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2026-01-12 11:21:14 -05:00
Jason Merrill
f36534fe5f c++: tweak testcase for --stds=impcx
Implicit constexpr makes the use of x disappear, avoiding the exposure and
thus the diagnostic.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/internal-17_b.C: Add -fno-implicit-constexpr.
2026-01-13 00:19:19 +08:00
Jason Merrill
3d84356bcb c++: more gnu_inline linkage adjustment
Since r16-6477 we allow a gnu_inline to be a key method, because it is only
emitted in one place.  It occurs to me that we should make the same
adjustment to other places that check DECL_DECLARED_INLINE_P to decide if a
function has inline/vague/comdat linkage.

	PR libstdc++/123326

gcc/cp/ChangeLog:

	* cp-tree.h (DECL_NONGNU_INLINE_P): New.
	* decl.cc (duplicate_decls, start_decl): Check it.
	* decl2.cc (vague_linkage_p, import_export_class): Likewise.
	(vtables_uniquely_emitted, import_export_decl): Likewise.
	* class.cc (determine_key_method): Check it instead of
	lookup_attribute.
2026-01-13 00:18:35 +08:00
Richard Biener
80c314ce49 tree-optimization/123528 - tighten bool pattern check
The following makes sure we're only applying bool patterns for
conversions to scalar integer or float types.

	PR tree-optimization/123528
	* tree-vect-patterns.cc (vect_recog_bool_pattern): Restore
	INTEGRAL_TYPE_P check but also allow SCALAR_FLOAT_TYPE_P.

	* gcc.dg/vect/vect-pr12358.c: New testcase.
2026-01-12 15:39:19 +01:00
Maciej W. Rozycki
0c775dcf3e libiberty: Make objalloc_free' free'-like WRT null pointer
Inspired by a suggestion from Jan Beulich to make one of `objalloc_free'
callers `free'-like with respect to null pointer argument handling make
the function return with no action taken rather than crashing when such
a pointer is passed.  This is to make the API consistent with ISO C and
to relieve all the callers from having to check for a null pointer.

	libiberty/
	* objalloc.c (objalloc_free): Don't use the pointer passed if
	null.
2026-01-12 13:08:28 +00:00
Claudio Bantaloukas
392035010f aarch64: Fix copyright year.
Initial patch mistakenly added copyright year 2025.

gcc/testsuite/Changelog:

	* gcc.target/aarch64/pch/aarch64-pch.exp: Fix copyright year.
2026-01-12 13:02:44 +00:00
Claudio Bantaloukas
27b8075786 aarch64: Add tests checking use of arm_sve.h et al in a pch [PR123457]
These tests check that including files using aarch64 specific pragmas in
headers that become precompiled headers works.

Built and tested for aarch64-linux-gnu on top of Andrew's patch.

gcc/testsuite/Changelog:
	PR target/123457
	* gcc.target/aarch64/pch/aarch64-pch.exp: Add new testsuite.
	* gcc.target/aarch64/pch/pch_arm_acle.c: Add new test file.
	* gcc.target/aarch64/pch/pch_arm_acle.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_acle_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_acle_include_post.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_multiple.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_multiple.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_multiple_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_multiple_include_post.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_include_post.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_sve_bridge.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_sve_bridge.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_sve_bridge_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_neon_sve_bridge_include_post.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sme.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sme.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sme_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sme_include_post.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sve.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sve.hs: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sve_include_post.c: Likewise.
	* gcc.target/aarch64/pch/pch_arm_sve_include_post.hs: Likewise.
2026-01-12 12:35:32 +00:00
Martin Jambor
1f372a2980 ipa-cp: Fix ipa-bit-cp test for recipient_only lattices
Unfortunately I made a silly copy-and paste error in may patch
introducing the recipient_only flag.  This patch fixes it, correctly
bailing out in ipa-bit-cp when it is set during propagation.

gcc/ChangeLog:

2026-01-12  Martin Jambor  <mjambor@suse.cz>

	PR ipa/123543
	* ipa-cp.cc (propagate_bits_across_jump_function): Fix test for
	recipient_only_p.

gcc/testsuite/ChangeLog:

2026-01-12  Martin Jambor  <mjambor@suse.cz>

	PR ipa/123543
	* gcc.dg/ipa/pr123543.c: New test.
2026-01-12 13:32:09 +01:00
Claudio Bantaloukas
e07eaf92e3 aarch64: Update target checks for sme2 fp8
Commits gcc-16-6381-g226d5fd59dc8 and gcc-16-6380-gef533d234293 had
insufficient target checks and this caused regressions on the linaro CI
which uses an older binutils version.

This change adds the needed checks.

gcc/testsuite/Changelog:
	* gcc.target/aarch64/sme2/acle-asm/cvt_mf8_bf16_x2.c: Added target checks.
	* gcc.target/aarch64/sme2/acle-asm/cvt_mf8_f16_x2.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/cvt_mf8_f32_x4.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/cvtn_mf8_f32_x4.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f16_x2.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f16_x4.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f32_x2.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f32_x4.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f64_x2.c: Likewise.
	* gcc.target/aarch64/sme2/acle-asm/scale_f64_x4.c: Likewise.
2026-01-12 12:29:10 +00:00
Jakub Jelinek
aac4d230a0 Bump BASE-VER to 16.0.1 now that we are in stage4.
* BASE-VER: Bump to 16.0.1.
2026-01-12 13:05:25 +01:00
Jakub Jelinek
6d8cb71843 s390: Fix ABI issue in libstdc++.so.6
On Sat, Jan 10, 2026 at 05:24:15PM +0100, Stefan Schulze Frielinghaus wrote:
> libstdc++-v3/ChangeLog:
>
>       * config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Add
>       names {,P,K}DF16.

This is wrong - an ABI issue.

You can't export new symbols in CXXABI_1.3.14 symbol version when they
weren't exported there in GCC 13.1 already.
Symbols new in GCC 16 like these should be exported in CXXABI_1.3.17.

Fixed thusly.

2026-01-12  Jakub Jelinek  <jakub@redhat.com>

	* config/abi/pre/gnu.ver (CXXABI_1.3.14): Don't export _ZTI*DF16_ on
	s390x.
	(CXXABI_1.3.17): Export _ZTI*DF16_ on s390x.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Remove
	_ZTI{,P,K}DF16_.
2026-01-12 12:41:41 +01:00
Richard Biener
1c7824f0b8 tree-optimization/122830 - move VN through aggregate copies
The following generalizes the few hacks we have to more loosely
allow VN through aggregate copies to a more general (but also
restrictive) feature to rewrite the lookup to a new base with
a constant offset.  This should now allow all constant-indexed
aggregate copies and it does never leave any stray components
and hoping for the best.

This resolves the diagnostic regression reported in PR122824.

	PR tree-optimization/122830
	PR tree-optimization/122824
	* tree-ssa-sccvn.cc (vn_reference_lookup_3): Generalize
	aggregate copy handling when no variable offsets are
	involved.

	* gcc.dg/tree-ssa/ssa-fre-112.c: New testcase.
	* g++.dg/warn/Warray-bounds-pr122824.C: Likewise.
2026-01-12 12:40:12 +01:00
Richard Biener
d321c9ddf8 Fix extra_off mis-computation during aggregate copy VN
With the rewrite of aggregate copy handling in r16-2729-g0d276cd378e7a4
there's an error introduced which accumulates extra_off even if we
throw away some of the tentative component consumption.  The following
fixes this.

	* tree-ssa-sccvn.cc (vn_reference_lookup_3): Only tentatively
	accumulate extra_off when tentatively consuming components
	during aggregate copy handling.
2026-01-12 12:40:12 +01:00
Jonathan Wakely
b8634efdb7 libstdc++: Stop using some reserved names in src/c++20/atomic.cc
libstdc++-v3/ChangeLog:

	* src/c++20/atomic.cc (__detail::__spin_impl): Do not use
	reserved names for variables.
2026-01-12 11:38:59 +00:00
Jonathan Wakely
59bc37debf libstdc++: Improve comments on __wait_args::_M_setup_proxy_wait
libstdc++-v3/ChangeLog:

	* include/bits/atomic_wait.h (__wait_args): Improve comments.
	* src/c++20/atomic.cc (__wait_args::_M_setup_proxy_wait):
	Improve comment.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2026-01-12 11:38:58 +00:00
Tomasz Kamiński
da5a5c5528 libstdc++: Fix generate_cannonical test for 128bit floating points.
This updates test01, so it properly handle 128bit floating points,
including situation when long double uses such representation.
Firstly, the computation of skips is corrected, by discarding number
values equal to number of calls required to generate element
(skips become zero for all non-float correctly). Furthermore, checks
of histogram for types using iec559 representation, is moved inside
test01 function, so we use correct value for long double, depending
on number of digits in mantissa on given platform.

We also extend test to cover __float128, to test 128bit floating
point on more platforms.

libstdc++-v3/ChangeLog:

	* testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc:
	Updated test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2026-01-12 11:58:07 +01:00
Richard Biener
a4716ece52 middle-end/123175 - fix parts of const VEC_PERM with relaxed input sizes
The following fixes enough of const VEC_PERM folding and lowering
to deal with the fallout for the two testcases from the PR.  We
usually do not generate such problematic VEC_PERM expressions, but
we allow those since GCC 14.  As can be seen we mishandle those,
including failure to expand/lower them by zero-extending inputs (which is
what __builtin_shufflevector does).

I'm unsure as to what extent we get such permutes but Tamar indicates
that aarch64 can handle those at least.

	PR middle-end/123175
	* match.pd (vec_perm @0 @1 @2): Fixup for inputs having a
	different number of elements than the result.
	* tree-vect-generic.cc (lower_vec_perm): Likewise.

	* gcc.dg/torture/pr123175-1.c: New testcase.
	* gcc.dg/torture/pr123175-2.c: Likewise.
2026-01-12 10:50:08 +01:00
Rainer Orth
c885d2a055 libgomp: Skip libgomp.c++/target-cdtor-2.C on Solaris [PR81337]
The libgomp.c++/target-cdtor-2.C test FAILs on Solaris:

FAIL: libgomp.c++/target-cdtor-2.C output pattern test

Compared to the Linux output

~S, 5, 1
[...]
finiDH1, 1

the Solaris output has a different order:

finiDH1, 1
[...]
~S, 5, 1

This is another instance of the long-standing PR c++/81337.  As detailed
there, the relative order of ~S::S() and __attribute__((destructor()))
functions isn't guaranteed.  Since xfail'ing the dg-output parts isn't
practical, this patch skips the whole test on Solaris.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

2025-12-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgomp:
	PR c++/81337
	* testsuite/libgomp.c++/target-cdtor-2.C: Skip on Solaris.
	Fix comments.
2026-01-12 10:36:19 +01:00
Nathaniel Shead
3e8ce187dc c++: Improve diagnostic for implicit conversion errors [PR115163]
This patch adds a note to indicate if any viable explicit conversion
functions were skipped if an implicit conversion failed to occur.

Perhaps the base diagnostic in ocp_convert can be further improved for
class types as well, as the current message is not very clear, but I've
not looked into that for this patch.

	PR c++/115163

gcc/cp/ChangeLog:

	* call.cc (implicit_conversion_error): Add flags argument, call
	maybe_show_nonconverting_candidate.
	(build_converted_constant_expr_internal): Pass flags to
	implicit_conversion_error.
	(perform_implicit_conversion_flags): Likewise.
	* cvt.cc (ocp_convert): Call maybe_show_nonconverting_candidate
	on conversion error.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/is_convertible7.C: Add new testcases.
	* g++.dg/diagnostic/explicit2.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
2026-01-12 20:12:29 +11:00
Jakub Jelinek
dd8df074c9 simplify-rtx: Fix up shift/rotate VOIDmode count handling [PR123523]
The following testcase ICEs on i686-linux, because the HW in that
case implements the shift as shifting by 64-bit count (anything larger
or equal to number of bits in the first operand's element results
in 0 or sign copies), so the machine description implements it as
such as well.
Now, because shifts/rotates can have different modes on the first
and second operand, when the second one has VOIDmode (i.e. CONST_INT,
I think CONST_WIDE_INT has non-VOIDmode and CONST_DOUBLE with VOIDmode
is hopefully very rarely used), we need to choose some mode for the
wide_int conversion.  And so far we've been choosing BITS_PER_WORD/word_mode
or the mode of the first operand's element, whichever is wider.
That works fine on 64-bit targets, CONST_INT has always at most 64 bits,
but for 32-bit targets uses SImode.

Because HOST_BITS_PER_WIDE_INT is always 64, the following patch just
uses that plus DImode instead of BITS_PER_WORD and word_mode.

2026-01-12  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/123523
	* simplify-rtx.cc (simplify_const_binary_operation): Use
	DImode for VOIDmode shift and truncation counts if int_mode
	is narrower than HOST_BITS_PER_WIDE_INT rather than
	word_mode if int_mode it is narrower than BITS_PER_WORD.

	* gcc.target/i386/pr123523.c: New test.
2026-01-12 10:06:47 +01:00
Jakub Jelinek
17af6bff03 c++: Remove gnu::gnu_inline attribute on inheriting ctors [PR123526]
The recent addition of gnu::gnu_inline attributes to some C++26 constexpr
methods broke classes which inherit e.g. from std::logic_error or other
C++26 classes with gnu::gnu_inline constructors and use inheriting
constructors.  On std::logic_error etc. it has the desired effect that
the ctor itself can be constexpr evaluated and even inlined, but is not
emitted in each TU that needs it and didn't inline it, but is still
contained in libstdc++.{a,so.6}.
Unfortunately inheriting ctors inherit also attributes of the corresponding
ctors except those that clone_attrs filter out and that includes the
gnu_inline attribute if explicitly specified on the base class ctor.
That has the undesirable effect that the implementation detail of e.g.
the std::logic_error class leaks into the behavior of a class that inherits
from it if it is using inheriting constructors, those will result in
undefined symbols for the inheriting constructors if they aren't inlined,
unless one also inherits from it in some TU without gnu_inline there (e.g.
one compiled with -std=c++23 or earlier).

So, the following patch fixes it by removing the gnu::gnu_inline attribute
from the inheriting constructor.  Not done in clone_attrs because that
function is also used for the normal constructor cloning and in that case
we do want to clone those attributes.

2026-01-12  Jakub Jelinek  <jakub@redhat.com>

	PR c++/123526
	* method.cc: Include attribs.h.
	(implicitly_declare_fn): Remove gnu::gnu_inline attribute.

	* g++.dg/ext/gnu-inline-inh-ctor1.C: New test.
	* g++.dg/ext/gnu-inline-inh-ctor2.C: New test.
2026-01-12 10:05:50 +01:00
Uros Bizjak
6dd0b41b99 testsuite: Remove lp64 requirement from gcc.target/i386/pr123121.c [PR123121]
The test gcc.target/i386/pr123121.c does not rely on LP64-specific
behavior.  Drop the dg-require-effective-target lp64 directive so the
test can run on 32-bit i386 targets as well.

	PR rtl-optimization/123121

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr123121.c:
2026-01-12 09:45:14 +01:00
Rainer Orth
7dd62fcef1 testsuite: i386: Disable AVX512BW/DQ tests with Solaris/x86 as [PR123415]
Several AVX512BW and AVX512DQ tests FAIL on Solaris/x86 with the native
assembler.  As detailed in the PR, this is for two reasons:

* Due to a misunderstanding, %k0 isn't accepted as source or destination
  register of some insns.

* {sae} is considered implicit for some insns, so specifying it
  explicitly was deemed unnecessary.

It's unclear if and when this will be fixed, so avx512bw and avx512dq
tests are disabled for now.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

2025-12-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	PR target/123415
	* lib/target-supports.exp (check_effective_target_avx512dq):
	Disable with Solaris/x86 as.
	(check_effective_target_avx512bw): Likewise.
2026-01-12 09:15:16 +01:00
Surya Kumari Jangala
a2eb399ec1 [rs6000] [testsuite] Fix test-frame-related.c [PR123129]
The testcase test-frame-related.c fails in 32-bit mode due to
constraints not matching. Use -mpowerpc64 option to ensure that the
testcase works with -m32.

gcc/testsuite:
	PR testsuite/123129
	* gcc.dg/rtl/powerpc/test-frame-related.c: Add -mpowerpc64.
2026-01-12 00:17:43 -05:00