Commit Graph

202646 Commits

Author SHA1 Message Date
Ayappan Perumal 21db895f1e Error out stack-protector unavailability on AIX
stack-protector is not supported in GCC on AIX. This patch is to fail the
compilation if -fstack-protector option is passed.

gcc/ChangeLog:

	* config/rs6000/aix.h (SUBTARGET_DRIVER_SELF_SPECS):
	Error out when stack-protector option is used in AIX
	as it is not supported on AIX

	Approved By: Segher Boessenkool <segher@kernel.crashing.org>

(cherry picked from commit dfb7e97dd2)
2025-10-16 05:03:49 -05:00
GCC Administrator d29d53352d Daily bump. 2025-10-16 00:23:00 +00:00
GCC Administrator 5a63578816 Daily bump. 2025-10-15 00:23:35 +00:00
Richard Biener 7a562dd53c tree-optimization/120156 - ICE in ptr_derefs_may_alias_p
This picks the ptr_derefs_may_alias_p fix from the PR99954 fix
which said:  This makes us run into a latent issue in
ptr_deref_may_alias_decl_p when the pointer is something like &MEM[0].a
in which case we fail to handle non-SSA name pointers.  Add code
similar to what we have in ptr_derefs_may_alias_p.

	PR tree-optimization/120156
	* tree-ssa-alias.cc (ptr_deref_may_alias_decl_p): Verify
	the pointer is an SSA name.

(cherry picked from commit 50d3f67c71)
2025-10-14 13:15:25 +02:00
GCC Administrator 7cde107bd5 Daily bump. 2025-10-14 00:24:00 +00:00
GCC Administrator 9206c6429d Daily bump. 2025-10-13 00:21:59 +00:00
GCC Administrator 5648da3a0c Daily bump. 2025-10-12 00:21:56 +00:00
GCC Administrator dd6598bfa2 Daily bump. 2025-10-11 00:23:40 +00:00
GCC Administrator 89c54380f6 Daily bump. 2025-10-10 00:24:51 +00:00
GCC Administrator f875cd8bfe Daily bump. 2025-10-09 00:24:09 +00:00
GCC Administrator 85c9355c79 Daily bump. 2025-10-08 00:23:32 +00:00
GCC Administrator 83a561ff79 Daily bump. 2025-10-07 00:24:14 +00:00
GCC Administrator 25375be18c Daily bump. 2025-10-06 00:20:42 +00:00
Harald Anlauf b8f425fd70 Fortran: fix TRANSFER with rank 1 unlimited polymorphic SOURCE [PR121263]
PR fortran/121263

gcc/fortran/ChangeLog:

	* trans-intrinsic.cc (gfc_conv_intrinsic_transfer): For an
	unlimited polymorphic SOURCE to TRANSFER use saved descriptor
	if possible.

gcc/testsuite/ChangeLog:

	* gfortran.dg/transfer_class_5.f90: New test.

(cherry picked from commit 692281a387)
2025-10-05 20:38:53 +02:00
GCC Administrator c2d52a6d38 Daily bump. 2025-10-05 16:52:52 +00:00
Jeff Law 77dfe9e261 [committed] [PR rtl-optimization/101188] Fix reload_cse_move2add ignoring clobbers
So as Georg-Johann discusses in the BZ, reload_cse_move2add can generate
 incorrect code when optimizing code with clobbers.  Specifically in the
case where we try to optimize a sequence of 4 operations down to 3
operations we can reset INSN to the next instruction and continue the loop.

That skips the code to invalidate objects based on things like REG_INC
nodes, stack pushes and most importantly clobbers attached to the current
insn.

This patch factors all of the invalidation code used by reload_cse_move2add
into a new function and calls it at the appropriate time.

Georg-Johann has confirmed this patch fixes his avr bug and I've had it in
my tester over the weekend.  It's bootstrapped and regression tested on
aarch64, m68k, sh4, alpha and hppa.  It's also regression tested successfully
on a wide variety of other targets.

gcc/
	PR rtl-optimization/101188
	* postreload.cc (reload_cse_move2add_invalidate): New function,
	extracted from...
	(reload_cse_move2add): Call reload_cse_move2add_invalidate.

gcc/testsuite
	PR rtl-optimization/101188
	* gcc.c-torture/execute/pr101188.c: New test

(cherry picked from commit ae193f9008)
2025-10-03 08:51:15 -06:00
GCC Administrator 279cffffbf Daily bump. 2025-10-02 00:23:04 +00:00
GCC Administrator 2ed4308c73 Daily bump. 2025-10-01 00:24:12 +00:00
GCC Administrator 4a4bb6beba Daily bump. 2025-09-30 00:23:48 +00:00
GCC Administrator d85aa3e7d0 Daily bump. 2025-09-29 00:21:22 +00:00
GCC Administrator 341ce64437 Daily bump. 2025-09-28 00:21:52 +00:00
GCC Administrator 67699d0538 Daily bump. 2025-09-27 00:21:26 +00:00
GCC Administrator 51384f4f38 Daily bump. 2025-09-26 00:21:41 +00:00
GCC Administrator 4540017857 Daily bump. 2025-09-25 00:22:40 +00:00
GCC Administrator 1c2756f3d6 Daily bump. 2025-09-24 00:23:11 +00:00
GCC Administrator 8b4ece0309 Daily bump. 2025-09-23 00:23:01 +00:00
GCC Administrator b1cfb962e8 Daily bump. 2025-09-22 00:21:31 +00:00
GCC Administrator d35245e7c6 Daily bump. 2025-09-21 00:21:25 +00:00
GCC Administrator f96b239859 Daily bump. 2025-09-20 00:21:59 +00:00
GCC Administrator 3f3ac7bdc6 Daily bump. 2025-09-19 00:21:51 +00:00
hongtao.liu b748d6f63c Remove SPR/GNR/DMR from avx512_{move,store}_by pieces tune.
Align move_max with prefer_vector_width for SPR/GNR/DMR similar as
below commit.

commit 6ea25c0419
Author: liuhongt <hongtao.liu@intel.com>
Date:   Thu Aug 15 12:54:07 2024 +0800

    Align ix86_{move_max,store_max} with vectorizer.

    When none of mprefer-vector-width, avx256_optimal/avx128_optimal,
    avx256_store_by_pieces/avx512_store_by_pieces is specified, GCC will
    set ix86_{move_max,store_max} as max available vector length except
    for AVX part.

                  if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
                      && TARGET_EVEX512_P (opts->x_ix86_isa_flags2))
                    opts->x_ix86_move_max = PVW_AVX512;
                  else
                    opts->x_ix86_move_max = PVW_AVX128;

    So for -mavx2, vectorizer will choose 256-bit for vectorization, but
    128-bit is used for struct copy, there could be a potential STLF issue
    due to this "misalign".

gcc/ChangeLog:

	* config/i386/x86-tune.def (X86_TUNE_AVX512_MOVE_BY_PIECES):
	Remove SPR/GNR/DMR.
	(X86_TUNE_AVX512_STORE_BY_PIECES): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pieces-memcpy-18.c: Use -mtune=znver5
	instead of -mtune=sapphirerapids.
	* gcc.target/i386/pieces-memcpy-21.c: Ditto.
	* gcc.target/i386/pieces-memset-46.c: Ditto.
	* gcc.target/i386/pieces-memset-49.c: Ditto.

(cherry picked from commit dd713d0f3f)
2025-09-17 18:39:34 -07:00
GCC Administrator 281226830f Daily bump. 2025-09-18 00:22:19 +00:00
Martin Jambor 2f21edc2a7
tree-sra: Avoid total SRA if there are incompat. aggregate accesses (PR119085)
We currently use the types encountered in the function body and not in
type declaration to perform total scalarization.  Bug PR 119085
uncovered that we miss a check that when the same data is accessed
with aggregate types that those are actually compatible.  Without it,
we can base total scalarization on a type that does not "cover" all
live data in a different part of the function.  This patch adds the
check.

gcc/ChangeLog:

2025-07-21  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/119085
	* tree-sra.cc (sort_and_splice_var_accesses): Prevent total
	scalarization if two incompatible aggregates access the same place.

gcc/testsuite/ChangeLog:

2025-07-21  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/119085
	* gcc.dg/tree-ssa/pr119085.c: New test.

(cherry picked from commit dabac05714)
2025-09-17 16:51:30 +02:00
Martin Jambor 7d3d58554c
tree-sra: Fix grp_covered flag computation when totally scalarizing (PR117423)
Testcase of PR 117423 shows a flaw in the fancy way we do "total
scalarization" in SRA now.  We use the types encountered in the
function body and not in type declaration (allowing us to totally
scalarize when only one union field is ever used, since we effectively
"skip" the union then) and can accommodate pre-existing accesses that
happen to fall into padding.

In this case, we skipped the union (bypassing the
totally_scalarizable_type_p check) and the access falling into the
"padding" is an aggregate and so not a candidate for SRA but actually
containing data.  Arguably total scalarization should just bail out
when it encounters this situation (but I decided not to depend on this
mainly because we'd need to detect all cases when we eventually cannot
scalarize, such as when a scalar access has children accesses) but the
actual bug is that the detection if all data in an aggregate is indeed
covered by replacements just assumes that is always the case if total
scalarization triggers which however may not be the case in cases like
this - and perhaps more.

This patch fixes the bug by just assuming that all padding is taken
care of when total scalarization triggered, not that every access was
actually scalarized.

gcc/ChangeLog:

2025-07-17  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/117423
	* tree-sra.cc (analyze_access_subtree): Fix computation of grp_covered
	flag.

gcc/testsuite/ChangeLog:

2025-07-17  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/117423
	* gcc.dg/tree-ssa/pr117423.c: New test.

(cherry picked from commit 7efca50a9a18e69a4921140fc5a0325e3f519b1a)
2025-09-17 16:51:14 +02:00
GCC Administrator 5a83563953 Daily bump. 2025-09-17 00:22:10 +00:00
Jeff Law 56c69b1887 Fix latent LRA bug
Shreya's work to add the addptr pattern on the RISC-V port exposed a latent bug
in LRA.

We lazily allocate/reallocate the ira_reg_equiv structure and when we do
(re)allocation we'll over-allocate and zero-fill so that we don't have to
actually allocate and relocate the data so often.

In the case exposed by Shreya's work we had N requested entries at the last
rellocation step.  We actually allocate N+M entries.  During LRA we allocate
enough new pseudos and thus have N+M+1 pseudos.

In get_equiv we read ira_reg_equiv[regno] without bounds checking so we read
past the allocated part of the array and get back junk which we use and
depending on the precise contents we fault in various fun and interesting ways.

We could either arrange to re-allocate ira_reg_equiv again on some path through
LRA (possibly in get_equiv itself).  We could also just insert the bounds check
in get_equiv like is done elsewhere in LRA.  Vlad indicated no strong
preference in an email last week.

So this just adds the bounds check in a manner similar to what's done elsewhere
in LRA.  Bootstrapped and regression tested on x86_64 as well as RISC-V with
Shreya's work enabled and regtested across the various embedded targets.

gcc/
	* lra-constraints.cc (get_equiv): Bounds check before accessing
	data in ira_reg_equiv.

(cherry picked from commit 0c6ad3f5df)
2025-09-16 11:48:46 -06:00
GCC Administrator fa4aa99a59 Daily bump. 2025-09-16 00:22:12 +00:00
Georg-Johann Lay 930c842bfc AVR: Support more AVR-DA-S and AVR-EB devices.
gcc/
	* config/avr/avr-mcus.def: Support AVR32DA28S, AVR32DA32S,
	AVR32DA48S, AVR64DA28S, AVR64DA32S, AVR64DA48S AVR64DA64S,
	AVR128DA28S, AVR128DA32S, AVR128DA48S, AVR128DA64S,
	AVR32EB14, AVR32EB20, AVR32EB28, AVR32EB32.
	* doc/avr-mmcu.texi: Rebuild.
2025-09-15 16:12:49 +02:00
Matthias Kretz 19dd22fc18
c++: Fix mangling of _Float16 template args [PR121801]
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

gcc/testsuite/ChangeLog:

	PR c++/121801
	* g++.dg/abi/pr121801.C: New test.

gcc/cp/ChangeLog:

	PR c++/121801
	* mangle.cc (write_real_cst): Handle 16-bit real and assert
	that reals have 16 bits or a multiple of 32 bits.

(cherry picked from commit 19d1c7c28f)
2025-09-15 09:14:13 +02:00
GCC Administrator 438893c584 Daily bump. 2025-09-15 00:19:22 +00:00
GCC Administrator ba0dbe2ec7 Daily bump. 2025-09-14 00:20:56 +00:00
GCC Administrator 71fef0a5dd Daily bump. 2025-09-13 00:20:21 +00:00
GCC Administrator d6bae1a66f Daily bump. 2025-09-12 00:22:10 +00:00
GCC Administrator c9e85072cb Daily bump. 2025-09-11 00:21:42 +00:00
Georg-Johann Lay e128cfd819 AVR: Disable tree-switch-conversion per default.
There are at least two cases where tree-switch-conversion leads
to unpleasant resource allocation:

PR49857
    The lookup table lives in RAM.  This is the case for all
    devices that locate .rodata in RAM, which is for almost
    all AVR devices.

PR81540
    Code is bloated for 64-bit inputs.

As far as PR49857 is concerned, a target hook that may add an
address-space qualifier to the lookup table is the obvious
solution, though a respective patch has always been rejected by
global maintainers for non-technical reasons.

gcc/
	PR target/81540
	PR target/49857
	* common/config/avr/avr-common.cc: Disable -ftree-switch-conversion.

(cherry picked from commit 912159d2b5)
2025-09-10 22:44:45 +02:00
GCC Administrator 89b48c26d7 Daily bump. 2025-09-10 00:26:21 +00:00
Tomasz Kamiński 128f1602a0 libstdc++: Document remaining C++17 implementation-defined behavior.
This also covers bad_function_call::what from C++11.

libstdc++-v3/ChangeLog:

	* doc/html/manual/status.html: Regenerate.
	* doc/xml/manual/status_cxx2011.xml: Add entry for bad_function_call.
	* doc/xml/manual/status_cxx2017.xml: Add entries for bad_any_cast
	and nullptr_t output. Update entry for sf.cmath. Fix stable name for
	mem.res.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit 39d7c4d42a)
2025-09-09 16:15:33 +02:00
Tomasz Kamiński 9e1e285549 libstdc++: Document missing implementation defined behavior for std::filesystem.
libstdc++-v3/ChangeLog:

	* doc/html/manual/status.html: Regenerate the file.
	* doc/xml/manual/status_cxx2017.xml: Addd more entires.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit d6c370b8e9)
2025-09-09 16:15:33 +02:00
GCC Administrator 945bd54dca Daily bump. 2025-09-09 00:26:33 +00:00
Jonathan Wakely d01494e8cf
libstdc++: Fix docs for --enable-vtable-verify [PR120698]
libstdc++-v3/ChangeLog:

	PR libstdc++/120698
	* doc/xml/manual/configure.xml: Do not claim that vtv is enabled
	by default.
	* doc/html/manual/configure.html: Regenerate.

(cherry picked from commit d199a9c7c5)
2025-09-08 21:58:22 +01:00