aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2025-07-04Daily bump.GCC Administrator1-0/+17
2025-07-03Ada: Remove left-overs of front-end exception mechanismEric Botcazou2-31/+0
It was removed from the compiler a few releases ago. gcc/ada/ * gcc-interface/Makefile.in (gnatlib-sjlj): Delete. (gnatlib-zcx): Do not modify Frontend_Exceptions constant. * libgnat/system-linux-loongarch.ads (Frontend_Exceptions): Delete.
2025-07-03ada: Fix missing error on too large Component_Size not multiple of storage unitEric Botcazou1-5/+11
This is a small regression introduced a few years ago. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_component_type): Validate the Component_Size like the size of a type only if the component type is actually packed.
2025-07-03ada: Fix wrong conversion of controlled array with representation changeEric Botcazou1-11/+17
The problem is that a temporary is created for the conversion because of the representation change, and it is finalized without having been initialized. gcc/ada/ChangeLog: * exp_ch4.adb (Handle_Changed_Representation): Alphabetize local variables. Set the No_Finalize_Actions flag on the assignment.
2025-05-23Update ChangeLog and version files for releasereleases/gcc-14.3.0Richard Biener1-0/+4
2025-05-01Daily bump.GCC Administrator1-0/+7
2025-04-30Fix GNAT build failure for x86/FreeBSDEric Botcazou2-0/+173
gcc/ada/ PR ada/112958 * Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x86 FreeBSD]: Add specific version of s-dorepr.adb. * libgnat/s-dorepr__freebsd.adb: New file.
2025-04-05Daily bump.GCC Administrator1-0/+12
2025-04-04Ada: Fix thinko in Eigensystem for complex Hermitian matricesEric Botcazou2-61/+66
The implementation solves the eigensystem for a NxN complex Hermitian matrix by first solving it for a 2Nx2N real symmetric matrix and then interpreting the 2Nx1 real vectors as Nx1 complex ones, but the last step does not work. The patch fixes the last step and also performs a small cleanup throughout the implementation, mostly in the commentary and without functional changes. gcc/ada/ * libgnat/a-ngcoar.adb (Eigensystem): Adjust notation and fix the layout of the real symmetric matrix in the main comment. Adjust the layout of the associated code accordingly and correctly turn the 2Nx1 real vectors into Nx1 complex ones. (Eigenvalues): Minor similar tweaks. * libgnat/a-ngrear.adb (Jacobi): Minor tweaks in the main comment. Adjust notation and corresponding parameter names of functions. Fix call to Unit_Matrix routine. Adjust the comment describing the various kinds of iterations to match the implementation.
2025-03-20Daily bump.GCC Administrator1-0/+14
2025-03-19Fix misoptimization at -O2 in LTO modeEric Botcazou1-0/+8
This is a regression in recent releases. The problem is that the IPA mod/ref pass looks through the (nominal) type of a pointer-to-discriminated-type parameter in a call to a subprogram in order to see the (actual) type used for the dereferences of the parameter in the callee, which is a pointer-to-constrained-subtype. Historically the discriminated type is marked with the may_alias attribute because of the symmetric effect for the argument in the caller, so we mark the constrained subtype with the attribute now for the sake of the callee. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Record_Subtype>: Set the may_alias attribute if a specific GCC type is built.
2025-03-19Fix spurious visibility error with partially parameterized formal packageEric Botcazou2-6/+27
This is not a regression but the issue is quite annoying and the fix is trivial. The problem is that a formal parameter covered by a box in the formal package is not visible in the instance when it comes after another formal parameter that is also a formal package. It comes from a discrepancy internal to Instantiate_Formal_Package, where a specific construct (the abbreviated instance) built for the nested formal package discombobulates the processing done for the outer formal package. gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Formal_Package_Declaration): Use N_Declaration instead of Node_Kind as ancestor. * sem_ch12.adb (Get_Formal_Entity): Remove obsolete alternative. (Instantiate_Formal_Package): Take into account the abbreviated instances in the main loop running over the actuals of the local package created for the formal package. gcc/testsuite/ * gnat.dg/generic_inst14.adb: New test. * gnat.dg/generic_inst14_pkg.ads: New helper. * gnat.dg/generic_inst14_pkg-child.ads: Likewise.
2025-02-02Daily bump.GCC Administrator1-0/+6
2025-02-01Ada: Fix segfault on uninitialized variable as operand of primitive operatorEric Botcazou1-0/+4
...of derived real type. It comes from an unexpected internal adjustment. gcc/ada/ PR ada/118712 * sem_warn.adb (Check_References): Deal with small adjustments of references. gcc/testsuite/ * gnat.dg/warn33.adb: New test. * gnat.dg/warn33_pkg.ads: New helper.
2025-01-07Daily bump.GCC Administrator1-0/+5
2025-01-06ada: Fix small thinko in previous change to two-pass aggregate expansionEric Botcazou1-1/+2
We need a type tailored to the base index type to compute the length. gcc/ada/ChangeLog: * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use the base type of the index type to find the type used to compute the length.
2025-01-06Daily bump.GCC Administrator1-0/+7
2025-01-05Ada: Fix build for dummy s-tapropEstevan Castilho (Tevo)1-9/+2
gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise.
2024-12-17Daily bump.GCC Administrator1-0/+5
2024-12-16ada: Fix internal error with Atomic Volatile_Full_Access objectEric Botcazou1-4/+6
The initial implementation of the GNAT aspect/pragma Volatile_Full_Access made it incompatible with Atomic, because it was not decided whether the read-modify-write sequences generated by Volatile_Full_Access would need to be implemented atomically when Atomic was also specified, which would have required a compare-and-swap primitive from the target architecture. But Ada 2022 introduced Full_Access_Only and retrofitted it into Atomic in the process, answering the above question by the negative, so the incompatibility between Volatile_Full_Access and Atomic was lifted in Ada 2012 as well, unfortunately without adjusting the implementation. gcc/ada/ * gcc-interface/trans.cc (get_atomic_access): Deal specifically with nodes that are both Atomic and Volatile_Full_Access in Ada 2012.
2024-12-13Daily bump.GCC Administrator1-0/+10
2024-12-12Fix precondition failure with Ada.Numerics.Generic_Real_Arrays.EigenvaluesEric Botcazou1-10/+14
This fixes a precondition failure triggered when the Eigenvalues routine of Ada.Numerics.Generic_Real_Arrays is instantiated with -gnata, beause it calls Sort_Eigensystem on an empty vector. gcc/ada PR ada/117996 * libgnat/a-ngrear.adb (Jacobi): Remove default value for Compute_Vectors formal parameter. (Sort_Eigensystem): Add Compute_Vectors formal parameter. Do not modify the Vectors if Compute_Vectors is False. (Eigensystem): Pass True as Compute_Vectors to Sort_Eigensystem. (Eigenvalues): Pass False as Compute_Vectors to Sort_Eigensystem. gcc/testsuite * gnat.dg/matrix1.adb: New test.
2024-11-27Daily bump.GCC Administrator1-0/+12
2024-11-26gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string ↵Arsen Arsenović2-2/+6
[PR115917] gcc/ada/ChangeLog: PR ada/115917 * gnatvsn.ads: Add note about the duplication of this value in version.c. * version.c (VER_LEN_MAX): Define to the same value as Gnatvsn.Ver_Len_Max. (gnat_version_string): Use VER_LEN_MAX as bound. (cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302)
2024-11-13Daily bump.GCC Administrator1-0/+13
2024-11-12ada: Fix spurious error on iterated component association with large index typeEric Botcazou1-12/+19
This is only for the Ada 2022 form of the iterated component association. gcc/ada/ChangeLog: PR ada/117328 * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use a type sized from the index type to compute the length. Simplify and remove useless calls to New_Copy_Tree for this computation.
2024-11-12ada: Fix bogus error for delta aggregate as expression functionEric Botcazou1-0/+1
The compiler correctly accepts the other forms of aggregates. gcc/ada/ChangeLog: PR ada/113868 * par-ch6.adb (P_Subprogram) <Scan_Body_Or_Expression_Function>: Add delta aggregate alongside the other forms of aggregates.
2024-11-05Daily bump.GCC Administrator1-0/+18
2024-11-04ada: Fix crash on default value with nested iterated component associationsEric Botcazou1-8/+15
The problem is that the freeze node for the type of the element ends up in the component list of the record type declared with the default value. gcc/ada/ChangeLog: PR ada/113036 * freeze.adb (Freeze_Expression): Deal with freezing actions coming from within nested internal loops present in spec expressions.
2024-11-04ada: Fix crash on real literal in declare expression of expression functionEric Botcazou1-2/+3
The problem is that the freeze node of the type to which the real literal is resolved is placed inside the expression function instead of outside. gcc/ada/ * freeze.adb (Freeze_Expression): Also attach pending freeze nodes to the parent in the case of an internal block in a spec expression.
2024-11-04ada: Fix internal error on concatenation of discriminant-dependent componentEric Botcazou1-1/+9
This only occurs with optimization enabled, but the expanded code is always wrong because it reuses the formal parameter of an initialization procedure associated with a discriminant (a discriminal in GNAT parlance) outside of the initialization procedure. gcc/ada/ * checks.adb (Selected_Length_Checks.Get_E_Length): For a component of a record with discriminants and if the expression is a selected component, try to build an actual subtype from its prefix instead of from the discriminal.
2024-10-26Daily bump.GCC Administrator1-0/+7
2024-10-25ada: Fix internal error on bit-packed array type with Volatile_Full_AccessEric Botcazou1-0/+6
The problem occurs when the component type is a record type with default values for the initialization procedure of the (base) array type, because the compiler is trying to generate a full access for a parameter of the base array type, which does not make sense. gcc/ada/ChangeLog: PR ada/116551 * gcc-interface/trans.cc (node_is_atomic) <N_Identifier>: Return false if the type of the entity is an unconstrained array type. (node_is_volatile_full_access) <N_Identifier>: Likewise.
2024-10-16Daily bump.GCC Administrator1-0/+6
2024-10-14ada: Type conversion in instance incorrectly rejected.Steve Baird1-1/+1
In some cases, a legal type conversion in a generic package is correctly accepted but the corresponding type conversion in an instance of the generic is incorrectly rejected. gcc/ada/ PR ada/114593 * sem_res.adb (Valid_Conversion): Test In_Instance instead of In_Instance_Body.
2024-10-09Daily bump.GCC Administrator1-0/+28
2024-10-08ada: Fix wrong finalization of anonymous array aggregateEric Botcazou3-11/+30
The issue arises when the aggregate consists only of iterated associations because, in this case, its expansion uses a 2-pass mechanism which creates a temporary that needs a fully-fledged initialization, thus running afoul of the optimization that avoids building the initialization procedure in the anonymous array case. gcc/ada/ChangeLog: * exp_aggr.ads (Is_Two_Pass_Aggregate): New function declaration. * exp_aggr.adb (Is_Two_Pass_Aggregate): New function body. (Expand_Array_Aggregate): Call Is_Two_Pass_Aggregate to detect the aggregates that need the 2-pass expansion. * exp_ch3.adb (Expand_Freeze_Array_Type): In the anonymous array case, build the initialization procedure if the initial value in the object declaration is a 2-pass aggregate.
2024-10-08ada: Fix negative value returned by 'Image for array with nonnegative componentEric Botcazou1-2/+1
The problem is that Exp_Put_Image.Build_Elementary_Put_Image_Call uses the signedness of the base type but the size of the first subtype, hence the discrepancy between them. gcc/ada/ChangeLog: PR ada/115535 * exp_put_image.adb (Build_Elementary_Put_Image_Call): Use the size of the underlying type to find the support type.
2024-10-08ada: Fix internal error on elsif part of if-statement containing if-expressionEric Botcazou1-0/+1
The problem occurs when the compiler is trying to find a context to which it can hoist finalization actions coming from the if-expression, because Find_Hook_Context incorrectly returns the N_Elsif_Part node. gcc/ada/ChangeLog: PR ada/114640 * exp_util.adb (Find_Hook_Context): For a node present within a conditional expression, do not return an N_Elsif_Part node.
2024-10-08ada: Fix bogus error in instantiation with formal packageEric Botcazou1-1/+5
The compiler reports that an actual does not match the formal when there is a defaulted formal discrete type because Check_Formal_Package_Instance fails to skip the implicit base type generated by the compiler. gcc/ada/ChangeLog: PR ada/114636 * sem_ch12.adb (Check_Formal_Package_Instance): For a defaulted formal discrete type, skip the generated implicit base type.
2024-10-05Daily bump.GCC Administrator1-0/+6
2024-10-04Fix crash with subunit of local packageEric Botcazou1-0/+6
This is a regression present on the 14 branch only: the expander gets confused when trying to insert the finalizer of a procedure that contains a package as a subunit. The offending code no longer exists on the mainline so this adds the minimal fix to address the issue. gcc/ada PR ada/116430 * exp_ch7.adb (Build_Finalizer.Create_Finalizer): For the insertion point of the finalizer, deal with package bodies that are subunits.
2024-08-01Update ChangeLog and version files for releasereleases/gcc-14.2.0Jakub Jelinek1-0/+4
2024-06-11Daily bump.GCC Administrator1-0/+13
2024-06-10Fix crash on access-to-incomplete typeEric Botcazou1-0/+6
This just adds the missing guard. gcc/ada/ PR ada/114708 * exp_util.adb (Finalize_Address): Add guard for incomplete types. gcc/testsuite/ * gnat.dg/incomplete8.adb: New test.
2024-06-10ada: Storage_Error in indirect call to function returning limited typeJavier Miranda2-8/+15
At runtime the code generated by the compiler reports the exception Storage_Error in an indirect call through an access-to-subprogram variable that references a function returning a limited tagged type object. gcc/ada/ * sem_ch6.adb (Might_Need_BIP_Task_Actuals): Add support for access-to-subprogram parameter types. * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Add dummy BIP parameters to access-to-subprogram types that may reference a function that has BIP parameters.
2024-05-30Daily bump.GCC Administrator1-0/+7
2024-05-29Fix link failure of GNAT tools on 32-bit SPARC/LinuxEric Botcazou1-3/+10
There is an incorrect binding to the 64-bit compare-and-exchange builtin. gcc/ada/ PR ada/115270 * Makefile.rtl (PowerPC/Linux): Use libgnat/s-atopri__32.ads for the 32-bit library. (SPARC/Linux): Likewise.
2024-05-07Update ChangeLog and version files for releasereleases/gcc-14.1.0Jakub Jelinek1-0/+4
2024-04-16Daily bump.GCC Administrator1-0/+9