Commit Graph

227961 Commits

Author SHA1 Message Date
GCC Administrator
bb91d2138e Daily bump. 2026-03-31 00:16:25 +00:00
H.J. Lu
b4c215b36d Adjust check for addressable misaligned stack argument
Adjust alignment check forcing a local copy if the argument on stack is
not aligned to its type and the current alignment, which is determined
by the backend, is less than MAX_SUPPORTED_STACK_ALIGNMENT when the
parameter has its address taken.

For x86, ignore argument passed on stack when updating stack alignment
since caller is responsible to align the outgoing stack for arguments
passed on stack.

gcc/

	PR target/120839
	PR middle-end/124671
	* function.cc (assign_parm_adjust_stack_rtl): Get the parameter
	as argument.  Adjust alignment check forcing a local copy.
	(assign_parms): Adjust.
	* config/i386/i386.cc (ix86_argument_passed_on_stack_p): New.
	(ix86_update_stack_alignment): Ignore argument passed on stack.

gcc/testsuite/

	PR target/120839
	PR middle-end/124671
	* gcc.dg/pr124671.c: New test.
	* gcc.target/i386/pr120839-1a.c: Likewise.
	* gcc.target/i386/pr120839-1b.c: Likewise.
	* gcc.target/i386/pr120839-2.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Richard Biener <rguenther@suse.de>
2026-03-30 15:48:25 -07:00
Jerry DeLisle
6c15bbe848 fortran: Fix several issues with INQUIRE and unconnected units.
PR libfortran/124543

libgfortran/ChangeLog:

	* io/inquire.c (inquire_via_unit): Fix return value for
	NAMED. Add check for ACTION. Fix return values for
	ENCODING, PENDING, READ, WRITE, READWRITE.
	(inquire_via_filename): Add checks for ACTION, DELIM,
	ASYNCHRONOUS, and PENDING. Fix return value for
	ENCODING.
	* io/unix.c (inquire_access): Change return value from no
	to unknown.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr124543.f90: New test.
2026-03-30 14:20:57 -07:00
Vineet Gupta
2c1a819254 bpf: md: Enable zero_extend{hi,qi}di2 to generate wN regs ...
... by adjusting the asm template reg string to 'W', similar to commit
gbd275e81812c for zero_extendsidi2. However unlike that change, this is
not a bug fix: zero_extendsidi2 relies on wN reg move to achieve the
32->64 semantics. A {8,16}->64 extension needs to be emulated anyways
by masking out extra bits so the reg used is not important.

However wN reg based codegen is still preferable in general:
 - It is easier on verifier as it has to track fewer bits and avoids
   corner case false positives.
 - Better native codegen as upper bits are guaranteed to be zero and can
   leverage target ISA mechanisms to achieve that mostly for free.
 - Better native codegen on 32-bit targets which need to use 2 regs for
   rN regs.

gcc/ChangeLog:

	* config/bpf/bpf.md (zero_extendhidi2): Add alternates for
	alu32 and use 'W' for reg operands.
	(zero_extendqidi2): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/bpf/zero-ext.c: Add tests for {HI,QI}mode values.

Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2026-03-30 13:15:04 -07:00
Jerry DeLisle
a42fa88db5 fortran: Fix uint back to int [PR124666]
PR fortran/124666

gcc/fortran/ChangeLog:

	* io.cc: Change uint value back to int.
2026-03-30 10:21:28 -07:00
Piyush Raj
ea8f32849f testsuite: bpf: Add initial BPF runtime tests
This patch adds runtime tests for BPF target.
These tests are based on existing compile-time tests and depends on
bpf.exp baseboard
To run the testsuite:

  make check-gcc RUNTESTFLAGS="--target_board=bpf-vmtest bpf-torture.exp KERNEL_VERSION=6.15 LOG_LEVEL=ERROR"

Options:
	KERNEL_VERSION (default: 6.15)
	LOG_LEVEL (default: ERROR)
Note: VMTEST_DIR must be set in the environment.

See the bpf-vmtest-tool README for details.

gcc/testsuite/ChangeLog:

	* gcc.target/bpf/torture/bpf-torture.exp: New testsuite.
	* gcc.target/bpf/torture/invalid-memory-access.c: New test.
	* gcc.target/bpf/torture/memcpy.c: New test.
	* gcc.target/bpf/torture/memmove.c: New test.
	* gcc.target/bpf/torture/memset.c: New test.
	* gcc.target/bpf/torture/naked.c: New test.
	* gcc.target/bpf/torture/nop.c: New test.
	* gcc.target/bpf/torture/trace_openat.c: New test.
2026-03-30 18:42:48 +02:00
Tomasz Kamiński
63ea5ff289 libstdc++: Change atomic_ref::address return type to cv void*.
This implements with P3936R1 Safer atomic_ref::address with
the bump to __cpp_lib_atomic_ref feture test macro.

libstdc++-v3/ChangeLog:

	* include/bits/atomic_base.h (__atomic_ref_base::_Address_return_t):
	Define.
	(__atomic_ref_base::address): Change return type to _Address_return_t.
	* include/bits/version.def (atomic_ref): Bump to 202603.
	* include/bits/version.h: Regenerate.
	* testsuite/29_atomics/atomic_ref/address.cc: Update check for
	return type.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2026-03-30 18:01:13 +02:00
Richard Biener
b82bc657de tree-optimization/124692 - update stmt before folding
The following makes sure SSA operands are up-to-date before folding.
Esp. when replace_uses_by is invoked from SCEV cprop which now has
ranger enabled we can otherwise end up ICEing where purpoted SSA
names now are constants.  This follows what forwprop does.

	PR tree-optimization/124692
	* tree-cfg.cc (replace_uses_by): Call update_stmt after
	substitution and before folding.

	* gcc.dg/torture/pr124692.c: New testcase.
2026-03-30 15:45:36 +02:00
Saurabh Jha
b95bfa1ff2 aarch64: mingw: Disable _Float128 emulation
The Windows ABI doesn't support _Float128:
https://learn.microsoft.com/en-us/cpp/build/ieee-floating-point-representation.

While it can be emulated for this target, the current implementation
prevents fortran from being built with this emulation.

This patch disables _Float128 emulation for aarch64-w64-mingw32 target.
This enables fortran to be built with no additional changes.

gcc/ChangeLog:

	* config/aarch64/aarch64.cc
	(aarch64_scalar_mode_supported_p): Only return true on TFmode if
	TARGET_LONG_DOUBLE_128 is set.

libgcc/ChangeLog:
	* config.host: Disable soft floating point.

Co-Authored-By: Evgeny Karpov <evgeny.karpov@arm.com>
2026-03-30 11:43:22 +00:00
Richard Biener
0f253792b7 tree-optimization/88576 - make -fno-math-errno not affect malloc
The following makes -fno-math-errno not affect non-math builtins.

	PR tree-optimization/88576
	* tree-ssa-alias.cc (check_fnspec): Remove flag_errno_math check.
	* ipa-modref.cc (modref_access_analysis::process_fnspec):
	Likewise.

	* gcc.dg/pr88576.c: New testcase.
2026-03-30 13:42:47 +02:00
Richard Biener
32cb5f67ab tree-optimization/124677 - wrong recurrence permute placement
When vectorizing a recurrence we have to skip inserted vector
stmts for the latch definition when finding the insertion point
for the permute.

	PR tree-optimization/124677
	* tree-vect-loop.cc (vectorizable_recurr): Skip vector
	stmts for the def.

	* gcc.dg/vect/vect-pr124677.c: New testcase.
2026-03-30 13:35:47 +02:00
Christopher Albert
3d4039e95d fortran: Fix free-form mixed OpenACC/OpenMP continuation state
Clear the opposite directive flag only for fresh free-form OpenMP/OpenACC
sentinel lines so continued directives do not leak OpenACC/OpenMP state into
the next independent directive.

PR fortran/108382
gcc/fortran/ChangeLog:

	* scanner.cc (skip_free_oacc_sentinel): Clear openmp_flag only for
	fresh OpenACC directive lines.
	(skip_free_omp_sentinel): Clear openacc_flag only for fresh OpenMP
	directive lines.

gcc/testsuite/ChangeLog:

	* gfortran.dg/goacc/omp-108382.f90: New test.

Signed-off-by: Christopher Albert <albert@tugraz.at>
2026-03-30 11:04:05 +01:00
Jakub Jelinek
8c4f5e682f c++, libstdc++: Implement P4156R0 - Rename meta::has_ellipsis_parameter to meta::is_vararg_function
Unhappy about the old and new names, as a function type is not a function,
but ces't la vie.

2026-03-30  Jakub Jelinek  <jakub@redhat.com>

gcc/cp/
	* metafns.gperf (enum metafn_code): Remove
	METAFN_HAS_ELLIPSIS_PARAMETER, add METAFN_IS_VARARG_FUNCTION.
	(has_ellipsis_parameter): Remove.
	(is_vararg_function): Add.
	* reflect.cc (eval_has_ellipsis_parameter): Rename to ...
	(eval_is_vararg_function): ... this.  Adjust function comment.
	(process_metafunction): Handle METAFN_IS_VARARG_FUNCTION
	instead of METAFN_HAS_ELLIPSIS_PARAMETER.
	* metafns.h: Regenerate.
gcc/testsuite/
	* g++.dg/reflect/has_ellipsis_parameter1.C: Rename to ...
	* g++.dg/reflect/is_vararg_function1.C: this.  New test.  Rename
	has_ellipsis_parameter to is_vararg_function everywhere.
libstdc++-v3/
	* include/std/meta (has_ellipsis_parameter): Rename to ...
	(is_vararg_function): ... this.  New declaration.
	* src/c++23/std.cc.in: Remove std::meta::has_ellipsis_parameter
	export, add std::meta::is_vararg_function export.
2026-03-30 12:02:47 +02:00
Francois-Xavier Coudert
fabd0213b7 aarch64, Darwin: Add Apple M5 cores
The values for chip IDs and the LITTLE.big variants have been confirmed
in the XNU sources (xnu/osfmk/arm/cpuid.h).

gcc/ChangeLog:

	* config/aarch64/aarch64-cores.def (AARCH64_CORE): Add Apple M5
	cores.
	* config/aarch64/aarch64-tune.md: Regenerate.
	* doc/invoke.texi: Add apple-m5 core to the ones listed
	for arch and tune selections.
2026-03-30 10:57:36 +02:00
Torbjörn SVENSSON
d2216cfce1 arm: allow at least one insn when loading a constant [PR102309]
gcc/ChangeLog:

	PR target/102309
	* config/arm/arm.cc (arm_constant_limit): Allways allow at least
	one insn when loading a constant.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2026-03-30 09:02:45 +02:00
GCC Administrator
59c407c71a Daily bump. 2026-03-30 00:16:21 +00:00
Jeff Law
33e4afffc8 [RISC-V][PR target/124674] Define OImode in the usual way
This testcase tries to call build_nonstandard_integer_type for a 192-bit
precision type.  This eventually faults because we don't have a suitably wide
mode.

Somewhat surprisingly, the targets are responsible for defining OImode.  So
this adds it to the RISC-V port as well which trivially fixes the ICE.  The
test is limited to rv64 as rv32 doesn't support int128.  That could have been
handled with a target-supports selector just as easily.

Tested on riscv32-elf and riscv64-elf.  Both the BPI and Pioneer are
experiencing NVME drive failures, so no bootstraps until I figure that out.
Waiting on the pre-commit tester to do its thing before pushing

	PR target/124674
gcc/
	* config/riscv/riscv-modes.def: Create OImode.

gcc/testsuite
	* gcc.target/riscv/pr124674.c: New test.
2026-03-29 17:36:25 -06:00
GCC Administrator
449f6b1c76 Daily bump. 2026-03-29 00:16:23 +00:00
Iain Buclaw
a3b49ec48b testsuite: d: Adjust test for d_runtime_has_std_library
The test for the D std library incorrectly returned true on targets
--with-libphobos-druntime-only=yes.

The function cos() is treated as an intrinsic, so always exists.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
	(check_effective_target_d_runtime_has_std_library): Test for
	acos rather than cos.
2026-03-28 20:57:29 +01:00
Jerry DeLisle
0ac324783d fortran: Fix [PR124666] [16 Regression] [UBSAN] io.cc:290:27: runtime error
Simple an obvious fix to avoid integer overflow.

	PR fortran/124666

gcc/fortran/ChangeLog:

	* io.cc (format_lex): Use enclosing parens to subtract
	before adding.
2026-03-28 10:58:54 -07:00
Paul Thomas
ee931e5b7e Fortran: Fix use-after-free in gfc_fixup_sibling_symbols [PR95879]
2026-03-28  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/95879
	* parse.cc (fixup_st_func_formals): New function to update
	statement function formal argument lists referencing a symbol
	about to be freed.
	(gfc_fixup_sibling_symbols): Call fixup_st_func_formals before
	gfc_release_symbol.

gcc/testsuite
	PR fortran/95879
	* gfortran.dg/pr95879.f90: New test.
2026-03-28 09:08:54 +00:00
Paul Thomas
4861693866 Fortran: Avoid rollback ICE after invalid SELECT TYPE [PR84245]
2026-03-28  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/84245
	* match.cc (gfc_match_select_type): Free the temporary namespace
	only on MATCH_NO. Return immediately on MATCH_ERROR.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr84245.f90: New test.
2026-03-28 07:23:01 +00:00
Alexandre Oliva
20f5ce74c1 testsuite: aarch64: skip erratas_opt_*.c on vxworks
VxWorks involves linking oddities in both kernel and rtp modes that
prevent the testcases for finding the expected outputs in the
erratas_opt_*.c testcases.  One of the modes doesn't even perform
final linking, so it's kind of hopeless.  Just skip them.


for  gcc/testsuite/ChangeLog

	* gcc.target/aarch64/erratas_opt_0.c: Skip on VxWorks.
	* gcc.target/aarch64/erratas_opt_1.c: Likewise.
	* gcc.target/aarch64/erratas_opt_2.c: Likewise.
	* gcc.target/aarch64/erratas_opt_3.c: Likewise.
	* gcc.target/aarch64/erratas_opt_4.c: Likewise.
	* gcc.target/aarch64/erratas_opt_5.c: Likewise.
	* gcc.target/aarch64/erratas_opt_6.c: Likewise.
	* gcc.target/aarch64/erratas_opt_7.c: Likewise.
	* gcc.target/aarch64/erratas_opt_8.c: Likewise.
	* gcc.target/aarch64/erratas_opt_9.c: Likewise.
	* gcc.target/aarch64/erratas_opt_10.c: Likewise.
	* gcc.target/aarch64/erratas_opt_11.c: Likewise.
	* gcc.target/aarch64/erratas_opt_12.c: Likewise.
	* gcc.target/aarch64/erratas_opt_13.c: Likewise.
	* gcc.target/aarch64/erratas_opt_14.c: Likewise.
	* gcc.target/aarch64/erratas_opt_15.c: Likewise.
2026-03-28 00:12:47 -03:00
Alexandre Oliva
214f5d1106 testsuite: aarch64: avoid stdint-gcc.h in crc-builtin-pmul64.c
Though gcc most often installs a stdint-gcc.h, that's not necessarily
the case, and it isn't the case for sure when targeting vxworks.

The file history doesn't justify the oddity, so I'm assuming it was a
mistake.


for  gcc/testsuite/ChangeLog

	* gcc.target/aarch64/crc-builtin-pmul64.c: Include stdint.h.
2026-03-28 00:12:47 -03:00
Alexandre Oliva
630b53cd4f testsuite: negated triplets need blank separators
!a-b-c is not the same as ! a-b-c.  In !a-b-c, the '!' is part of the
triplet that istarget attempts to match.  Fix all occurrences, except
for gcc.dg/vect/vect-93.c, that is taken care of separately.


for  gcc/testsuite/ChangeLog

	* gcc.dg/debug/btf/btf-variables-5.c: Separate ! from triplet.
	* gcc.dg/hoist-register-pressure-1.c: Likewise.
	* gcc.dg/hoist-register-pressure-2.c: Likewise.
	* gcc.dg/hoist-register-pressure-3.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-1.c: Likewise.
	* gfortran.dg/gomp/declare-variant-14.f90: Likewise.
2026-03-28 00:12:47 -03:00
Alexandre Oliva
229c58121d libgcc: vxworks: work around warnings promoted to errors on aarch64
In RTP mode, defining TLS_DELETE_HOOK_ARG as NULL AKA 0 elicits a
warning, that casting it to TASK_ID avoids.

objLibP.h defines an inline function that, depending on the
configuration, will have unused parameters.  Allow warnings about
them.

vxTas calls are supposed to take __vx_tas_t, but upon passing it that
on aarch64, we get warnings about discarding volatile qualifiers, that
not even explicit type casts avoid.  So, allow the warnings.


for  libgcc/ChangeLog

	* config/gthr-vxworks-tls.c (TLS_DELETE_HOOK_ARG): Type-cast
	NULL constant to avoid warning.
	* config/t-vxworks (LIBGCC2_CFLAGS): Tolerate unused-parameter
	and discarded-qualifiers errors.
2026-03-27 23:56:40 -03:00
Alexandre Oliva
35bd360eed libstdc++: simd: allow x86 -mlong-double-64
On a target that defaults to -mlong-double-64 -msse,
standard_abi_usable.cc and other tests fail to compile because of the
assert that rejects long double.  As on ppc, we can trivially make
things work for -mlong-double-64.


for  libstdc++-v3/ChangeLog

	* include/experimental/bits/simd.h (__intrinsic_type): Accept
	64-bit long doubles on x86 SSE.
2026-03-27 23:55:46 -03:00
GCC Administrator
260d8a71ef Daily bump. 2026-03-28 00:16:25 +00:00
Vineet Gupta
bd275e8181 bpf: md: fix zero_extendsidi2 reg->reg codegen [PR124670]
Currently the following RTL for zero extension

| (insn 8 7 9 (set (reg:DI 0 %r0 [25])
|        (zero_extend:DI (reg:SI 0 %r0 [24])))  {zero_extendsidi2}
|     (nil))

generates

|   r0 = r0

which is just a 64-bit copy and doesn't clear the upper 32-bits as
semantically required by the pattern.

The issue is pattern's asm template missing ‘w’/'W' causing bpf_print_register ()
to only emit 'r' regs. Using ‘W’ in template generates correct code.

|   w0 = w0

Note that 'W specifier ignores the RTL mode and unconditionally emits
the 'w' reg which might feel like creating a potential future bug.
However for this insn, it is correct/completely safe as follows:
 - 'W1' for src operand: src operand has a SI mode in pattern.
 - 'W0' for dst: Technically dst is DI, but the upper 32-bits of output
   have to be 0 due to zero-extension, thus a 'w' reg is OK.

For selftests this is a wash, except for some spurious changes.

	PR target/124670

gcc/ChangeLog:

	* config/bpf/bpf.md (zero_extendsidi2): Use 'W' in asm template.

gcc/testsuite/ChangeLog:

	* gcc.target/bpf/zero-ext.c: New test.

Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2026-03-27 16:09:08 -07:00
Paul Thomas
39d42de956 Fortran: Fix ICE in interface mapping with assumed rank [PR102619]
2026-03-27  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/102619
	* trans-expr.cc (gfc_get_interface_mapping_array): Add argument
	'assumed_rank_formal', which if true returns the descriptor in
	'ifm'.
	(gfc_add_interface_mapping): Detect an assumed rank formal arg
	of a non-intrinsic function to set 'assumed_rank_formal' and
	pass the descriptor to gfc_get_interface_mapping_array.

gcc/testsuite/
	PR fortran/102619
	* gfortran.dg/pr102619.f90: New test.
2026-03-27 22:47:41 +00:00
Eric Botcazou
c2203f9b21 Ada: Lift restriction on structural generic instantiation of subprograms
When an entity of a library-level package is used as actual in an attempted
structural instantiation of a library-level generic unit in the package, an
error is given since the structural instance is a library unit with circular
semantic dependence on the package.

This change lifts the restriction for generic subprograms by demoting the
structural instance into a local instance in this case, which means that
several instances might end up being present in a single partition, unless
the optimizer is run on the entire partition, for example by means of LTO.

gcc/ada/
	* sem_ch12.adb (Analyze_Structural_Associations): Create a local
	instance instead of a structural instance when a local entity of
	a library-level package is used in a subprogram instantiation.
2026-03-27 21:13:44 +01:00
Harald Anlauf
b2b3db8f83 Fortran: fix array bounds violation in min_max_args [PR124656]
PR fortran/124656

gcc/fortran/ChangeLog:

	* check.cc (min_max_args): Fix array index used for registering
	labeled arguments of the MIN/MAX intrinsics for subsequent
	duplicate label checks.
2026-03-27 20:51:20 +01:00
Harald Anlauf
73933cdc44 Fortran: several small fixes in gfc_simplify_eoshift [PR124631]
PR fortran/124631

gcc/fortran/ChangeLog:

	* simplify.cc (gfc_simplify_eoshift): Initialize sstride[0] to
	prevent pointer arithmetic with undefined offset.  Fix several
	frontend memleaks.
2026-03-27 20:17:41 +01:00
Eric Botcazou
2e12844949 Ada: Fix overriding indicator wrongly rejected on protected procedure
The case itself is fairly pathological (and very likely not human made), but
it's a clear incentive to get rid of an old kludge in generic instantiation,
whereby the full view of a type is forced on nodes in the generic unit even
though only the partial declaration is visible to them.

gcc/ada/
	PR ada/124596
	* sem_ch12.ads (Check_Private_View): Move around.
	* sem_ch12.adb (Check_Private_View): Retrieve the partial view
	by means of a call to Incomplete_Or_Partial_View.
	(Save_Global_References.Set_Global_Type): Do not force the full
	view of a type when only the partial declaration is visible.
	* sem_res.adb (Resolve_Actuals.Insert_Default): Remove obsolete
	code coping with the above kludge.

gcc/testsuite/
	* gnat.dg/generic_inst21.adb: New test.
2026-03-27 18:39:36 +01:00
Tobias Burnus
3923f9414e libgomp: fix omp_target_is_present and omp_get_mapped_ptr
There were a few minor issues with the two routines, partially because of
not handling corner cases and partially some clarifications are only in
newer versions of the spec.

In particular, for omp_target_is_present
* NULL pointer aren't regarded as present
* For (unified-)shared memory, claiming that something has always corresponding
  storage is wrong - it mostly never has. (but it is omp_target_is_accessible).
* Even with shared memory, 'declare target' usually has device memory. For
  'link' it is made to point to the host, i.e. it is not mapped, all others
  are still mapped. (With 'requires self_mapping', 'enter' should also not be
  mapped (and turned internally to 'link'), only 'local' needs to be mapped.)

For omp_get_mapped_ptr
* For NULL we can return NULL early also for devices.
* For shared memory, we shouldn't touch link (it is not counting as mapped);
  hence return NULL for it.

The documentation was updated add some missing cross references as the more
useful ones were missing.  Additionally, the description for the two modified
routines has been updated.

libgomp/ChangeLog:

	* target.c (omp_target_is_present, omp_get_mapped_ptr): Update handling
	for nullptr and shared-memory devices.
	* libgomp.texi (omp_target_is_present, omp_get_mapped_ptr): Update
	description, add see-also @refs.
	(omp_target_is_accessible, omp_target_associate_ptr): Add see-also
	@refs.
	* testsuite/libgomp.c/omp_target_is_present.c: New test.
	* testsuite/libgomp.c/omp_target_is_present-2.c: New test.
2026-03-27 17:54:00 +01:00
Andrew Pinski
af787f951b regcprop: Return early in maybe_mode_change for unorder modes [PR124649]
Like r16-727-g2ec5082dd24cef but the call to partial_subreg_p happens
in a later place, maybe_mode_change.
For this example we have VNx4QImode and DImode which are not ordered.

Bootstrapped and tested on aarch64-linux-gnu.

	PR rtl-optimization/124649

gcc/ChangeLog:

	* regcprop.cc (maybe_mode_change): Return early
	for unordered modes.

gcc/testsuite/ChangeLog:

	* gcc.dg/torture/pr124649-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2026-03-27 09:35:19 -07:00
Nathan Myers
8df8a196f7 libstdc++: Delete superseded comment
A comment referring to nothing remained in a patch.

libstdc++-v3/ChangeLog:
	* include/bits/stl_tree.h: Delete comment.
2026-03-27 11:37:39 -04:00
Paul Thomas
e3cd890801 Fortran: Fix ICE with allocation of scalar pointer entity [PR114021]
2026-03-27  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/114021
	* symbol.cc (gfc_get_unique_symtree): If the namespace argument
	is NULL, allocate a new symtree and provide it with the unique
	name.
	* trans-expr.cc (trans_scalar_assign): In the deep copy of a
	derived type with allocatable components, fix the rhs value if
	it is not a constant or a variable.
	* trans-stmt.cc (gfc_trans_allocate): Do not deallocate
	allocatable components of a source that is not a variable and
	is a pointer. If the DECL_NAME or its IDENTIFIER_POINTER are
	null,use gfc_get_unique_symtree with NULL namespace to obtain a
	symtree for the assignment.

gcc/testsuite/
	PR fortran/114021
	* gfortran.dg/pr114021.f90: New test.
2026-03-27 10:50:39 +00:00
Robin Dapp
79ef3558c8 RISC-V: Allow all vector modes during builtin registration. [PR124613]
In r16-7312-gecc37444062b40 we allowed all vector modes for the
any_target hook.  Since then we would ICE in gcc.target/riscv/pr122051.c
as emit_move_multi_word would choose a fractional vector mode.

This patch disallows fractional vector modes for xtheadvector in
riscv_vector_mode_supported_p but makes an exception for builtin
registration (through a global variable).  During registration we
need to have all modes available in order to maintain the registration
order for LTO streaming.

	PR target/124613

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins.cc (rvv_switcher::rvv_switcher):
	Add riscv_registering_builtins.
	(rvv_switcher::~rvv_switcher): Set riscv_registering_builtins to
	false.
	* config/riscv/riscv.cc (riscv_vector_mode_supported_p): Use
	riscv_registering_builtins.
	* config/riscv/riscv.h: Declare.
2026-03-27 11:10:09 +01:00
Richard Biener
9c678fd745 debug/124644 - duplicate DW_AT_artificial attribute
We can attempt to add DW_AT_artificial because of two reasons,
because of DECL_ARTIFICIAL on the decl and because of the
artificial function attribute which is attempted when marking
a decl DIE for inlining.  The following guards the latter,
avoiding an ICE with checking enabled.

	PR debug/124644
	* dwarf2out.cc (dwarf2out_abstract_function): Only
	add DW_AT_artificial if the decl isn't DECL_ARTIFICIAL.

	* g++.dg/debug/pr124644.C: New testcase.
2026-03-27 10:19:07 +01:00
Torbjörn SVENSSON
d362781ab0 Add topics/*.h to installed header files
Install topics/*.h header files to allow progress_notifications_plugin.cc
to properly build when testing out of build tree.

gcc/ChangeLog:

	* Makefile.in: (PLUGIN_HEADERS): Add $(srcdir)/topics/*.h.
	(install-plugin): Preserve directory structure for topics
	headers.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2026-03-27 08:27:54 +01:00
Paul Thomas
c0896c5aa7 Fortran: Add testcase [PR101281]
2026-03-27  Paul Thomas  <pault@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	PR fortran/101281
	* gfortran.dg/pr101281.f90: New test.
2026-03-27 07:27:09 +00:00
GCC Administrator
17b211ff3a Daily bump. 2026-03-27 00:16:23 +00:00
Paul Thomas
9780a52dff Fortran: Minor PDT cleanup and fix in gfc_simplify_exp [PR115315]
2026-03-26  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/115315
	* decl.cc (insert_parameter_exprs): Make strcmp condition more
	concise.
	(gfc_get_pdt_instance): Use gf_replace_expr where possible and
	use return value of gfc_simplify_expr. Correct error in which
	params->expr was being simplified instead of c2->initializer.
	* expr.cc (gfc_simplify_expr): If the substring 'start' value
	is less than zero, it is clearly out of range and so return
	false.

gcc/testsuite/
	PR fortran/115315
	* gfortran.dg/pdt_90.f03: New test.
2026-03-26 18:50:13 +00:00
Prathamesh Kulkarni
97682f93d7 libgomp: Update tests to initialize full_data to 0.
libgomp/ChangeLog:
	PR libgomp/124123
	* testsuite/libgomp.c/pr122314.c (test): Initialize full_data
	to 0.
	* testsuite/libgomp.c/pr122356.c: Likewise.

Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>
2026-03-26 17:17:21 +00:00
Jakub Jelinek
aa45de0c31 testsuite: Fix up another tcl 9 compatibility problem
TCL 9 removed case command which has been deprecated before.
https://core.tcl-lang.org/tcl/wiki?name=Migrating+scripts+to+Tcl+9
says "Replace case with switch" and switch has been working in TCL 8
just fine.

2026-03-26  Jakub Jelinek  <jakub@redhat.com>

	* lib/mike-gcc.exp (postbase): Use switch instead of case for
	TCL 9 compatibility.
	* lib/mike-g++.exp (postbase): Likewise.
2026-03-26 18:11:06 +01:00
Michal Jires
5eed9f5ddd lto/124289 - Correctly handle toplevel asm with -flto-partition=cache
This patch adds create_asm_partitions to cache partitioning
to prevent issues with non-renameable symbols (while partition
joining) and static asm symbols (while partition splitting).

All other relevant partitionings use create_asm_partitions.
This was not used in cache partitioning, because toplevel asm
could be in principle special handled in cache partitioning
with marginally better results, but I never implemented it.

	lto/124289

gcc/lto/ChangeLog:

	* lto-partition.cc (enum map1to1_content): New.
	(map_1_to_1): Use map1to1_content.
	(lto_1_to_1_map): Likewise.
	(create_asm_partitions): Likewise.
	(lto_max_map): Likewise.
	(lto_cache_map): Use create_asm_partitions.

gcc/testsuite/ChangeLog:

	* gcc.dg/lto/toplevel-extended-asm-2_0.c: Add padding to asm label.
	* gcc.dg/lto/toplevel-extended-asm-2_1.c: Add padding to asm label.
2026-03-26 17:11:23 +01:00
Joseph Myers
da7f40611e Regenerate gcc.pot
* gcc.pot: Regenerate.
2026-03-26 15:08:27 +00:00
Marek Polacek
007969e776 c++/reflection: ICE with substitute and undeduced auto [PR123613]
In substitute7.C we have

  template <typename T, auto ... Vs>
  constexpr auto construct_from = T{Vs...}; // #1
  struct Inner {};
  struct Outer { Inner m; };
  constexpr auto r = substitute(^^construct_from,
                               { ^^Outer, ^^construct_from<Inner> });

which crashes because the auto in #1 hadn't been deduced when we
called eval_can_substitute -> lookup_template_variable when processing
the substitute call.  We can call mark_used to resolve this, because
it has:

  if (undeduced_auto_decl (decl))
    maybe_instantiate_decl (decl);

and to make the json-parser.C test work, we have to do something
similar in eval_substitute, otherwise we crash due to another
undeduced auto.

	PR c++/123613

gcc/cp/ChangeLog:

	* reflect.cc (get_reflection): Call mark_used.
	(eval_can_substitute): Don't resolve_nondeduced_context here.
	(eval_substitute): Call lookup_and_finish_template_variable instead
	of lookup_template_variable and finish_template_variable.

gcc/testsuite/ChangeLog:

	* g++.dg/reflect/json-parser.C: New test.
	* g++.dg/reflect/substitute7.C: New test.
	* g++.dg/reflect/test.json: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2026-03-26 09:33:21 -04:00
GCC Administrator
c6897e4c0a Daily bump. 2026-03-26 00:16:25 +00:00