aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
9 hoursDaily bump.GCC Administrator1-0/+295
15 hoursAda: 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.
25 hoursada: Fix poor code generated for return of Out parameter with access typeEric Botcazou1-2/+3
The record type of the return object is unnecessarily given BLKmode. gcc/ada/ChangeLog: * gcc-interface/decl.cc (type_contains_only_integral_data): Do not return false only because the type contains pointer data.
25 hoursada: Enforce alignment constraint for large Object_Size clausesEric Botcazou1-1/+15
The constraint is that the Object_Size must be a multiple of the alignment in bits. But it's enforced only when the value of the clause is lower than the Value_Size rounded up to the alignment in bits, not for larger values. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Use default messages for errors reported for Object_Size clauses. (validate_size): Give an error for stand-alone objects of composite types if the specified size is not a multiple of the alignment.
25 hoursada: Fix alignment violation for mix of aligned and misaligned composite typesEric Botcazou1-18/+23
This happens when the chain of initialization procedures is called on the subcomponents and causes the creation of temporaries along the way out of alignment considerations. Now these temporaries are not necessary in the context and were not created until recently, so this gets rid of them. gcc/ada/ChangeLog: * gcc-interface/trans.cc (addressable_p): Add COMPG third parameter. <COMPONENT_REF>: Do not return true out of alignment considerations for non-strict-alignment targets if COMPG is set. (Call_to_gnu): Pass true as COMPG in the call to the addressable_p predicate if the called subprogram is an initialization procedure.
25 hoursada: Fix wrong finalization of constrained subtype of unconstrained array typeEric Botcazou1-6/+32
This implements the Is_Constr_Array_Subt_With_Bounds flag for allocators. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu) <N_Allocator>: Allocate the bounds alongside the data if the Is_Constr_Array_Subt_With_Bounds flag is set on the designated type. <N_Free_Statement>: Take into account the allocated bounds if the Is_Constr_Array_Subt_With_Bounds flag is set on the designated type.
25 hoursada: 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.
25 hoursada: Fix check for elaboration order on subprogram body stubsPiotr Trojanek1-1/+9
Fix an assertion failure occurring when elaboration checks were applied to subprogram with a separate body. gcc/ada/ChangeLog: * sem_elab.adb (Check_Overriding_Primitive): Find early call region of the subprogram body declaration, not of the subprogram body stub.
25 hoursada: More Tbuild cleanupBob Duff2-9/+4
Remove "Nmake_Assert => ..." on N_Unchecked_Type_Conversion at gen_il-gen-gen_nodes.adb:473 (was disabled). This was left over from commit 82a794419a00ea98b68d69b64363ae6746710de9 "Tbuild cleanup". In addition, the checks for "Is_Composite_Type" in Tbuild.Unchecked_Convert_To are narrowed to "not Is_Scalar_Type"; that way, useless duplicate unchecked conversions of access types will be removed as for composite types. gcc/ada/ChangeLog: * gen_il-gen-gen_nodes.adb (N_Unchecked_Type_Conversion): Remove useless Nmake_Assert. * tbuild.adb (Unchecked_Convert_To): Narrow the bitfield-related conditions.
25 hoursada: Refine sanity check in Insert_ActionsRonan Desplanques1-11/+11
Insert_Actions performs a sanity check when it goes through an expression with actions while going up the three. That check was not perfectly right before this patch and spuriously failed when inserting range checks in some situation. This patch makes the check more robust. gcc/ada/ChangeLog: * exp_util.adb (Insert_Actions): Fix check.
25 hoursada: Make comment more preciseRonan Desplanques1-4/+5
gcc/ada/ChangeLog: * exp_ch6.adb (Expand_Ctrl_Function_Call): Precisify comment.
25 hoursada: Fix missing finalization with conditional expression in extended returnEric Botcazou1-1/+6
Declarations of return objects are not (yet) distributed into the dependent expressions of conditional expressions. gcc/ada/ChangeLog: * exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bail out for the declarations of return objects.
25 hoursada: Port System.Stack_Usage to CHERIDaniel King6-27/+130
This unit performed integer to address conversions to calculate stack addresses which, on a CHERI target, result in an invalid capability that triggers a capability tag fault when dereferenced during stack filling. This patch updates the unit to preserve addresses (capabilities) during the calculations. The method used to determine the stack base address is also updated to CHERI. The current method tries to get the stack base from the compiler info for the current task. If no info is found, then as a fallback it estimates the base by taking the address of a variable on the stack. This address is then derived to calculate the range of addresses to fill the stack. This fallback does not work on CHERI since taking the 'Address of a stack variable will result in a capability with bounds restricted to that object and attempting to write outside those bounds triggers a capability bounds fault. Instead, we add a new function Get_Stack_Base which, on CHERI, gets the exact stack base from the upper bound of the capability stack pointer (CSP) register. On non-CHERI platforms, Get_Stack_Base returns the stack base from the compiler info, resulting in the same behaviour as before on those platforms. gcc/ada/ChangeLog: * Makefile.rtl (LIBGNAT_TARGET_PAIRS): New unit s-tsgsba__cheri.adb for morello-freebsd. * libgnarl/s-tassta.adb (Get_Stack_Base): New function. * libgnarl/s-tsgsba__cheri.adb: New file for CHERI targets. * libgnarl/s-tsgsba.adb: New default file for non-CHERI targets. * libgnat/s-stausa.adb (Fill_Stack, Compute_Result): Port to CHERI. * libgnat/s-stausa.ads (Initialize_Analyzer, Stack_Analyzer): Port to CHERI.
25 hoursada: Improve retrieval of nominal unconstrained type in extended returnPiotr Trojanek1-5/+1
To reliably retrieve the nominal unconstrained type of object declared in extended return statement we need to rely on the Original_Node. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Use Original_Node.
25 hoursada: Improve retrieval of nominal unconstrained type in extended returnPiotr Trojanek1-1/+5
When extended return statement declares object using an explicit subtype indication, then it is better to recover the original unconstrained type using the explicit subtype indication. This appears to be necessary for subtypes with predicates. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Use type from explicit subtype indication, when possible.
25 hoursada: Adjust message about statically compatible result subtypePiotr Trojanek1-1/+1
Ada RM 6.5(5.3/5) is about "result SUBTYPE of the function", while the error message was saying "result TYPE of the function". Now use the exact RM wording in the error message for this rule. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Adjust error message to match the RM wording.
25 hoursada: Fix constraint-related legality checks in extended return statementsPiotr Trojanek1-4/+12
Legality checks in extended return statements were (almost) literally implementing the RM rules, but the when analyzing the return object declaration we replace the nominal subtype of that object with its constrained subtype. (It is a bit odd to have such an expansion activity in analysis, but we already rely on this particular expansion in quite a few places). gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Use the nominal subtype of a return object; literally implement the RM rule about elementary types; check for static subtype compatibility both when the subtype is given as a subtype mark and a subtype indication.
25 hoursada: Fix strange holes for type with variant part reported by -gnatRhEric Botcazou1-2/+12
The problem is that the sorting algorithm mixes components of variants. gcc/ada/ChangeLog: * repinfo.adb (First_Comp_Or_Discr.Is_Placed_Before): Return True only if the components are in the same component list.
25 hoursada: Fix node copy with functions as actual parameters in dispatching DICDenis Mazzucato2-3/+4
When dispatching in a Default_Initial_Condition, copying the condition node crashes if there is a, possibly nested, parameterless function as actual parameter; there were two issues: 1. Subp_Entity in Check_Dispatching_call was uninitialized, a GNAT SAS finding. 2. The controlling argument update logic only tried to propagate the update by traversing the actual parameters, leading to a crash in case of parameterless functions. This patch initializes Subp_Entity and allows the update of controlling argument to succeed even when no traversal happened. gcc/ada/ChangeLog: * sem_disp.adb (Check_Dispatching_call): Fix uninitialized Subp_Entity. * sem_util.adb (Update_Controlling_Argument): No need to replace controlling argument in case of functions.
25 hoursada: Fix minor fallout of latest changeEric Botcazou10-12/+16
This adjusts the header of the renamed files and adds missing blank lines. gcc/ada/ChangeLog: * errid.ads: Adjust header to renaming and fix copyright line. * errid.adb: Adjust header to renaming and add blank line. * erroutc-pretty_emitter.ads: Adjust header to renaming. * erroutc-pretty_emitter.adb: Likewise. * erroutc-sarif_emitter.ads: Likewise. * erroutc-sarif_emitter.adb: Likewise. * errsw.ads: Adjust header to renaming and add blank line. * errsw.adb: Likewise. * json_utils.ads: Likewise. * json_utils.adb: Adjust header to renaming.
25 hoursada: Turn diagnostic object from variable to constantPiotr Trojanek1-1/+1
Diagnostic entries are not supposed to be modified while compiling the code. Code cleanup; behavior is unaffected. gcc/ada/ChangeLog: * errid.ads (Diagnostic_Entries): Now a constant.
25 hoursada: Remove redundant nested aggregates from diagnostics codePiotr Trojanek2-2/+2
A nested aggregate with a single "others => <>" clause is equivalent to a box itself. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * errid.ads (Diagnostic_Entries): Remove nested aggregate. * errsw.adb (Switches): Likewise.
25 hoursada: Fix crash with Finalizable in corner caseRonan Desplanques1-7/+17
The Finalizable aspect introduced controlled types for which not all the finalization primitives exist. This patch makes Make_Deep_Record_Body handle this case correctly. gcc/ada/ChangeLog: * exp_ch7.adb (Make_Deep_Record_Body): Fix case of absent Initialize primitive.
25 hoursada: Refine subtypes in task-counting codePiotr Trojanek1-7/+7
Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch3.adb (Count_Default_Sized_Task_Stacks): Refine subtypes of parameters; same for callsites.
25 hoursada: Remove a couple of redundant calls to Set_EtypeEric Botcazou1-2/+0
The OK_Convert_To function already sets the Etype of its result. gcc/ada/ChangeLog: * exp_imgv.adb (Expand_Value_Attribute): Do not call Set_Etype on N after rewriting it by means of OK_Convert_To.
25 hoursada: Fix crash with Finalizable in corner caseRonan Desplanques1-6/+15
Since the introduction of the Finalizable aspect, there can be types for which Is_Controlled returns True but that don't have all three finalization primitives. The Generate_Finalization_Actions raised an exception in that case before this patch, which fixes the problem. gcc/ada/ChangeLog: * exp_aggr.adb (Generate_Finalization_Actions): Stop assuming that initialize primitive exists.
25 hoursada: Fix typo in commentRonan Desplanques1-1/+1
gcc/ada/ChangeLog: * exp_ch7.adb (Build_Record_Deep_Procs): Fix typo in comment.
25 hoursada: Enforce visibility of unit used as a parent instance of a child instanceGary Dismukes1-37/+37
In cases involving instantiation of a generic child unit, the visibility of the parent unit was mishandled, allowing the parent to be referenced in another compilation unit that has visibility of the child instance but no with_clause for the parent of the instance. gcc/ada/ChangeLog: * sem_ch12.adb (Install_Spec): Remove "not Is_Generic_Instance (Par)" in test for setting Instance_Parent_Unit. Revise comment to no longer say "noninstance", plus remove "???". (Remove_Parent): Restructure if_statement to allow for both "elsif" parts to be executed (by changing them to be separate if_statements within an "else" part).
25 hoursada: Fix commentRonan Desplanques1-1/+1
This patch fixes a misnaming of Make_Predefined_Primitive_Specs in a comment. gcc/ada/ChangeLog: * exp_ch3.adb (Predefined_Primitive_Bodies): Fix comment.
25 hoursada: Cleanup in type support subprograms codePiotr Trojanek3-10/+6
Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_tss.adb (TSS): Refactor IF condition to make code smaller. * lib.adb (Increment_Serial_Number, Synchronize_Serial_Number): Use type of renamed object when creating renaming. * lib.ads (Unit_Record): Refine subtype of dependency number.
25 hoursada: Fix spurious Constraint_Error raised by 'Value of fixed-point typesEric Botcazou8-55/+13
This happens for very large Smalls with regard to the size of the mantissa, because the prerequisites of the implementation used in this case are not met, although they are documented in the head comment of Integer_To_Fixed. This change documents them at the beginning of the body of System.Value_F and adjusts the compiler interface accordingly. gcc/ada/ChangeLog: * libgnat/s-valuef.adb: Document the prerequisites more precisely. * libgnat/a-tifiio.adb (OK_Get_32): Adjust to the prerequisites. (OK_Get_64): Likewise. * libgnat/a-tifiio__128.adb (OK_Get_32): Likewise. (OK_Get_64): Likewise. (OK_Get_128): Likewise. * libgnat/a-wtfiio.adb (OK_Get_32): Likewise. (OK_Get_64): Likewise. * libgnat/a-wtfiio__128.adb (OK_Get_32): Likewise. (OK_Get_64): Likewise. (OK_Get_128): Likewise. * libgnat/a-ztfiio.adb (OK_Get_32): Likewise. (OK_Get_64): Likewise. * libgnat/a-ztfiio__128.adb (OK_Get_32): Likewise. (OK_Get_64): Likewise. (OK_Get_128): Likewise. * exp_imgv.adb (Expand_Value_Attribute): Adjust the conditions under which the RE_Value_Fixed{32,64,128} routines are called for ordinary fixed-point types.
25 hoursada: Fix commentRonan Desplanques1-3/+3
This patch fixes a comment that wrongly stated that no dispatch entry for deep finalize was created for limited tagged types. gcc/ada/ChangeLog: * exp_ch3.adb (Make_Predefined_Primitive_Specs): Fix comment.
25 hoursada: Fix assertion failure on finalizable aggregateRonan Desplanques1-1/+1
The Finalizable aspect makes it possible that Insert_Actions_In_Scope_Around is entered with an empty list of after actions. This patch fixes a condition that was not quite right in this case. gcc/ada/ChangeLog: * exp_ch7.adb (Insert_Actions_In_Scope_Around): Fix condition.
25 hoursada: Remove unnecessary "return;" statementsBob Duff21-47/+20
A "return;" at the end of a procedure is unnecessary and misleading. This patch removes them. gcc/ada/ChangeLog: * checks.adb: Remove unnecessary "return;" statements. * eval_fat.adb: Likewise. * exp_aggr.adb: Likewise. * exp_attr.adb: Likewise. * exp_ch3.adb: Likewise. * exp_ch4.adb: Likewise. * exp_ch5.adb: Likewise. * exp_ch6.adb: Likewise. * exp_unst.adb: Likewise. * krunch.adb: Likewise. * layout.adb: Likewise. * libgnat/s-excdeb.adb: Likewise. * libgnat/s-trasym__dwarf.adb: Likewise. * par-endh.adb: Likewise. * par-tchk.adb: Likewise. * sem.adb: Likewise. * sem_attr.adb: Likewise. * sem_ch6.adb: Likewise. * sem_elim.adb: Likewise. * sem_eval.adb: Likewise. * sfn_scan.adb: Likewise.
25 hoursada: Correct documentation of policy_identifiers for Assertion_PolicyBob Duff4-5/+4
Follow-on to gnat-945. Change Ignore to Disable; Ignore is defined by the language, Disable is the implementation-defined one. Also minor code cleanup. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_characteristics.rst: Change Ignore to Disable. * sem_ch13.ads (Analyze_Aspect_Specifications): Minor: Remove incorrect comment; there is no need to check Has_Aspects (N) at the call site. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
25 hoursada: Remove Empty_Or_ErrorBob Duff7-24/+16
Minor stylistic improvement: Remove Empty_Or_Error, and replace comparisons with Empty_Or_Error with "[not] in Empty | Error". (Found while working on VAST.) gcc/ada/ChangeLog: * types.ads (Empty_Or_Error): Remove. * atree.adb: Remove reference to Empty_Or_Error. * par-endh.adb: Likewise. * sem_ch12.adb: Likewise. * sem_ch3.adb: Likewise. * sem_util.adb: Likewise. * treepr.adb: Likewise.
25 hoursada: Call Semantics when analyzing a renamed packageViljar Indus1-1/+1
Calling Semantics here will additionally update the reference to Current_Sem_Unit the renamed unit so that we will not receive bogus visibility errors when checking for self-referential with-s. gcc/ada/ChangeLog: * sem_ch10.adb(Analyze_With_Clause): Call Semantics instead of Analyze to bring Current_Sem_Unit up to date.
25 hoursada: Fix SPARK context discovery from within subunitsPiotr Trojanek1-0/+7
When navigating the AST to find the enclosing subprogram we must traverse from subunits to the corresponding stub. gcc/ada/ChangeLog: * lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Library_Package): Traverse subunits and body stubs.
25 hoursada: Document restriction on array lengthTonu Naks1-0/+11
gcc/ada/ChangeLog: * libgnat/i-cstrin.ads (Value): add documentation
25 hoursada: Fix index bounds check in Super_Delete functions and proceduresAleksandra Pasek3-6/+6
gcc/ada/ChangeLog: * libgnat/a-strsup.adb (Super_Delete): Fix index check. * libgnat/a-stwisu.adb (Super_Delete): Likewise. * libgnat/a-stzsup.adb (Super_Delete): Likewise.
25 hoursada: 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.
25 hoursada: Support Potentially_Invalid aspect in the frontendJoffrey Huguet8-595/+1048
The Potentially_Invalid aspect is used to disable the SPARK assumption that all read data is valid on a case-by-case basis in GNATprove. gcc/ada/ChangeLog: * aspects.ads: Define an identifier for Potentially_Invalid. * doc/gnat_rm/implementation_defined_aspects.rst: Add section for Potentially_Invalid. * sem_attr.adb (Analyze_Attribute_Old_Result): Attribute Old is allowed to occur in a Potentially_Invalid aspect. * sem_ch13.adb (Analyze_Aspect_Specifications): Handle Potentially_Invalid. * sem_util.adb (Has_Potentially_Invalid): Returns True iff an entity is subject to the Potentially_Invalid aspect. * sem_util.ads (Has_Potentially_Invalid): Idem. * snames.ads-tmpl: New name for Potentially_Invalid. * gnat_rm.texi: Regenerate.
25 hoursada: Fix ALI elaboration flags for ghost compilation units (cont.)Piotr Trojanek1-0/+4
When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this unit required elaboration counters, which caused linking errors to non-existing objects. gcc/ada/ChangeLog: * sem_ch10.adb (Analyze_Compilation_Unit): Ignored ghost unit need no elaboration checks.
25 hoursada: Use consistent truncation of 'Value for decimal fixed-point typesEric Botcazou1-2/+2
This uses truncation for all bases instead of for base 10 only. gcc/ada/ChangeLog: * libgnat/s-valued.adb (Integer_to_Decimal): Use truncation for the scaled divide operation performed for bases other than 10.
2 daysDaily bump.GCC Administrator1-0/+402
3 daysAda: Fix assertion failure for Finalizable aspect on tagged typeEric Botcazou1-3/+2
This fixes an assertion failure for the Finalizable aspect applied on a tagged type with discriminant-dependent component. gcc/ada/ PR ada/120705 * exp_ch6.adb (Needs_BIP_Collection): Always return False if the type has relaxed finalization. gcc/testsuite/ * gnat.dg/specs/finalizable2.ads: New test.
3 daysada: Restore consistent rounding of 'Value for ordinary fixed-point typesEric Botcazou1-1/+5
This restores the rounding of the first scaled divide operation applied to the extra digits, which yields more consistent results for smalls that are reciprocal of integers. gcc/ada/ChangeLog: * libgnat/s-valuef.adb (Integer_to_Fixed): Restore rounding of the first scaled divide operation.
3 daysada: Fix ALI elaboration flags for ghost compilation unitsPiotr Trojanek1-1/+9
When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this unit includes elaboration code, which caused linking errors to non-existing elaboration counters. This was because elaboration code is only detected in Gigi, which is skipped for ignored ghost units, because we don't generate object code for them gcc/ada/ChangeLog: * gnat1drv.adb (Gnat1drv): Do minimal decoration of the spec and body of an ignored ghost compilation unit.
3 daysada: Remove unused variables from the binder generation routinePiotr Trojanek2-22/+2
Remove leftovers from zero cost exception handling; semantics is unaffected. gcc/ada/ChangeLog: * ali.ads (Unit_Record): Fix grammar in comment. * bindgen.adb (Num_Elab_Calls, Num_Primary_Stacks): Remove counters that were only incremented and never actually used.
3 daysada: Disallow underscore before exponentTonu Naks1-2/+6
Underscore is allowed only between digits. The current implementattion was considering 'E' as a digit even if it was not in the range of Base and could denote exponent only. gcc/ada/ChangeLog: * libgnat/s-valuer.adb (Scan_Decimal_Digits, Scan_Integral_Digits): fix condition for rejecting underscore.