Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch fixes an issue where the compiler was incorrectly allowing
references to discriminants of the ancestor type in private type
extensions.
gcc/ada/ChangeLog:
* sem_ch3.adb (Build_Derived_Private_Type): Fix test.
(Build_Derived_Record_Type): Adjust error recovery paths.
|
|
There should be no functional changes.
gcc/ada/ChangeLog:
* einfo.ads (Has_Homonym): Fix inaccuracy in description.
* sem_ch8.ads (Find_Direct_Name): Remove obsolete description.
* sem_ch12.adb (Analyze_Associations): Rename I_Node parameter
into N and adjust description.
(Analyze_Subprogram_Instantiation): Add missing description.
(Contains_Instance_Of): Fix description.
(Associations): Rename Generic_Actual_Rec into Actual_Rec and
Gen_Assocs_Rec into Match_Rec.
(Analyze_One_Association): Rename I_Node parameter into N.
(Check_Fixed_Point_Warning): Rename Gen_Assocs parameter into
Match.
(Body of Associations): Minor cleanups and tweaks.
(Analyze_Associations): Rename I_Node parameter into N and
adjust implementation.
(Analyze_One_Association): Likewise.
(Analyze_Package_Instantiation): Remove obsolete code and clean up.
(Check_Fixed_Point_Warning): Rename Gen_Assocs parameter into
Match and adjust implementation.
(Freeze_Package_Instance): Simplify condition.
(Get_Unit_Instantiation_Node): Add support for instantiations of
subprograms and stop the loop properly in case of errors.
* sem_util.ads (Add_Global_Declaration): Rename N parameter into
Decl and fix description.
* sem_util.adb (Add_Global_Declaration): Rename N parameter into
Decl and adjust implementation.
|
|
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Scan_Raw_Real): Add RM reference.
|
|
Also improve a few comments in the enclosing subprogram body.
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Scan_Raw_Real): Remove subexpression. Improve
surrounding comments.
|
|
Check that the tree is really a tree, that parent pointers
make sense, that every node has been analyzed, and so on.
Most of these checks are disabled, because they fail in
many cases, including the compiler and run-time library.
Improve the debugging support in VAST. Walk subtrees "by hand",
rather than calling Atree.Traverse routines, because that
makes debugging printouts more convenient, and because we
want to keep a node stack for checking parents.
gcc/ada/ChangeLog:
* vast.adb: Check basic tree properties.
* atree.adb (Traverse_Field): Minor.
* treepr.adb (Destroy): Minor comment.
|
|
The test as currently written is incorrect for odd bases.
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Round_Extra): Use multiplicative test.
|
|
A previous change cleaned up the Ekind field of record component
entities. That made a particular test obsolete, so this patch removes
that test.
gcc/ada/ChangeLog:
* einfo-utils.adb (Set_Convention): Remove obsolete test.
|
|
Some error processing paths in Enter_Name are adjusted so that error
messages are not affected.
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Discriminants): Set Ekind earlier.
* sem_util.adb (Enter_Name): Adjust error processing.
|
|
The first issue is that the function would wrongly raise Constraint_Error
on the edge case where Val = 2**(Int'Size - 1) and Minus is not set.
The second issue is that some runtimes are compiled with -gnatp and would
fail to raise Constraint_Error when the sum of the terms overflows an Int.
The third issue is that the function takes a long time to deal with huge
negative exponents.
gcc/ada/ChangeLog:
* libgnat/s-valuef.adb (Integer_To_Fixed): Enable overflow checks.
Deal specifically with Val = 2**(Int'Size - 1) if Minus is not set.
Exit the loop when V saturates to 0 in the case of (huge) negative
exponents.
|
|
Exp_Util.Insert_Actions handles scopes of synchronized types specially,
but the condition it tested before this patch was not quite correct in
some cases, for example during some expansion operations made under
Expand_N_Task_Type_Declaration. This patch refines the test.
gcc/ada/ChangeLog:
* exp_util.adb (Insert_Actions): Refine test.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler
switches) <-O>: Fix long line.
* gnat_ugn.texi: Regenerate.
|
|
This implements the new (sub)switch -gnatRh to display holes in the layout
of record types, which are mostly present to fulfill alignment requirements.
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (List of
all switches): Add -gnatRh subswitch.
(Debugging Control): Document -gnatRh subswitch.
* opt.ads (List_Representation_Info_Holes): New boolean variable.
* repinfo.adb: Add with clause for GNAT.Heap_Sort_G.
(List_Common_Type_Info): Relax assertion.
(List_Object_Info): Replace assertion with additional test.
(List_Record_Layout): If -gnatRh is specified, make sure that the
components are ordered by increasing offsets. Output a comment
line giving the number of unused bits if there is a hole between
consecutive components. Streamline the control flow of the loop.
(List_Record_Info): Use the original record type giving the layout
of components, if any, to display the layout of the record.
* switch-c.adb (Scan_Front_End_Switches) <-gnatR>: Add support for
-gnatRh subswitch.
* usage.adb (Usage): Document -gnatRh subswitch.
* gnat_ugn.texi: Regenerate.
|
|
The secondary stack allocator needs to take alignment constraints into
account when doing allocations. In the full runtime the secondary stack
is allocated in chunks on the heap and can grow dynamically. As it does
not grow contiguously the "top" of the stack depends on the size of
the allocation. Therefore the alignment of the stack top is not known at
allocation time and the padding needed for a particular alignment needs
to be calculated conservatively to ensure the allocation fits the
requested size after the base address has been aligned.
On more restricted platforms the secondary stack is a contiguous block
of statically allocated memory. Here the conservative mechanism is not
required since the allocations base address is known and the required
padding can be calculated right away. The conservative approach also
sometimes causes an allocation to be slightly larger than it needs to
be. This can be a problem on platforms with limited RAM availability. To
avoid this problem modify the calculation of the required padding on these
platforms to always exactly fit the required size.
gcc/ada/ChangeLog:
* libgnat/s-secsta.adb (SS_Allocate): Add comment about
conservative alignment padding calculation.
* libgnat/s-secsta__cheri.adb (SS_Allocate): Add comment about
conservative alignment padding calculation.
|
|
This patch rewrites a boolean expression to make it easier to understand
in its context. It also tweaks the surrounding comments.
gcc/ada/ChangeLog:
* sem_warn.adb (Check_References): Rewrite expression
|
|
This patch removes various calls on entities that have their entity
kinds set to E_Void, by giving those entities their proper kinds earlier.
This is to prepare for potential new future invariant checks on entities.
gcc/ada/ChangeLog:
* sem_ch3.adb (Constrain_Index, Make_Index, Array_Type_Declaration,
Analyze_Number_Declaration): Remove uses of E_Void.
|
|
In particular the most recently added ones, namely -Og and -Oz. But -Ofast
is not documented because it disregards strict compliance with standards.
gcc/ada/ChangeLog:
* usage.adb (Usage): Justify the documentation of common switches
like that of other switches. Rework that of the -O switch.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler
switches) <-O>: Rework and document 'z' and 'g' operands.
* doc/gnat_ugn/gnat_and_program_execution.rst (Optimization Levels):
Rework and document -Oz and -Og switches.
* gnat_ugn.texi: Regenerate.
|
|
Before this patch, Constrain_Index always started by creating an itype
but then sometimes not using it for anything. This patch makes it so an
itype is only created when needed.
gcc/ada/ChangeLog:
* sem_ch3.adb (Constrain_Index): Avoid unused itypes.
|
|
Code cleanup; behavior is unaffected.
gcc/ada/ChangeLog:
* sem_ch3.adb (Constrain_Index): Factorize return statement.
|
|
gcc/ada/ChangeLog:
* sem_ch3.adb (Build_Derived_Numeric_Type): Remove duplicate call.
|
|
|
|
AST field Entry_Component doesn't make sense for generic formal objects and was
never used there. Code cleanup; behavior is unaffected.
gcc/ada/ChangeLog:
* gen_il-gen-gen_entities.adb (Formal_Object_Kind): Remove
Entry_Component field.
|
|
We intentionally allow First to work on No_List, so there is no need to guard
against a No_List. Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* sem_attr.adb (Resolve_Attribute): Remove redundant guard.
|
|
This replaces a couple of occurrences of "function" by "subprogram".
gcc/ada/ChangeLog:
* inline.adb (Analyze_Inlined_Bodies): Minor comment tweak.
|
|
This removes the code dealing with generic main units from the body of the
instantiation routine, namely Instantiate_Bodies, and replaces it by tests
done earlier in the processing.
The test added to Need_Subprogram_Instance_Body is already present in the
twin predicate Needs_Body_Instantiated.
gcc/ada/ChangeLog:
* inline.adb (Instantiate_Body): Do not call Add_Scope_To_Clean if
the main unit is generic.
(Instantiate_Bodies): Do not deal with generic main units here.
* sem_ch12.adb (Need_Subprogram_Instance_Body): Return false if the
main unit is generic.
|
|
The files are not compiled into libgnat.a but are nevertheless installed
in the adainclude directory, which is unwanted.
gcc/ada/ChangeLog:
* Makefile.rtl (ADA_EXCLUDE_SRCS): Add the 128-bit support files.
|
|
Process_Subtype can be passed either a subtype indication or a subtype
mark. Before this patch, it branched directly depending on the kind of
the argument, but there actually was processing common to the two
branches like resolving the subtype mark. This patch factorizes this
common processing out of the if statement.
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Subtype): Factorize code.
|
|
Fix the comment about Itypes, so the Parent field is no longer required.
Change VAST to no longer require it. Remove Check_Itype_Parents
from Check_Enum; it can no longer fail, so there's no point in
making it switchable.
gcc/ada/ChangeLog:
* einfo.ads (Associated_Node_For_Itype): Document that
Parent field may be empty.
* vast.adb: Allow empty Parent in Itypes.
|
|
The compiler improperly flags an error on the use of a subtype with a
static predicate as a choice in a case expression alternative, complaining
that the subtype has a nonstatic predicate. The fix for this is to add
a test for the subtype not having a static predicate.
gcc/ada/ChangeLog:
* einfo.ads: Revise comment about Dynamic_Predicate flag to make it
more accurate.
* sem_case.adb (Check_Choices): Test "not Has_Static_Predicate_Aspect"
as additional guard for error about use of subtype with nonstatic
predicate as a case choice. Improve related error message.
|
|
gcc/ada/ChangeLog:
* libgnat/s-valueu.adb: add explict raise
* libgnat/s-valueu.ads: update annotation
|
|
Check_Discriminant_Conformance is really only about concepts defined in
chapter 3 of the Ada reference manual, so it fits better in Sem_Ch3 than
in Sem_Ch6.
gcc/ada/ChangeLog:
* sem_ch6.adb, sem_ch6.ads (Check_Discriminant_Conformance): Move to …
* sem_ch3.adb (Check_Discriminant_Conformance): … here.
|
|
Freeze_Static_Object needs to deal with the objects that have been created
by Insert_Conditional_Object_Declaration.
gcc/ada/ChangeLog:
* freeze.adb (Freeze_Static_Object): Do not issue any error message
for compiler-generated entities.
|
|
Implement two basic checks: Check that N_Error nodes cannot appear in the
tree (because VAST is not called when the source is illegal).
Check that every node has a parent, except for certain nodes where
we check the opposite. (We do not yet check that the parent pointers
actually point to the right node.)
Minor improvements. Flags for controlling debugging outputs and the like.
Capability to enable/disable individual checks. The intent is to
implement that only when needed -- i.e. when VAST finds a bug, and we
have not yet fixed the bug.
gcc/ada/ChangeLog:
* vast.adb: Implement two checks. Improve debugging
outputs.
|
|
The previous fix was not robust enough in the presence of transient scopes.
gcc/ada/ChangeLog:
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Deal with a
transient scope being created around the declaration.
* freeze.adb (Freeze_Entity): Do not call Freeze_Static_Object for
a renaming declaration.
|
|
The comment incorrectly mentions decimal fixed point.
gcc/ada/ChangeLog:
* libgnat/s-vafi32.ads: Fix head description.
* libgnat/s-vafi64.ads: Likewise.
* libgnat/s-vafi128.ads: Likewise.
|
|
Walks all trees (not just the main unit), deals with switches and
flags. Doesn't check much of anything yet (asserts that "unused" nodes
are not present).
Move decisions (what tree(s) to check, what switches enable checking)
from the caller to the body of VAST.
gcc/ada/ChangeLog:
* vast.adb: Initial implementation.
* vast.ads: Rename procedure. Remove parameter; body should decide
what to do.
* lib.ads (ipu): Minor: Rewrite comment for brevity, and because
of an inconvenient misspelling.
(Num_Units): Not used; remove.
(Remove_Unit): Minor: Remove "Currently" (which was current a decade
ago from) comment.
* lib.adb (Num_Units): Not used; remove.
* debug_a.adb (Debug_A_Entry): Fix bug: Use Write_Name_For_Debug,
so this won't crash on the Error node.
* debug.adb: Document -gnatd_V and -gnatd_W compiler switches.
* exp_ch6.adb (Validate_Subprogram_Calls): Remove redundant check for
Serious_Errors_Detected. (We turn off code gen when errors are
detected.)
* frontend.adb: Move decisions into VAST body.
* namet.ads (Present): Remove unnecessary overriding; these are
inherited by the derived types.
* namet.adb (Present): Likewise.
|
|
The compiler fails with a Storage_Error when compiling a container aggregate
for a Map type coming from an instantiation of Ada.Containers.Ordered_Maps
that specifies an enumeration type for the Key_Type formal.
gcc/ada/ChangeLog:
* exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Apply Enumeration_Pos
to Entity (Expr) rather than Expr.
|
|
gcc/ada/ChangeLog:
* sem_ch3.adb (Find_Type_Of_Object): Fix comment.
|
|
"Typ" is typically used to name constants that are entity IDs for types.
Before this patch, a constant local to Analyze_Component_Declaration
designating a syntactic subtype indication had that name. This patch
renames it to "Ind".
Code cleanup; behavior is unaffected.
gcc/ada/ChangeLog:
* sem_ch3.adb (Analyze_Component_Declaration): Rename constant.
|
|
Before this patch, Constrain_Array had a feature where it could be
passed Empty for the first actual and would then create an Itype itself.
There was only one use of this feature and it was unnecessary, so this
patch removes it.
gcc/ada/ChangeLog:
* sem_ch3.adb (Constrain_Array): Simplify.
(Process_Subtype): Adjust.
|
|
Root_Type does not return the same type for the private and the full view of
a derived private tagged type when both derive from an interface type.
gcc/ada/ChangeLog:
* sem_ch12.adb (Copy_Generic_Node): Do not call Root_Type to find
the root type of an aggregate of a derived tagged type.
|
|
This patch fixes a bug in System.Stack_Usage.Tasking.Compute_All_Tasks
where it would attempt to read the stack of threads that had already
completed.
gcc/ada/ChangeLog:
* libgnarl/s-stusta.adb (Compute_All_Tasks): Skip terminated tasks.
|
|
Some pragma nodes like the ones for Assertion_Policy are
replaced by a Null_Statement. This is not taken into account
when analyzing if the pragma is a configuration pragma.
gcc/ada/ChangeLog:
* sem_prag.adb (Is_Configuration_Pragma): Check that nodes
preceding the pragma are pragma nodes or originally were
pragma nodes.
|
|
Even though the issue is not user-visible, it's a (minor) departure from the
specification of the procedure.
gcc/ada/ChangeLog:
* libgnat/s-valued.adb (Integer_to_Decimal): Add Extra parameter and
use its value to call Bad_Value on boundary values.
(Scan_Decimal): Adjust call to Integer_to_Decimal.
(Value_Decimal): Likewise.
|
|
Before this patch, Process_Subtype looked at the parent of its argument
to determine whether it was called in a context where it was OK for the
subtype mark to refer to the incomplete view of a type. This patch adds
a new formal so that it becomes the responsibility of the caller in
order to make the code simpler overall.
The only change in the behavior of the compiler is that the messages
emitted in some error situations with the -gnatf switch are slightly
different.
gcc/ada/ChangeLog:
* sem_ch3.ads (Process_Subtype): New formal.
* sem_ch3.adb (Process_Subtype): Likewise.
(Analyze_Subtype_Declaration, Access_Type_Declaration): Use new
formal.
|
|
Process_Subtype calls itself in some error situations. This recursive
call was not updated together with the recent addition of the
Excludes_Null formal. This does not matter in practice because there can
never be both a null exclusion and another constraint at the same time,
but this patch updates the call anyway to make the situation clearer.
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Subtype): Fix recursive call.
|
|
Block_Node is the name of an entity field, so the change renames local
variables with this name for the sake of clarity.
gcc/ada/ChangeLog:
* par-ch5.adb (P_Declare_Statement): Rename local variable.
(P_Begin_Statement): Likewise.
|
|
With the current representation of GNAT AST the entity fields are not reused.
gcc/ada/ChangeLog:
* einfo.ads (Overridden_Operation, Static_Initialization): Remove
comments about a reused entity field.
|
|
This patch removes parentheses and vertical alignment that misleadingly
suggested the presence of function calls where there weren't any.
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Subtype): Tweak formatting.
|
|
This patch adds an assertion that checks that expanded code does not
contain erroneous access subtype definitions.
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Subtype): Add assertion.
|
|
gcc/ada/ChangeLog:
* sem_ch3.adb (Process_Subtype): Factorize initialization of variable.
|