aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2024-02-26Finalization of object allocated by anonymous access designating local typeEric Botcazou4-12/+88
The finalization of objects dynamically allocated through an anonymous access type is deferred to the enclosing library unit in the current implementation and a warning is given on each of them. However this cannot be done if the designated type is local, because this would generate dangling references to the local finalization routine, so the finalization needs to be dropped in this case and the warning adjusted. gcc/ada/ PR ada/113893 * exp_ch7.adb (Build_Anonymous_Master): Do not build the master for a local designated type. * exp_util.adb (Build_Allocate_Deallocate_Proc): Force Needs_Fin to false if no finalization master is attached to an access type and assert that it is anonymous in this case. * sem_res.adb (Resolve_Allocator): Mention that the object might not be finalized at all in the warning given when the type is an anonymous access-to-controlled type. gcc/testsuite/ * gnat.dg/access10.adb: New test.
2024-02-26Daily bump.GCC Administrator1-1/+1
2024-02-25Daily bump.GCC Administrator1-1/+1
2024-02-24Daily bump.GCC Administrator3-1/+18
2024-02-23arm: fix ICE with vectorized reciprocal division [PR108120]Richard Earnshaw2-2/+18
The expand pattern for reciprocal division was enabled for all math optimization modes, but the patterns it was generating were not enabled unless -funsafe-math-optimizations were enabled, this leads to an ICE when the pattern we generate cannot be recognized. Fixed by only enabling vector division when doing unsafe math. gcc: PR target/108120 * config/arm/neon.md (div<VCVTF:mode>3): Rename from div<mode>3. Gate with ARM_HAVE_NEON_<MODE>_ARITH. gcc/testsuite: PR target/108120 * gcc.target/arm/neon-recip-div-1.c: New file. (cherry picked from commit 016c4eed368b80a97101f6156ed99e4c5474fbb7)
2024-02-23Daily bump.GCC Administrator1-1/+1
2024-02-22Daily bump.GCC Administrator1-1/+1
2024-02-21Daily bump.GCC Administrator3-1/+29
2024-02-20aarch64: Avoid out-of-range shrink-wrapped saves [PR111677]Alex Coplan4-18/+61
The PR shows us ICEing due to an unrecognizable TFmode save emitted by aarch64_process_components. The problem is that for T{I,F,D}mode we conservatively require mems to be in range for x-register ldp/stp. That is because (at least for TImode) it can be allocated to both GPRs and FPRs, and in the GPR case that is an x-reg ldp/stp, and the FPR case is a q-register load/store. As Richard pointed out in the PR, aarch64_get_separate_components already checks that the offsets are suitable for a single load, so we just need to choose a mode in aarch64_reg_save_mode that gives the full q-register range. In this patch, we choose V16QImode as an alternative 16-byte "bag-of-bits" mode that doesn't have the artificial range restrictions imposed on T{I,F,D}mode. Unlike for GCC 14 we need additional handling in the load/store pair code as various cases are not expecting to see V16QImode (particularly the writeback patterns, but also aarch64_gen_load_pair). gcc/ChangeLog: PR target/111677 * config/aarch64/aarch64.c (aarch64_reg_save_mode): Use V16QImode for the full 16-byte FPR saves in the vector PCS case. (aarch64_gen_storewb_pair): Handle V16QImode. (aarch64_gen_loadwb_pair): Likewise. (aarch64_gen_load_pair): Likewise. * config/aarch64/aarch64.md (loadwb_pair<TX:mode>_<P:mode>): Rename to ... (loadwb_pair<TX_V16QI:mode>_<P:mode>): ... this, extending to V16QImode. (storewb_pair<TX:mode>_<P:mode>): Rename to ... (storewb_pair<TX_V16QI:mode>_<P:mode>): ... this, extending to V16QImode. * config/aarch64/iterators.md (TX_V16QI): New. gcc/testsuite/ChangeLog: PR target/111677 * gcc.target/aarch64/torture/pr111677.c: New test. (cherry picked from commit fddce05d67f34174be0f306e1015d3868bbe7c31)
2024-02-20Daily bump.GCC Administrator1-1/+1
2024-02-19Daily bump.GCC Administrator1-1/+1
2024-02-18Daily bump.GCC Administrator1-1/+1
2024-02-17Daily bump.GCC Administrator1-1/+1
2024-02-16Daily bump.GCC Administrator3-1/+38
2024-02-15testsuite: Require lra effective target for pr107385.cJakub Jelinek1-1/+1
Old reload doesn't support asm goto with output operands. We have lra effective target (though, strangely it returns 0 just for 2 targets out of at least 16 targets with no LRA support), so this patch uses it, similarly how it is done in other asm goto tests with output operands. 2024-02-15 Jakub Jelinek <jakub@redhat.com> PR middle-end/107385 * gcc.dg/pr107385.c: Require lra effective target. (cherry picked from commit 0d5d1c75f5c68b6064640c3154ae5f4c0b464905)
2024-02-15testsuite: Add testcase for already fixed PR [PR107385]Jakub Jelinek1-0/+20
This testcase has been fixed by the PR113921 fix, but unlike testcase in there this one is not target specific. 2024-02-15 Jakub Jelinek <jakub@redhat.com> PR middle-end/107385 * gcc.dg/pr107385.c: New test. (cherry picked from commit 5459a9074afabf700f055fc8164f88dadb1c39b0)
2024-02-15expand: Fix handling of asm goto outputs vs. PHI argument adjustments [PR113921]Jakub Jelinek4-3/+44
The Linux kernel and the following testcase distilled from it is miscompiled, because tree-outof-ssa.cc (eliminate_phi) emits some fixups on some of the edges (but doesn't commit edge insertions). Later expand_asm_stmt emits further instructions on the same edge. Now the problem is that expand_asm_stmt uses insert_insn_on_edge to add its own fixups, but that function appends to the existing sequence on the edge if any. And the bug triggers when the fixup sequence emitted by eliminate_phi uses a pseudo which the fixup sequence emitted by expand_asm_stmt later on sets. So, we end up with (set (reg A) (asm_operands ...)) and on one of the edges queued sequence (set (reg C) (reg B)) // added by eliminate_phi (set (reg B) (reg A)) // added by expand_asm_stmt That is wrong, what we emit by expand_asm_stmt needs to be as close to the asm_operands as possible (they aren't known until expand_asm_stmt is called, the PHI fixup code assumes it is reg B which holds the right value) and the PHI adjustments need to be done after it. So, the following patch introduces a prepend_insn_to_edge function and uses it from expand_asm_stmt, so that we queue (set (reg B) (reg A)) // added by expand_asm_stmt (set (reg C) (reg B)) // added by eliminate_phi instead and so the value from the asm_operands output propagates correctly to the PHI result. 2024-02-15 Jakub Jelinek <jakub@redhat.com> PR middle-end/113921 * cfgrtl.h (prepend_insn_to_edge): New declaration. * cfgrtl.c (insert_insn_on_edge): Clarify behavior in function comment. (prepend_insn_to_edge): New function. * cfgexpand.c (expand_asm_stmt): Use prepend_insn_to_edge instead of insert_insn_on_edge. * gcc.target/i386/pr113921.c: New test. (cherry picked from commit 2b4efc5db2aedb59196987300e14951d08cd7106)
2024-02-15Daily bump.GCC Administrator1-1/+1
2024-02-14Daily bump.GCC Administrator1-1/+1
2024-02-13Daily bump.GCC Administrator1-1/+1
2024-02-12Daily bump.GCC Administrator1-1/+1
2024-02-11Daily bump.GCC Administrator1-1/+1
2024-02-10Daily bump.GCC Administrator4-1/+35
2024-02-09Fortran: fix bounds-checking errors for CLASS array dummies [PR104908]Harald Anlauf2-1/+36
Commit r11-1235 addressed issues with bounds of unlimited polymorphic array dummies. However, using the descriptor from sym->backend_decl does break the case of CLASS array dummies. The obvious solution is to restrict the fix to the unlimited polymorphic case, thus keeping the original descriptor in the ordinary case. gcc/fortran/ChangeLog: PR fortran/104908 * trans-array.c (gfc_conv_array_ref): Restrict use of transformed descriptor (sym->backend_decl) to the unlimited polymorphic case. gcc/testsuite/ChangeLog: PR fortran/104908 * gfortran.dg/pr104908.f90: New test. (cherry picked from commit ce61de1b8a1bb3a22118e900376f380768f2ba59)
2024-02-09sra: Disqualify bases of operands of asm gotosMartin Jambor2-6/+33
PR 110422 shows that SRA can ICE assuming there is a single edge outgoing from a block terminated with an asm goto. We need that for BB-terminating statements so that any adjustments they make to the aggregates can be copied over to their replacements. Because we can't have that after ASM gotos, we need to punt. gcc/ChangeLog: 2024-01-17 Martin Jambor <mjambor@suse.cz> PR tree-optimization/110422 * tree-sra.c (scan_function): Disqualify bases of operands of asm gotos. gcc/testsuite/ChangeLog: 2024-01-17 Martin Jambor <mjambor@suse.cz> PR tree-optimization/110422 * gcc.dg/torture/pr110422.c: New test. (cherry picked from commit 2b7204c52392c1c0da9c91a5feae0c44018a6f37)
2024-02-09Daily bump.GCC Administrator1-1/+1
2024-02-08Daily bump.GCC Administrator1-1/+1
2024-02-07Daily bump.GCC Administrator1-1/+1
2024-02-06Daily bump.GCC Administrator2-1/+20
2024-02-05mips: Fix missing mode in neg<mode:MSA>2Xi Ruoyao1-1/+1
I was too sleepy writting this :(. gcc/ChangeLog: * config/mips/mips-msa.md (neg<mode:MSA>2): Add missing mode for neg. (cherry picked from commit 55357960fbddd261e32f088f5dd328d58b0f25b3)
2024-02-05MIPS: Fix wrong MSA FP vector negationXi Ruoyao1-3/+15
We expanded (neg x) to (minus const0 x) for MSA FP vectors, this is wrong because -0.0 is not 0 - 0.0. This causes some Python tests to fail when Python is built with MSA enabled. Use the bnegi.df instructions to simply reverse the sign bit instead. gcc/ChangeLog: * config/mips/mips-msa.md (elmsgnbit): New define_mode_attr. (neg<mode>2): Change the mode iterator from MSA to IMSA because in FP arithmetic we cannot use (0 - x) for -x. (neg<mode>2): New define_insn to implement FP vector negation, using a bnegi instruction to negate the sign bit. (cherry picked from commit 4d7fe3cf82505b45719356a2e51b1480b5ee21d6)
2024-02-05Daily bump.GCC Administrator1-1/+1
2024-02-04Daily bump.GCC Administrator1-1/+1
2024-02-03Daily bump.GCC Administrator1-1/+1
2024-02-02Daily bump.GCC Administrator2-1/+6
2024-02-01hppa: Fix bug in atomic_storedi_1 patternJohn David Anglin1-3/+3
The first alternative stores the floating-point status register in the destination. It should store zero. We need to copy %fr0 to another floating-point register to initialize it to zero. 2024-02-01 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md (atomic_storedi_1): Fix bug in alternative 1.
2024-02-01Daily bump.GCC Administrator1-1/+1
2024-01-31Daily bump.GCC Administrator1-1/+1
2024-01-30Daily bump.GCC Administrator1-1/+1
2024-01-29Daily bump.GCC Administrator1-1/+1
2024-01-28Daily bump.GCC Administrator3-1/+17
2024-01-27c-family: Fix ICE with large column number after restoring a PCH [PR105608]Lewis Hyatt6-3/+15
Users are allowed to define macros prior to restoring a precompiled header file, as long as those macros are not defined (or are defined identically) in the PCH. However, the PCH restoration process destroys all the macro definitions, so libcpp has to record them before restoring the PCH and then redefine them afterward. This process does not currently assign great locations to the macros after redefining them. Some work is needed to also remember the original locations and get the line_maps instance in the right state (since, like all other data structures, the line_maps instance is also reset after restoring a PCH). This patch addresses a more pressing issue, which is that we ICE in some cases since GCC 11, hitting an assert in line-maps.cc. It happens if the first line encountered after the PCH restore requires an LC_RENAME map, such as will happen if the line is sufficiently long. This is much easier to fix, since we just need to call linemap_line_start before asking libcpp to redefine the stored macros, instead of afterward, to avoid the unexpected need for an LC_RENAME before an LC_ENTER has been seen. gcc/c-family/ChangeLog: PR preprocessor/105608 * c-pch.c (c_common_read_pch): Start a new line map before asking libcpp to restore macros defined prior to reading the PCH, instead of afterward. gcc/testsuite/ChangeLog: PR preprocessor/105608 * g++.dg/pch/line-map-1.C: New test. * g++.dg/pch/line-map-1.Hs: New test. * g++.dg/pch/line-map-2.C: New test. * g++.dg/pch/line-map-2.Hs: New test.
2024-01-27Daily bump.GCC Administrator2-1/+10
2024-01-26AArch64: Add -mcpu=cobalt-100Wilco Dijkstra3-2/+3
Add support for -mcpu=cobalt-100 (Neoverse N2 with a different implementer ID). gcc/ChangeLog: * config/aarch64/aarch64-cores.def (AARCH64_CORE): Add 'cobalt-100' CPU. * config/aarch64/aarch64-tune.md: Regenerated. * doc/invoke.texi (-mcpu): Add cobalt-100 core. (cherry picked from commit a0d16e1c06e04c11d1eef9705036bad8ac1a11d4)
2024-01-26Daily bump.GCC Administrator1-1/+1
2024-01-25Daily bump.GCC Administrator3-1/+18
2024-01-24c++: xvalue array subscript [PR103185]Jason Merrill3-3/+23
Normally we handle xvalue array subscripting with ARRAY_REF, but in this case we weren't doing that because the operands were reversed. Handle that case better. PR c++/103185 gcc/cp/ChangeLog: * typeck.c (cp_build_array_ref): Handle swapped operands. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/array-prvalue2.C: New test. * g++.dg/cpp1z/eval-order3.C: Test swapped operands. (cherry picked from commit 8dfc52a75d4d6c8be1c61b4aa831b1812b14a10e)
2024-01-24Daily bump.GCC Administrator1-1/+1
2024-01-23Daily bump.GCC Administrator1-1/+1
2024-01-22Daily bump.GCC Administrator1-1/+1