Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
gcc/ada/ChangeLog:
* exp_ch6.adb (Expand_Ctrl_Function_Call): Precisify comment.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* exp_ch3.adb (Count_Default_Sized_Task_Stacks): Refine subtypes of
parameters; same for callsites.
|
|
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.
|
|
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.
|
|
gcc/ada/ChangeLog:
* exp_ch7.adb (Build_Record_Deep_Procs): Fix typo in comment.
|
|
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).
|
|
This patch fixes a misnaming of Make_Predefined_Primitive_Specs in a
comment.
gcc/ada/ChangeLog:
* exp_ch3.adb (Predefined_Primitive_Bodies): Fix comment.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
gcc/ada/ChangeLog:
* libgnat/i-cstrin.ads (Value): add documentation
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|