โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Today โ€” 28 November 2023gcc/ada history

ada: Fix incorrect quoting in documentation

16 November 2023 at 07:26
ada: Fix incorrect quoting in documentation

gcc/ada/

	* doc/gnat_rm/the_implementation_of_standard_i_o.rst: Fix a couple
	occurrences of incorrect quoting.
	* gnat_rm.texi: Regenerate.
  • [DBH] gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst
  • [DBH] gcc/ada/gnat_rm.texi
  • 16 November 2023 at 07:26

ada: Further cleanup in finalization machinery

9 November 2023 at 14:00
ada: Further cleanup in finalization machinery

When transient scopes are being materialized, they can give rise to a block
created around the construct being wrapped or not, depending on the kind of
construct.  In both cases finalization actions for the transient objects of
the scope are generated the same way, with normal finalization done manually
immediately after the construct and exceptional finalization deferred to the
enclosing scope by means of a hooking mechanism.

Now when the block is generated, it becomes this enclosing scope, so the
normal finalization that comes with it would also be done immediately after
the construct, even without normal finalization generated manually.

Therefore this change gets rid of the manual finalization as well as of the
hooking in the cases where the block is generated, leading to a significant
streamlining of the expanded code in these cases.  This requires fixing a
small inaccuracy of the Within_Case_Or_If_Expression predicate, which must
only be concerned with the dependent expressions, since those are the only
ones to be treated specially by the finalization machinery.

It also contains a small cleanup for the description of the transient scope
management present at the beginning of the exp_ch7.adb file.

gcc/ada/

	* exp_ch7.ads (Expand_Cleanup_Actions): Move declaration to the
	Finalization Management section.
	* exp_ch7.adb (Transient Scope Management): Move description down to
	after that of the general finalization and make a few changes.
	(Insert_Actions_In_Scope_Around): Call Process_Transients_In_Scope
	only if cleanups are being handled.
	(Process_Transients_In_Scope): Remove redundant test on Clean.
	* exp_util.ads (Within_Case_Or_If_Expression): Adjust description.
	* exp_util.adb (Within_Case_Or_If_Expression): Only return true if
	within the dependent expressions of the conditional expressions.
  • [DBH] gcc/ada/exp_ch7.adb
  • [DBH] gcc/ada/exp_ch7.ads
  • [DBH] gcc/ada/exp_util.adb
  • [DBH] gcc/ada/exp_util.ads
  • 9 November 2023 at 14:00

ada: Fix premature finalization for nested return within extended one

8 November 2023 at 22:29
ada: Fix premature finalization for nested return within extended one

The return object is incorrectly finalized when the nested return is taken,
because the special flag attached to the return object is not updated.

gcc/ada/

	* exp_ch6.adb (Build_Flag_For_Function): New function made up of the
	code building the special flag for return object present...
	(Expand_N_Extended_Return_Statement): ...in there.  Replace the code
	with a call to Build_Flag_For_Function.  Add assertion for the flag.
	(Expand_Non_Function_Return): For a nested return, if the return
	object needs finalization actions, update the special flag.
  • [DBH] gcc/ada/exp_ch6.adb
  • 8 November 2023 at 22:29

ada: Fix internal error on declare expression in expression function

6 November 2023 at 22:34
ada: Fix internal error on declare expression in expression function

When the expression function is not a completion, its (return) expression
does not cause freezing so analyzing the declare expression in this context
must not freeze the type of the object.

The change also contains another fix, which makes it so that the compiler
does not evaluate a nonstatic representation attribute of a scalar subtype
in the same context if the subtype is not already frozen.

gcc/ada/

	* sem_attr.adb (Eval_Attribute): Do not proceed in a spec expression
	for nonstatic representation attributes of a scalar subtype when the
	subtype is not frozen.
	* sem_ch3.adb (Analyze_Object_Declaration): Do not freeze the type
	of the object in a spec expression.
  • [DBH] gcc/ada/sem_attr.adb
  • [DBH] gcc/ada/sem_ch3.adb
  • 6 November 2023 at 22:34
Before yesterdaygcc/ada history

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: 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 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: 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 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

Fix internal error on function returning dynamically-sized type

16 November 2023 at 17:36
Fix internal error on function returning dynamically-sized type

This is a tree sharing issue for the internal return type synthesized for
a function returning a dynamically-sized type and taking an Out or In/Out
parameter passed by copy.

gcc/ada/
	* gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Also create a
	TYPE_DECL for the return type built for the CI/CO mechanism.

gcc/testsuite/
	* gnat.dg/varsize4.ads, gnat.dg/varsize4.adb: New test.
	* gnat.dg/varsize4_pkg.ads: New helper.
  • [DBH] gcc/ada/gcc-interface/decl.cc
  • 16 November 2023 at 17:36

ada: Fix debug info for aliased packed array with unconstrained nominal subtype

17 October 2023 at 17:20
ada: Fix debug info for aliased packed array with unconstrained nominal subtype

The front-end now rewrites it as a renaming when it is initialized with a
function call and the same processing must be applied in the renaming case
as in the regular case for this kind of special objects.

gcc/ada/

	* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Apply the
	specific rewriting done for an aliased object with an unconstrained
	array nominal subtype in the renaming case too.
  • [DBH] gcc/ada/gcc-interface/decl.cc
  • 17 October 2023 at 17:20

ada: Elide temporary for aliased array with unconstrained nominal subtype

16 October 2023 at 19:16
ada: Elide temporary for aliased array with unconstrained nominal subtype

When the array is initialized with the result of a call to a function whose
result type is unconstrained, then the result is allocated with its bounds,
so the array can be rewritten as a renaming of the result in this case too.

gcc/ada/

	* exp_ch3.adb (Expand_N_Object_Declaration): Fold initialization
	expression of Nominal_Subtype_Is_Constrained_Array constant into
	the computation of Rewrite_As_Renaming and remove the constant.
	Set it to True for an aliased array with unconstrained nominal
	subtype if the subtype of the expression is also unconstrained.
  • [DBH] gcc/ada/exp_ch3.adb
  • 16 October 2023 at 19:16

ada: Fix incorrect resolution of overloaded function call in instance

15 October 2023 at 11:00
ada: Fix incorrect resolution of overloaded function call in instance

The problem occurs when the function call is the operand of an equality
operator, the type used to do the comparison is declared outside of the
generic construct but visible inside it, and this generic construct also
declares two functions with the same profile except for the result type,
one result type being the aforementioned type, the other being derived
from this type but not visible inside the generic construct.  When the
second operand is either a literal or also overloaded, the call may be
resolved to the second function instead of the first in instances.

gcc/ada/

	* gen_il-fields.ads (Opt_Field_Enum): Add Compare_Type.
	* gen_il-gen-gen_nodes.adb (N_Op_Eq): Likewise.
	(N_Op_Ge): Likewise.
	(N_Op_Gt): Likewise.
	(N_Op_Le): Likewise.
	(N_Op_Lt): Likewise.
	(N_Op_Ne): Likewise.
	* sinfo.ads (Compare_Type): Document new field.
	* sem_ch4.adb (Analyze_Comparison_Equality_Op): If the entity is
	already present, set the Compare_Type on overloaded operands if it
	is present on the node.
	* sem_ch12.adb (Check_Private_View): Look into the Compare_Type
	instead of the Etype for comparison operators.
	(Copy_Generic_Node): Remove obsolete code for comparison
	operators.
	(Save_Global_References.Save_References): Do not walk into the
	descendants of N_Implicit_Label_Declaration nodes.
	(Save_Global_References.Set_Global_Type): Look into the
	Compare_Type instead of the Etype for comparison operators.
	* sem_res.adb (Resolve_Comparison_Op): Set Compare_Type.
	(Resolve_Equality_Op): Likewise.
  • [DBH] gcc/ada/gen_il-fields.ads
  • [DBH] gcc/ada/gen_il-gen-gen_nodes.adb
  • [DBH] gcc/ada/sem_ch12.adb
  • [DBH] gcc/ada/sem_ch4.adb
  • [DBH] gcc/ada/sem_res.adb
  • [DBH] gcc/ada/sinfo.ads
  • 15 October 2023 at 11:00

ada: Minor tweaks for comparison operators

13 October 2023 at 13:41
ada: Minor tweaks for comparison operators

No functional changes.

gcc/ada/

	* gen_il-gen-gen_nodes.adb (N_Op_Boolean): Fix description.
	* sem_ch4.adb (Analyze_Comparison_Equality_Op): Tidy up.
	* sem_ch12.adb (Copy_Generic_Node): Use N_Op_Compare subtype.
  • [DBH] gcc/ada/gen_il-gen-gen_nodes.adb
  • [DBH] gcc/ada/sem_ch12.adb
  • [DBH] gcc/ada/sem_ch4.adb
  • 13 October 2023 at 13:41
โŒ
โŒ