[gcc r15-6564] RISC-V: Move fortran testcase to gfortran.target
https://gcc.gnu.org/g:a35b89a20ed6ef697867e9149474bcdc584cd969 commit r15-6564-ga35b89a20ed6ef697867e9149474bcdc584cd969 Author: Kito Cheng Date: Mon Dec 23 21:27:46 2024 +0800 RISC-V: Move fortran testcase to gfortran.target gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/fortran/pr111395.f90: Move this file to... * gfortran.target/riscv/rvv/pr111395.f90: ...here. * gcc.target/riscv/rvv/fortran/pr111566.f90: Move this file to... * gfortran.target/riscv/rvv/pr111566.f90: ...here. * gcc.target/riscv/rvv/rvv-fortran.exp: Move this file to... * gfortran.target/riscv/rvv/rvv.exp: ...here. Diff: --- .../riscv/rvv/fortran => gfortran.target/riscv/rvv}/pr111395.f90| 0 .../riscv/rvv/fortran => gfortran.target/riscv/rvv}/pr111566.f90| 0 .../riscv/rvv/rvv-fortran.exp => gfortran.target/riscv/rvv/rvv.exp} | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111395.f90 b/gcc/testsuite/gfortran.target/riscv/rvv/pr111395.f90 similarity index 100% rename from gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111395.f90 rename to gcc/testsuite/gfortran.target/riscv/rvv/pr111395.f90 diff --git a/gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111566.f90 b/gcc/testsuite/gfortran.target/riscv/rvv/pr111566.f90 similarity index 100% rename from gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111566.f90 rename to gcc/testsuite/gfortran.target/riscv/rvv/pr111566.f90 diff --git a/gcc/testsuite/gcc.target/riscv/rvv/rvv-fortran.exp b/gcc/testsuite/gfortran.target/riscv/rvv/rvv.exp similarity index 93% rename from gcc/testsuite/gcc.target/riscv/rvv/rvv-fortran.exp rename to gcc/testsuite/gfortran.target/riscv/rvv/rvv.exp index c4185554697d..c122e90d9897 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/rvv-fortran.exp +++ b/gcc/testsuite/gfortran.target/riscv/rvv/rvv.exp @@ -39,7 +39,7 @@ dg-init # Main loop. gfortran-dg-runtest [lsort \ - [glob -nocomplain $srcdir/$subdir/fortran/*.\[fF\]{,90,95,03,08} ] ] "" "" + [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" "" # All done. dg-finish
[gcc r15-6565] Ada: fix documentation of pragma Unimplemented_Unit
https://gcc.gnu.org/g:90b6d3bc84da803e14627548545626215a127b4d commit r15-6565-g90b6d3bc84da803e14627548545626215a127b4d Author: Eric Botcazou Date: Mon Jan 6 08:46:06 2025 +0100 Ada: fix documentation of pragma Unimplemented_Unit gcc/ada PR ada/117936 * doc/gnat_rm/implementation_defined_pragmas.rst (Unimplemented_Unit): Adjust the description of the error message. * gnat_rm.texi: Regenerate. Diff: --- gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst | 6 +++--- gcc/ada/gnat_rm.texi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index 61ed40e78f48..768a2e659c28 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -7046,9 +7046,9 @@ Syntax: If this pragma occurs in a unit that is processed by the compiler, GNAT -aborts with the message :samp:`xxx not implemented`, where -``xxx`` is the name of the current compilation unit. This pragma is -intended to allow the compiler to handle unimplemented library units in +aborts with the message :samp:`xxx is not supported in this configuration`, +where ``xxx`` is the name of the current compilation unit. This pragma +is intended to allow the compiler to handle unimplemented library units in a clean manner. The abort only happens if code is being generated. Thus you can use diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index baf549e158f5..8aceb6f62f99 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -8643,9 +8643,9 @@ pragma Unimplemented_Unit; @end example If this pragma occurs in a unit that is processed by the compiler, GNAT -aborts with the message @code{xxx not implemented}, where -@code{xxx} is the name of the current compilation unit. This pragma is -intended to allow the compiler to handle unimplemented library units in +aborts with the message @code{xxx is not supported in this configuration}, +where @code{xxx} is the name of the current compilation unit. This pragma +is intended to allow the compiler to handle unimplemented library units in a clean manner. The abort only happens if code is being generated. Thus you can use
[gcc r12-10881] ada: Fix crash on vector initialization
https://gcc.gnu.org/g:e8b53a5263946be717169e2549eabf67e6a227ad commit r12-10881-ge8b53a5263946be717169e2549eabf67e6a227ad Author: Marc Poulhiès Date: Mon Mar 27 16:47:04 2023 +0200 ada: Fix crash on vector initialization Initializing a vector using Vec : V.Vector := [Some_Type'(Some_Abstract_Type with F => 0)]; may crash the compiler. The expander marks the N_Extension_Aggregate for delayed expansion which never happens and incorrectly ends up in gigi. The delayed expansion is needed for nested aggregates, which the original code is testing for, but container aggregates are handled differently. Such assignments to container aggregates are later transformed into procedure calls to the procedures named in the Aggregate aspect definition, for which the delayed expansion is not required/expected. gcc/ada/ PR ada/118234 * exp_aggr.adb (Convert_To_Assignments): Do not mark node for delayed expansion if parent type has the Aggregate aspect. * sem_util.adb (Is_Container_Aggregate): Move... * sem_util.ads (Is_Container_Aggregate): ... here and make it public. Diff: --- gcc/ada/exp_aggr.adb | 7 +-- gcc/ada/sem_util.adb | 3 --- gcc/ada/sem_util.ads | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index e360baa6683a..a97882dba73a 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4930,9 +4930,12 @@ package body Exp_Aggr is if -- Internal aggregate (transformed when expanding the parent) + -- excluding the Container aggregate as these are transformed to + -- procedure call later. - Parent_Kind in - N_Aggregate | N_Extension_Aggregate | N_Component_Association + (Parent_Kind in +N_Component_Association | N_Aggregate | N_Extension_Aggregate +and then not Is_Container_Aggregate (Parent_Node)) -- Allocator (see Convert_Aggr_In_Allocator) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 3c55dda5a856..cbe19cbeeb2a 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -130,9 +130,6 @@ package body Sem_Util is -- Determine whether arbitrary entity Id denotes an atomic object as per -- RM C.6(7). - function Is_Container_Aggregate (Exp : Node_Id) return Boolean; - -- Is the given expression a container aggregate? - generic with function Is_Effectively_Volatile_Entity (Id : Entity_Id) return Boolean; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 695158a34f35..28dcefd71fb7 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1531,6 +1531,9 @@ package Sem_Util is -- integer for use in compile-time checking. Note: Level is restricted to -- be non-dynamic. + function Is_Container_Aggregate (Exp : Node_Id) return Boolean; + -- Is the given expression a container aggregate? + function Is_Newly_Constructed (Exp : Node_Id; Context_Requires_NC : Boolean) return Boolean; -- Indicates whether a given expression is "newly constructed" (RM 4.4).
[gcc r12-10883] ada: Fix internal error on aggregate nested in container aggregate
https://gcc.gnu.org/g:6c7c99f95661db80b6e1b52c10c34e9ce9c5eb6a commit r12-10883-g6c7c99f95661db80b6e1b52c10c34e9ce9c5eb6a Author: Eric Botcazou Date: Wed Sep 6 09:37:29 2023 +0200 ada: Fix internal error on aggregate nested in container aggregate This handles the case where a component association is present. gcc/ada/ PR ada/118234 * exp_aggr.adb (Convert_To_Assignments): In the case of a component association, call Is_Container_Aggregate on the parent's parent. (Expand_Array_Aggregate): Likewise. Diff: --- gcc/ada/exp_aggr.adb | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index cda5e66943ec..479db647f3cc 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4933,9 +4933,11 @@ package body Exp_Aggr is -- excluding container aggregates as these are transformed into -- subprogram calls later. - (Parent_Kind in -N_Component_Association | N_Aggregate | N_Extension_Aggregate -and then not Is_Container_Aggregate (Parent_Node)) + (Parent_Kind = N_Component_Association + and then not Is_Container_Aggregate (Parent (Parent_Node))) + + or else (Parent_Kind in N_Aggregate | N_Extension_Aggregate + and then not Is_Container_Aggregate (Parent_Node)) -- Allocator (see Convert_Aggr_In_Allocator) @@ -6799,10 +6801,10 @@ package body Exp_Aggr is Parent_Kind := Nkind (Parent_Node); end if; - if ((Parent_Kind = N_Component_Association -or else Parent_Kind = N_Aggregate -or else Parent_Kind = N_Extension_Aggregate) - and then not Is_Container_Aggregate (Parent_Node)) + if (Parent_Kind = N_Component_Association + and then not Is_Container_Aggregate (Parent (Parent_Node))) +or else (Parent_Kind in N_Aggregate | N_Extension_Aggregate + and then not Is_Container_Aggregate (Parent_Node)) or else (Parent_Kind = N_Object_Declaration and then Needs_Finalization (Typ)) or else (Parent_Kind = N_Assignment_Statement
[gcc r12-10882] ada: Fix internal error on aggregate within container aggregate
https://gcc.gnu.org/g:9b618e2e883ffada66f6c0c6a6a672f35286413c commit r12-10882-g9b618e2e883ffada66f6c0c6a6a672f35286413c Author: Eric Botcazou Date: Fri May 26 00:09:14 2023 +0200 ada: Fix internal error on aggregate within container aggregate This just applies the same fix to Expand_Array_Aggregate as the one that was recently applied to Convert_To_Assignments. gcc/ada/ PR ada/118234 * exp_aggr.adb (Convert_To_Assignments): Tweak comment. (Expand_Array_Aggregate): Do not delay the expansion if the parent node is a container aggregate. Diff: --- gcc/ada/exp_aggr.adb | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index a97882dba73a..cda5e66943ec 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4929,9 +4929,9 @@ package body Exp_Aggr is -- done top down from above. if - -- Internal aggregate (transformed when expanding the parent) - -- excluding the Container aggregate as these are transformed to - -- procedure call later. + -- Internal aggregates (transformed when expanding the parent), + -- excluding container aggregates as these are transformed into + -- subprogram calls later. (Parent_Kind in N_Component_Association | N_Aggregate | N_Extension_Aggregate @@ -6788,7 +6788,8 @@ package body Exp_Aggr is -- STEP 3 -- Delay expansion for nested aggregates: it will be taken care of when - -- the parent aggregate is expanded. + -- the parent aggregate is expanded, excluding container aggregates as + -- these are transformed into subprogram calls later. Parent_Node := Parent (N); Parent_Kind := Nkind (Parent_Node); @@ -6798,9 +6799,10 @@ package body Exp_Aggr is Parent_Kind := Nkind (Parent_Node); end if; - if Parent_Kind = N_Aggregate -or else Parent_Kind = N_Extension_Aggregate -or else Parent_Kind = N_Component_Association + if ((Parent_Kind = N_Component_Association +or else Parent_Kind = N_Aggregate +or else Parent_Kind = N_Extension_Aggregate) + and then not Is_Container_Aggregate (Parent_Node)) or else (Parent_Kind = N_Object_Declaration and then Needs_Finalization (Typ)) or else (Parent_Kind = N_Assignment_Statement
[gcc r13-9279] Ada: Fix build for dummy s-taprop
https://gcc.gnu.org/g:431404685ffc3044da0c5dcbb0a40861632c093a commit r13-9279-g431404685ffc3044da0c5dcbb0a40861632c093a Author: Estevan Castilho (Tevo) Date: Sat Dec 28 20:37:37 2024 + Ada: Fix build for dummy s-taprop gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise. Diff: --- gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb index ced2a0c6f3c5..08d5078e5b8f 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb @@ -37,7 +37,6 @@ package body System.Task_Primitives.Operations is use System.Tasking; - use System.Parameters; pragma Warnings (Off); -- Turn off warnings since so many unreferenced parameters @@ -480,10 +479,7 @@ package body System.Task_Primitives.Operations is null; end Unlock; - procedure Unlock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Unlock (L : not null access RTS_Lock) is begin null; end Unlock; @@ -522,10 +518,7 @@ package body System.Task_Primitives.Operations is Ceiling_Violation := False; end Write_Lock; - procedure Write_Lock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Write_Lock (L : not null access RTS_Lock) is begin null; end Write_Lock;
[gcc r14-11128] Ada: Fix build for dummy s-taprop
https://gcc.gnu.org/g:81f74b83f9634d1ad6a1d9805a95dd856bc960de commit r14-11128-g81f74b83f9634d1ad6a1d9805a95dd856bc960de Author: Estevan Castilho (Tevo) Date: Sat Dec 28 20:37:37 2024 + Ada: Fix build for dummy s-taprop gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise. Diff: --- gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb index 90c4cd4cf72f..36a47ebd1b58 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb @@ -37,7 +37,6 @@ package body System.Task_Primitives.Operations is use System.Tasking; - use System.Parameters; pragma Warnings (Off); -- Turn off warnings since so many unreferenced parameters @@ -480,10 +479,7 @@ package body System.Task_Primitives.Operations is null; end Unlock; - procedure Unlock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Unlock (L : not null access RTS_Lock) is begin null; end Unlock; @@ -522,10 +518,7 @@ package body System.Task_Primitives.Operations is Ceiling_Violation := False; end Write_Lock; - procedure Write_Lock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Write_Lock (L : not null access RTS_Lock) is begin null; end Write_Lock;
[gcc r12-10884] Ada: Fix build for dummy s-taprop
https://gcc.gnu.org/g:85319f4637648691882a79ebac3d63c4d0204735 commit r12-10884-g85319f4637648691882a79ebac3d63c4d0204735 Author: Estevan Castilho (Tevo) Date: Sat Dec 28 20:37:37 2024 + Ada: Fix build for dummy s-taprop gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise. Diff: --- gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb index 5ab41b1b3c17..e5360a63f3d3 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb @@ -37,7 +37,6 @@ package body System.Task_Primitives.Operations is use System.Tasking; - use System.Parameters; pragma Warnings (Off); -- Turn off warnings since so many unreferenced parameters @@ -480,10 +479,7 @@ package body System.Task_Primitives.Operations is null; end Unlock; - procedure Unlock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Unlock (L : not null access RTS_Lock) is begin null; end Unlock; @@ -522,10 +518,7 @@ package body System.Task_Primitives.Operations is Ceiling_Violation := False; end Write_Lock; - procedure Write_Lock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Write_Lock (L : not null access RTS_Lock) is begin null; end Write_Lock;
[gcc r15-6558] Ada: Fix build for dummy s-taprop
https://gcc.gnu.org/g:31f1bec65ba257adc346f952fd79a1ec3165a2e6 commit r15-6558-g31f1bec65ba257adc346f952fd79a1ec3165a2e6 Author: Estevan Castilho (Tevo) Date: Sat Dec 28 20:37:37 2024 + Ada: Fix build for dummy s-taprop gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise. Diff: --- gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb index 68ec8b448bac..2127fb1f1b10 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb @@ -37,7 +37,6 @@ package body System.Task_Primitives.Operations is use System.OS_Locks; - use System.Parameters; use System.Tasking; pragma Warnings (Off); @@ -483,10 +482,7 @@ package body System.Task_Primitives.Operations is null; end Unlock; - procedure Unlock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Unlock (L : not null access RTS_Lock) is begin null; end Unlock; @@ -525,10 +521,7 @@ package body System.Task_Primitives.Operations is Ceiling_Violation := False; end Write_Lock; - procedure Write_Lock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Write_Lock (L : not null access RTS_Lock) is begin null; end Write_Lock;
[gcc r15-6557] testsuite, d: Fix failing pr110406.d test
https://gcc.gnu.org/g:345ad67fc2ee321d5c2e5371711a2d249b92b956 commit r15-6557-g345ad67fc2ee321d5c2e5371711a2d249b92b956 Author: Iain Buclaw Date: Sun Jan 5 11:19:31 2025 +0100 testsuite, d: Fix failing pr110406.d test At some point during GCC 15 development, the compiler-generated code for D ModuleInfo support now gets transformed into the following on x86: _12 = (uint) &__stop_minfo; _13 = (uint) &__start_minfo; _14 = (uint) &gdc.dso_slot; _15 = {1, _14, _13, _12}; gdc.dso_initialized = 0; MEM [(void *)&D.1974 + 16B] = {}; MEM [(void *)&D.1974] = _15; _d_dso_registry (&D.1974); This causes the scan-tree-dump-not test to fail. As ModuleInfo is not what's being checked for in PR110406, remove its generation altogether. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr110406.d: Add -fno-moduleinfo to dg-options. Diff: --- gcc/testsuite/gdc.dg/torture/pr110406.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gdc.dg/torture/pr110406.d b/gcc/testsuite/gdc.dg/torture/pr110406.d index c380e4bdec86..169aec7b6e50 100644 --- a/gcc/testsuite/gdc.dg/torture/pr110406.d +++ b/gcc/testsuite/gdc.dg/torture/pr110406.d @@ -1,6 +1,6 @@ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110406 // { dg-do compile { target i?86-*-* x86_64-*-* } } -// { dg-options "-fdump-tree-optimized" } +// { dg-options "-fno-moduleinfo -fdump-tree-optimized" } struct cpuid_abcd_t { uint eax;