โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayChange logs

ada: Compiler crash on container aggregate with loop_parameter_specifications

2 November 2023 at 23:36
ada: Compiler crash on container aggregate with loop_parameter_specifications

The compiler crashes on a container aggregate with more than one
iterated_element_association given by a loop_parameter_specification.
In such a case, the tree contains N_Iterated_Component_Association
nodes rather than N_Iterated_Element_Association nodes, and the code
for handling those needs to obtain the bounds from the Discrete_Choices
field of each N_Iterated_Component_Association rather than assuming
that the association has a normal list of choices.

gcc/ada/

	* sem_aggr.adb (Resolve_Container_Aggregate): In the case where Comp
	is an N_Iterated_Component_Association, pick up Discrete_Choices rather
	than Choices.
  • [DBH] gcc/ada/sem_aggr.adb
  • 2 November 2023 at 23:36

ada: Another couple of cleanups in the finalization machinery

2 November 2023 at 14:05
ada: Another couple of cleanups in the finalization machinery

For package specs and bodies that need finalizers, Build_Finalizer is
invoked from the Standard scope so it needs to adjust the scope stack
before creating new objects; this changes it to do so only once.

For other kinds of scopes, it is invoked from Expand_Cleanup_Actions,
which assumes that the correct scope is already on the stack; that's
why Cleanup_Scopes adjusts the scope stack explicitly, but it should
use Pop_Scope instead of End_Scope to do it.

gcc/ada/

	* exp_ch7.adb (Build_Finalizer): For package specs and bodies, push
	and pop the specs onto the scope stack only once.
	* inline.adb (Cleanup_Scopes): Call Pop_Scope instead of End_Scope.
  • [DBH] gcc/ada/exp_ch7.adb
  • [DBH] gcc/ada/inline.adb
  • 2 November 2023 at 14:05

ada: Deep delta aggregates in postconditions

1 November 2023 at 21:39
ada: Deep delta aggregates in postconditions

Fix a bug in handling array-valued deep delta aggregates occurring in
postconditions. The bug could result in a spurious compilation failure.

gcc/ada/

	* sem_aggr.adb (Resolve_Delta_Array_Aggregate): In the case of a
	deep delta choice, the expected type for the expression will
	typically not be the component type of the array type, so a call
	to Analyze_And_Resolve that assumes otherwise would be an error.
	It turns out that such a call, while wrong, is usually harmless
	because the expression has already been marked as analyzed. This
	doesn't work if the aggregate occurs in a postcondition and, in
	any case, we don't want to rely on this. So do not perform the
	call in the deep case.
  • [DBH] gcc/ada/sem_aggr.adb
  • 1 November 2023 at 21:39

ada: Compiler error reporting illegal prefix on legal loop iterator with "in"

31 October 2023 at 19:50
ada: Compiler error reporting illegal prefix on legal loop iterator with "in"

During semantic analysis, the compiler fails to determine the cursor type
in the case of a generalized iterator loop with "in", in the case where the
iterator type has a parent type that is a controlled type (for example) and
its ancestor iterator interface type is given after as a progenitor. It also
improperly determines the ancestor interface type during expansion (within
Expand_Iterator_Loop_Over_Container), for both "in" and "of" iterator forms.
The FE was assuming that the iterator interface is simply the parent type
of the iterator type, but that type can occur later in the interface list,
or be inherited. A new function is added that properly locates a type's
iterator interface ancestor, if any, and is called for analysis and expansion.

gcc/ada/

	* exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Retrieve the
	iteration type's iteration interface progenitor via
	Iterator_Interface_Ancestor, in the case of both "in" and "of"
	iterators. Narrow the scope of Pack, so it's declared and
	initialized only within the code related to "of" iterators, and
	change its name to Cont_Type_Pack. Adjust comments.
	* sem_ch5.adb (Get_Cursor_Type): In the case of a derived type,
	retrieve the iteration type's iterator interface progenitor (if it
	exists) via Iterator_Interface_Ancestor rather than assuming that
	the parent type is the interface progenitor.
	* sem_util.ads (Iterator_Interface_Ancestor): New function.
	* sem_util.adb (Iterator_Interface_Ancestor): New function
	returning a type's associated iterator interface type, if any, by
	collecting and traversing the type's interfaces.
  • [DBH] gcc/ada/exp_ch5.adb
  • [DBH] gcc/ada/sem_ch5.adb
  • [DBH] gcc/ada/sem_util.adb
  • [DBH] gcc/ada/sem_util.ads
  • 31 October 2023 at 19:50

ada: Small consistency fix for -gnatwv warning

31 October 2023 at 16:49
ada: Small consistency fix for -gnatwv warning

The goal is to arrange for the warning to be issued consistently between
objects whose address is taken and objects whose address is not taken.

gcc/ada/

	* sem_warn.adb (Check_References.Type_OK_For_No_Value_Assigned):
	New predicate.
	(Check_References): For Warn_On_No_Value_Assigned, use the same test
	on the type in the address-not-taken and default cases.

gcc/testsuite/ChangeLog:

	* gnat.dg/warn25.adb: Add xfail.
  • [DBH] gcc/ada/sem_warn.adb
  • 31 October 2023 at 16:49

ada: Fix internal error on 'Address of task component

31 October 2023 at 16:27
ada: Fix internal error on 'Address of task component

This happens when the prefix of the selected component is of an access type,
i.e. there is an implicit dereference. because the prefix is not resolved.

gcc/ada/

	* sem_attr.adb (Resolve_Attribute) <Attribute_Address>: Remove the
	bypass for prefixes with task type.
  • [DBH] gcc/ada/sem_attr.adb
  • 31 October 2023 at 16:27

ada: Further cleanup in finalization machinery

27 October 2023 at 09:34
ada: Further cleanup in finalization machinery

The bodies of generic units are instantiated separately by GNAT at the end
of the processing of the compilation unit.  This requires the deferral of
the generation of cleanups and finalization actions in enclosing scopes,
except for instantiations in generic units where they are not generated.

The criterion used to detect this latter case is Inside_A_Generic, but this
global variable is not properly updated during the instantiation of generic
bodies, leading to problems with nested instantiations, so it is changed to
Expander_Active instead.  As a matter of fact, the exact same idiom is used
a few lines above to clear the Needs_Body variable.

gcc/ada/

	* sem_ch12.adb (Analyze_Package_Instantiation): Test Expander_Active
	to detect generic contexts for the generation of cleanup actions.
  • [DBH] gcc/ada/sem_ch12.adb
  • 27 October 2023 at 09:34

ada: Fix string indexing within GNAT.Calendar.Time_IO.Value

27 October 2023 at 00:08
ada: Fix string indexing within GNAT.Calendar.Time_IO.Value

The patch fixes an issue in the compiler whereby calls to
GNAT.Calendar.Time_IO.Value where the actual for formal String Date with
indexing starting at any value besides one would result in a spurious runtime
exception.

gcc/ada/

	* libgnat/g-catiio.adb (Value): Modify conditionals to use 'Last
	instead of 'Length
  • [DBH] gcc/ada/libgnat/g-catiio.adb
  • 27 October 2023 at 00:08

ada: Fix miscompilation of loop over boolean range

25 October 2023 at 15:52
ada: Fix miscompilation of loop over boolean range

The optimized form generated in this case turns out to be problematic.

gcc/ada/

	* gcc-interface/trans.cc (Loop_Statement_to_gnu): Always use the
	simpler form for a loop with a boolean iteration variable.
  • [DBH] gcc/ada/gcc-interface/trans.cc
  • 25 October 2023 at 15:52

ada: Further cleanup in finalization machinery

24 October 2023 at 07:50
ada: Further cleanup in finalization machinery

This removes the specific treatment of transient scopes in initialization
procedures, which is obsolete.

gcc/ada/

	* exp_aggr.adb (Convert_To_Assignments): Do not treat initialization
	procedures specially when it comes to creating a transient scope.
	* exp_ch7.adb (Build_Finalizer.Process_Declarations): Likewise.
	* exp_util.adb (Requires_Cleanup_Actions): Likewise.
  • [DBH] gcc/ada/exp_aggr.adb
  • [DBH] gcc/ada/exp_ch7.adb
  • [DBH] gcc/ada/exp_util.adb
  • 24 October 2023 at 07:50

ada: Deep delta aggregates cleanup.

23 October 2023 at 21:45
ada: Deep delta aggregates cleanup.

Cleanup after the introduction of deep delta aggregates.
Eliminate a new gnatcheck message.

gcc/ada/

	* sem_aggr.adb: Replace "not Present (...)" call with "No (...)" call.
  • [DBH] gcc/ada/sem_aggr.adb
  • 23 October 2023 at 21:45

ada: Small cleanup in finalization machinery

23 October 2023 at 18:46
ada: Small cleanup in finalization machinery

This removes an obsolete flag and adjusts a couple of obsolete comments.

gcc/ada/

	* gen_il-fields.ads (Opt_Field_Enum): Remove Is_Finalization_Wrapper
	* gen_il-gen-gen_nodes.adb (N_Block_Statement): Likewise.
	* sinfo.ads (Is_Finalization_Wrapper): Delete.
	* exp_ch7.adb (Build_Finalizer.Process_Declarations): Adjust comment
	and remove obsolete code testing the Is_Finalization_Wrapper flag.
	* exp_util.adb (Requires_Cleanup_Actions): Likewise.
  • [DBH] gcc/ada/exp_ch7.adb
  • [DBH] gcc/ada/exp_util.adb
  • [DBH] gcc/ada/gen_il-fields.ads
  • [DBH] gcc/ada/gen_il-gen-gen_nodes.adb
  • [DBH] gcc/ada/sinfo.ads
  • 23 October 2023 at 18:46

ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form

23 October 2023 at 14:02
ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form

Before this patch, on Windows, file with non-ASCII Latin1 names could be created
with Ada.Text_IO.Create by passing "encoding=8bits" through the Form
parameter and a Latin1-encoded string through the Name parameter,
but calling Ada.Text_IO.Delete on them raised an illegitimate exception.

This patch fixes this by making the wrappers of the unlink system function
aware of the encoding value passed through the Form parameter. It also
removes an unnecessary curly-brace block.

gcc/ada/

	* adaint.c (__gnat_unlink): Add new parameter and fix text
	conversion on Windows. Remove unnecessary curly braces.
	* adaint.h (__gnat_unlink): Add new parameter.
	* libgnat/i-cstrea.ads (unlink): Adapt to __gnat_unlink signature
	change.
	* libgnat/i-cstrea.adb (unlink): New Subprogram definition.
	* libgnat/s-crtl.ads (unlink): Adapt to __gnat_unlink signature
	change.
	* libgnat/s-fileio.adb (Delete): Pass encoding argument to unlink.
  • [DBH] gcc/ada/adaint.c
  • [DBH] gcc/ada/adaint.h
  • [DBH] gcc/ada/libgnat/i-cstrea.adb
  • [DBH] gcc/ada/libgnat/i-cstrea.ads
  • [DBH] gcc/ada/libgnat/s-crtl.ads
  • [DBH] gcc/ada/libgnat/s-fileio.adb
  • 23 October 2023 at 14:02

ada: Fix issue with indefinite vector of overaligned unconstrained array

20 October 2023 at 08:26
ada: Fix issue with indefinite vector of overaligned unconstrained array

The problem is that the aligning machinery is not consistently triggered,
depending on whether a constrained view or the nominal unconstrained view
of the element type is used to perform the allocations and deallocations.

gcc/ada/

	* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Subtype>: Put
	the alignment directly on the type in the constrained case too.
	* gcc-interface/utils.cc (maybe_pad_type): For an array type, take
	the alignment of the element type as the original alignment.
  • [DBH] gcc/ada/gcc-interface/decl.cc
  • [DBH] gcc/ada/gcc-interface/utils.cc
  • 20 October 2023 at 08:26
โŒ
โŒ