<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/gcc/ada/exp_aggr.adb, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>ada: Remove obsolete call to Establish_Transient_Scope</title>
<updated>2025-11-21T08:29:37+00:00</updated>
<author>
<name>Eric Botcazou</name>
<email>ebotcazou@adacore.com</email>
</author>
<published>2025-11-12T15:13:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=56722ed86ead6226148f7fc73fbf5691be2e37b2'/>
<id>56722ed86ead6226148f7fc73fbf5691be2e37b2</id>
<content type='text'>
There is a preceding call to Establish_Transient_Scope in the procedure for
the cases where it is required, and we no longer build the aggregate on the
stack before copying it to the heap for an allocator.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Expand_Array_Aggregate): Remove obsolete call to
	Establish_Transient_Scope for an allocator in a loop.
	* exp_ch7.adb (Establish_Transient_Scope): Adjust description.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a preceding call to Establish_Transient_Scope in the procedure for
the cases where it is required, and we no longer build the aggregate on the
stack before copying it to the heap for an allocator.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Expand_Array_Aggregate): Remove obsolete call to
	Establish_Transient_Scope for an allocator in a loop.
	* exp_ch7.adb (Establish_Transient_Scope): Adjust description.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Direct attribute definition for constructors</title>
<updated>2025-11-03T14:15:16+00:00</updated>
<author>
<name>Denis Mazzucato</name>
<email>mazzucato@adacore.com</email>
</author>
<published>2025-09-25T09:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=f5836f73b1021990e1ae448092cf6dc294eb7684'/>
<id>f5836f73b1021990e1ae448092cf6dc294eb7684</id>
<content type='text'>
This patch introduces the 'Constructor attribute and implements its direct
attribute definition syntax within subprogram specification. This new shorthand
avoids having to come up with an arbitrary subprogram name and to type out the
constructor aspect. Before, constructors where defined through the aspect
Constructor, which has been removed.

Furthermore, this patch prepares for the expansion of direct attribute
definitions to other attributes.

gcc/ada/ChangeLog:

	* errout.adb (Set_Msg_Node): Support N_Attribute_Reference and
	nodes that denotes direct attribute definitions.
	* exp_dbug.ads: Description for the encoding of direct attribute
	definitions as tick are hard to deal in entity names.
	* erroutc.adb
	(Set_Msg_Insertion_Name): Replace underscore between prefix and
	attribute name in direct attribute definitions; at this point we
	lost the semantic information of node type and we resort to match
	the string name as described in exp_dbug.adb.
	* exp_aggr.adb (Convert_To_Positional): Use Needs_Construction and
	Has_Default_Constructor.
	* exp_ch3.adb (Build_Record_Init_Proc)
	(Expand_N_Object_Declaration): Likewise.
	* exp_attr.adb (Expand_N_Attribute_Reference): Likewise.
	* exp_ch4.adb (Expand_N_Allocator): Likewise.
	* exp_ch6.adb
	(Prepend_Constructor_Procedure_Prologue): Use
	Is_Constructor_Procedure.
	(Make_Parent_Constructor_Call): Use
	Direct_Attribute_Definition_Name.
	* gen_il-fields.ads: Remove Constructor_List and Constructor_Name.
	* gen_il-gen-gen_entities.adb: Likewise.
	* einfo.ads (Needs_Construction): Add description.
	(Has_Delayed_Aspects): Adjust indentation.
	* par-ch13.adb (P_Attribute_Designators): Parse attribute
	designators.
	(P_Representation_Clause): Use P_Attribute_Designators.
	* par-ch6.adb (P_Subprogram): Support attribute designators in
	subprogram name.
	(Rewrites_Entity_If_Direct_Attribute_Def): Fix the specification
	node in case of direct attribute definitions.
	* par-endh.adb (Check_End, Same_Label): Likewise.
	* par.adb (P_Attribute_Designators): Specification.
	* sem_attr.adb (Analyze_Attribute): Error when using 'Constructor
	outside procedure specification.
	(Analyze_Attribute): Add error handling code.
	* sem_ch3.adb (Analyze_Aspect_Specifications): Likewise.
	* sem_ch6.adb (Analyze_Direct_Attribute_Definition): Handle direct
	attribute definitions. Add error handling code for the
	'Construction attribute and set constructor flags when necessary.
	(Analyze_Subprogram_Specification): Use
	Analyze_Direct_Attribute_Definition.
	* sem_util.adb (Direct_Attribute_Definition_Name): Name of
	entities created for direct attribute definitions. We emit an
	error if multiple attributes.
	(Is_Direct_Attribute_Subp_Spec): Helper to check whether a
	subprogram specification is a direct attribute definition.
	(Is_Constructor_Procedure): Helper to check whether a subprogram
	is a constructor procedure.
	(Has_Default_Constructor): Check whether the default constructor
	exists.
	(Default_Constructor): Not used anymore.
	(Parameter_Count): Likewise.
	(Process_End_Label): Get_Attribute_Reference_Name_String encodes
	also direct attribute definition end labels.
	* sem_util.ads: Likewise.
	* snames.ads-tmpl: Support for 'Constructor attribute.
	* snames.adb-tmpl (Is_Direct_Attribute_Definition_Name): Helper to
	check attributes allowed in direct attribute definitions.
	* aspects.ads: Remove constructor aspect.
	* sem_ch13.adb: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces the 'Constructor attribute and implements its direct
attribute definition syntax within subprogram specification. This new shorthand
avoids having to come up with an arbitrary subprogram name and to type out the
constructor aspect. Before, constructors where defined through the aspect
Constructor, which has been removed.

Furthermore, this patch prepares for the expansion of direct attribute
definitions to other attributes.

gcc/ada/ChangeLog:

	* errout.adb (Set_Msg_Node): Support N_Attribute_Reference and
	nodes that denotes direct attribute definitions.
	* exp_dbug.ads: Description for the encoding of direct attribute
	definitions as tick are hard to deal in entity names.
	* erroutc.adb
	(Set_Msg_Insertion_Name): Replace underscore between prefix and
	attribute name in direct attribute definitions; at this point we
	lost the semantic information of node type and we resort to match
	the string name as described in exp_dbug.adb.
	* exp_aggr.adb (Convert_To_Positional): Use Needs_Construction and
	Has_Default_Constructor.
	* exp_ch3.adb (Build_Record_Init_Proc)
	(Expand_N_Object_Declaration): Likewise.
	* exp_attr.adb (Expand_N_Attribute_Reference): Likewise.
	* exp_ch4.adb (Expand_N_Allocator): Likewise.
	* exp_ch6.adb
	(Prepend_Constructor_Procedure_Prologue): Use
	Is_Constructor_Procedure.
	(Make_Parent_Constructor_Call): Use
	Direct_Attribute_Definition_Name.
	* gen_il-fields.ads: Remove Constructor_List and Constructor_Name.
	* gen_il-gen-gen_entities.adb: Likewise.
	* einfo.ads (Needs_Construction): Add description.
	(Has_Delayed_Aspects): Adjust indentation.
	* par-ch13.adb (P_Attribute_Designators): Parse attribute
	designators.
	(P_Representation_Clause): Use P_Attribute_Designators.
	* par-ch6.adb (P_Subprogram): Support attribute designators in
	subprogram name.
	(Rewrites_Entity_If_Direct_Attribute_Def): Fix the specification
	node in case of direct attribute definitions.
	* par-endh.adb (Check_End, Same_Label): Likewise.
	* par.adb (P_Attribute_Designators): Specification.
	* sem_attr.adb (Analyze_Attribute): Error when using 'Constructor
	outside procedure specification.
	(Analyze_Attribute): Add error handling code.
	* sem_ch3.adb (Analyze_Aspect_Specifications): Likewise.
	* sem_ch6.adb (Analyze_Direct_Attribute_Definition): Handle direct
	attribute definitions. Add error handling code for the
	'Construction attribute and set constructor flags when necessary.
	(Analyze_Subprogram_Specification): Use
	Analyze_Direct_Attribute_Definition.
	* sem_util.adb (Direct_Attribute_Definition_Name): Name of
	entities created for direct attribute definitions. We emit an
	error if multiple attributes.
	(Is_Direct_Attribute_Subp_Spec): Helper to check whether a
	subprogram specification is a direct attribute definition.
	(Is_Constructor_Procedure): Helper to check whether a subprogram
	is a constructor procedure.
	(Has_Default_Constructor): Check whether the default constructor
	exists.
	(Default_Constructor): Not used anymore.
	(Parameter_Count): Likewise.
	(Process_End_Label): Get_Attribute_Reference_Name_String encodes
	also direct attribute definition end labels.
	* sem_util.ads: Likewise.
	* snames.ads-tmpl: Support for 'Constructor attribute.
	* snames.adb-tmpl (Is_Direct_Attribute_Definition_Name): Helper to
	check attributes allowed in direct attribute definitions.
	* aspects.ads: Remove constructor aspect.
	* sem_ch13.adb: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Fix missing finalization for qualified expression in conditional expression</title>
<updated>2025-09-15T12:59:29+00:00</updated>
<author>
<name>Eric Botcazou</name>
<email>ebotcazou@adacore.com</email>
</author>
<published>2025-08-26T22:16:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=c7ef48f2be5aa75ba9108ef1f6ac3a3206a14c9f'/>
<id>c7ef48f2be5aa75ba9108ef1f6ac3a3206a14c9f</id>
<content type='text'>
A qualified expression around a function call may cause a temporary to be
created and, therefore, cannot be bypassed in Expand_Ctrl_Function_Call.

gcc/ada/ChangeLog:

	* exp_util.ads (Unqualified_Unconditional_Parent): New function.
	* exp_util.adb (Unconditional_Parent): Do not look through qualified
	expressions.
	(Unqualified_Unconditional_Parent): New function identical to the
	original Unconditional_Parent.
	* exp_aggr.adb (Convert_To_Assignments): Replace Unconditional_Parent
	with Unqualified_Unconditional_Parent.
	(Expand_Array_Aggregate): Likewse.
	* exp_ch4.adb (Expand_N_Case_Expression): Likewise.
	(Expand_N_If_Expression): Likewise.
	* exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bypass an enclosing
	qualified expression in the parent chain.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A qualified expression around a function call may cause a temporary to be
created and, therefore, cannot be bypassed in Expand_Ctrl_Function_Call.

gcc/ada/ChangeLog:

	* exp_util.ads (Unqualified_Unconditional_Parent): New function.
	* exp_util.adb (Unconditional_Parent): Do not look through qualified
	expressions.
	(Unqualified_Unconditional_Parent): New function identical to the
	original Unconditional_Parent.
	* exp_aggr.adb (Convert_To_Assignments): Replace Unconditional_Parent
	with Unqualified_Unconditional_Parent.
	(Expand_Array_Aggregate): Likewse.
	* exp_ch4.adb (Expand_N_Case_Expression): Likewise.
	(Expand_N_If_Expression): Likewise.
	* exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bypass an enclosing
	qualified expression in the parent chain.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Compiler crash on container aggregate association with nonstatic key choice</title>
<updated>2025-09-11T09:10:48+00:00</updated>
<author>
<name>Gary Dismukes</name>
<email>dismukes@adacore.com</email>
</author>
<published>2025-08-21T18:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=767fce326ec142a3d63b5472814ff516e363d8dc'/>
<id>767fce326ec142a3d63b5472814ff516e363d8dc</id>
<content type='text'>
The compiler blows up on a container aggregate with a container element
association that has a key_choice given by a nonstatic key expression.
This happens in the size computation for the aggregate due to calling
Update_Choices with the nonstatic expression.  The fix is simply to
condition the call to Update_Choices on whether the choice expression
is static.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Container_Aggr_Code.Build_Size_Expr): In the case
	of an association with a single choice, only call Update_Choices when
	the choice expression is nonstatic.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The compiler blows up on a container aggregate with a container element
association that has a key_choice given by a nonstatic key expression.
This happens in the size computation for the aggregate due to calling
Update_Choices with the nonstatic expression.  The fix is simply to
condition the call to Update_Choices on whether the choice expression
is static.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Container_Aggr_Code.Build_Size_Expr): In the case
	of an association with a single choice, only call Update_Choices when
	the choice expression is nonstatic.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Compiler crash on container aggregate with constant element choice</title>
<updated>2025-09-09T12:39:51+00:00</updated>
<author>
<name>Gary Dismukes</name>
<email>dismukes@adacore.com</email>
</author>
<published>2025-07-25T20:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=3921122c0f26c4bbd95ffd63969531e86496bd5c'/>
<id>3921122c0f26c4bbd95ffd63969531e86496bd5c</id>
<content type='text'>
The compiler fails when compiling a container aggregate with
an element association with a key choice that denotes a constant
object.  The code for getting the value of the choice was only
accounting for the possibility of integer and enumeration literals,
and is corrected to handle static expressions generally.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Replace existing
	conditional expression with call to Expr_Value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The compiler fails when compiling a container aggregate with
an element association with a key choice that denotes a constant
object.  The code for getting the value of the choice was only
accounting for the possibility of integer and enumeration literals,
and is corrected to handle static expressions generally.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Replace existing
	conditional expression with call to Expr_Value.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Use-before-definition of a component of discriminated aggregate's itype.</title>
<updated>2025-07-24T08:52:37+00:00</updated>
<author>
<name>Steve Baird</name>
<email>baird@adacore.com</email>
</author>
<published>2025-07-11T21:40:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=1409e64e870a32eedce096d4e800e7a4a2f7ab79'/>
<id>1409e64e870a32eedce096d4e800e7a4a2f7ab79</id>
<content type='text'>
In some cases involving assigning an aggregate to a formal parameter of
an unconstrained discriminated subtype that has a Dynamic_Predicate, and where
the discriminated type also has a component of an unconstrained discriminated
subtype, the front end generates a malformed tree which causes a compilation
failure when the backend fails a consistency check.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Convert_To_Assignments): Add calls to Ensure_Defined
	before generating assignments to components that could be
	associated with a not-yet-defined itype.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some cases involving assigning an aggregate to a formal parameter of
an unconstrained discriminated subtype that has a Dynamic_Predicate, and where
the discriminated type also has a component of an unconstrained discriminated
subtype, the front end generates a malformed tree which causes a compilation
failure when the backend fails a consistency check.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Convert_To_Assignments): Add calls to Ensure_Defined
	before generating assignments to components that could be
	associated with a not-yet-defined itype.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Additional condition for Capacity discriminant on bounded container aggregates</title>
<updated>2025-07-22T08:35:15+00:00</updated>
<author>
<name>Gary Dismukes</name>
<email>dismukes@adacore.com</email>
</author>
<published>2025-07-07T20:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=cdbd7946acc884901c06ec40162e47923d941f12'/>
<id>cdbd7946acc884901c06ec40162e47923d941f12</id>
<content type='text'>
This change test an additional condition as part of the criteria used
for deciding whether to generate a call to a container type's Length
function (for passing to the Empty function) when determining the
size of the object to allocate for a bounded container aggregate
with a "for of" iterator.

An update is also made to function Empty in Ada.Containers.Bounded_Hash_Maps,
adding a default to the formal Capacity, to make it consistent with other
bounded containers (and to make it conformant with the Ada RM).

gcc/ada/ChangeLog:

	* libgnat/a-cbhama.ads (Empty): Add missing default to Capacity formal.
	* libgnat/a-cbhama.adb (Empty): Add missing default to Capacity formal.
	* exp_aggr.adb (Build_Size_Expr): Test for presence of Capacity
	discriminant as additional criterion for generating the call to
	the Length function. Update comments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change test an additional condition as part of the criteria used
for deciding whether to generate a call to a container type's Length
function (for passing to the Empty function) when determining the
size of the object to allocate for a bounded container aggregate
with a "for of" iterator.

An update is also made to function Empty in Ada.Containers.Bounded_Hash_Maps,
adding a default to the formal Capacity, to make it consistent with other
bounded containers (and to make it conformant with the Ada RM).

gcc/ada/ChangeLog:

	* libgnat/a-cbhama.ads (Empty): Add missing default to Capacity formal.
	* libgnat/a-cbhama.adb (Empty): Add missing default to Capacity formal.
	* exp_aggr.adb (Build_Size_Expr): Test for presence of Capacity
	discriminant as additional criterion for generating the call to
	the Length function. Update comments.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Replace "not Present" test with "No" test</title>
<updated>2025-07-22T08:35:14+00:00</updated>
<author>
<name>Gary Dismukes</name>
<email>dismukes@adacore.com</email>
</author>
<published>2025-07-02T21:57:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=9ffa0e4301deccce77cc377e27fa510736bb1fb7'/>
<id>9ffa0e4301deccce77cc377e27fa510736bb1fb7</id>
<content type='text'>
Minor change to satisfy GNAT SAS checker.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Size_Expr): Change test of "not Present (...)"
	to "No (...)".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Minor change to satisfy GNAT SAS checker.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Size_Expr): Change test of "not Present (...)"
	to "No (...)".
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Capacity determination for container aggregate with container iterator</title>
<updated>2025-07-22T08:35:14+00:00</updated>
<author>
<name>Gary Dismukes</name>
<email>dismukes@adacore.com</email>
</author>
<published>2025-07-02T21:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=2bcb3683f3b468dae3cd586db95ceb234cf6c98f'/>
<id>2bcb3683f3b468dae3cd586db95ceb234cf6c98f</id>
<content type='text'>
In the case of a container aggregate that has a container_element_association
given by an iterator_specification that iterates over a container object
(for example, "[for E of V =&gt; E]"), the compiler will now determine the
number of elements in the object and can use that in determining the capacity
value to be passed to the container type's Empty function when allocating
space for the aggregate object.  This implementation-dependent behavior
is allowed by RM22 4.3.5(40/5).

Prior to this enhancement, the compiler would generally use the Empty
function's default value for the Capacity parameter (a value of just
10 in the current implementation of the predefined containers), which
could easily lead to Capacity_Error being raised for the aggregate.

Note that this is only done for aggregates of container types coming
from instantiations of the predefined container generics, and not for
user-defined container types (due to the special knowledge the compiler
has of the availability of Length functions for the predefined types).
Also, it currently only applies when the object V being iterated over
is a simple object, and is not done for more complex cases, such as
when V is a function call.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Size_Expr): Determine the length of a container
	aggregate association in the case where it's an iteration over an
	object of a container type coming from an instantiation of a predefined
	container generic. Minor updates to existing comments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case of a container aggregate that has a container_element_association
given by an iterator_specification that iterates over a container object
(for example, "[for E of V =&gt; E]"), the compiler will now determine the
number of elements in the object and can use that in determining the capacity
value to be passed to the container type's Empty function when allocating
space for the aggregate object.  This implementation-dependent behavior
is allowed by RM22 4.3.5(40/5).

Prior to this enhancement, the compiler would generally use the Empty
function's default value for the Capacity parameter (a value of just
10 in the current implementation of the predefined containers), which
could easily lead to Capacity_Error being raised for the aggregate.

Note that this is only done for aggregates of container types coming
from instantiations of the predefined container generics, and not for
user-defined container types (due to the special knowledge the compiler
has of the availability of Length functions for the predefined types).
Also, it currently only applies when the object V being iterated over
is a simple object, and is not done for more complex cases, such as
when V is a function call.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Size_Expr): Determine the length of a container
	aggregate association in the case where it's an iteration over an
	object of a container type coming from an instantiation of a predefined
	container generic. Minor updates to existing comments.
</pre>
</div>
</content>
</entry>
<entry>
<title>ada: Improved support for mutably tagged types</title>
<updated>2025-07-22T08:19:29+00:00</updated>
<author>
<name>Steve Baird</name>
<email>baird@adacore.com</email>
</author>
<published>2025-06-13T20:53:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=574bdf8e2150df4527e4ae054381caa6e22a227b'/>
<id>574bdf8e2150df4527e4ae054381caa6e22a227b</id>
<content type='text'>
Fix bugs related to mutably tagged types in streaming operations, Put_Image
attributes, aggregates, composite equality comparisons with mutably-tagged
components, and other issues.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Record_Aggr_Code.Gen_Assign): In the case of
	an aggregate component where the component type is mutably tagged
	and the component value is provided by a qualified aggregate (and
	qualified with a specific type), avoid incorrectly rejecting the
	inner aggregate for violating the rule that the type of an
	aggregate shall not be class-wide.
	* exp_attr.adb: For a predefined streaming operation (i.e., Read,
	Write, Input, or Output) of a class-wide type, the external name
	of the tag of the value is normally written out by Output and read
	in by Input. In the case of a mutably tagged type, this is instead
	done in Write and Read.
	* exp_ch4.adb (Expand_Composite_Equality): In the case of an
	equality comparison for a type having a mutably tagged component,
	we want the component comparison to compare two values of the
	mutably tagged type, not two values of the corresponding
	array-of-bytes-ish representation type. Even if there are no
	user-defined equality functions anywhere in sight, comparing the
	array values still doesn't work because undefined bits may end up
	participating in the comparison (resulting in an incorrect result
	of False).
	* exp_put_image.adb: In the case of a class-wide type, the
	predefined Image attribute includes the name of the specific type
	(and a "'" character, to follow qualified expression syntax) to
	indicate the tag of the value. With the introduction of mutably
	tagged types, this case can now arise in the case of a component
	(of either an enclosing array or an enclosing record), not just
	for a top-level object. So we factor the code to do this into a
	new procedure, Put_Specific_Type_Name_Qualifier, so that it can be
	called from more than one place. This reorganization also involves
	replacing the procedure Put_String_Exp with a new procedure,
	Put_String_Exp_To_Buffer, declared in a less nested scope. For
	mutably tagged components (at the source level) the component type
	(at the GNAT tree level) is an array of bytes (actually a two
	field record containing an array of bytes, but that's a detail).
	Appropriate conversions need to be generated so that we don't end
	up generating an image for an array of bytes; this is done at the
	same places where Put_Specific_Type_Name_Qualifier is called
	(for components) by calling Make_Mutably_Tagged_Conversion.
	* exp_strm.adb (Make_Field_Attribute): Add
	Make_Mutably_Tagged_Conversion call where we construct a
	Selected_Component node and the corresponding component type is
	the internal representation type for a mutably tagged type.
	(Stream_Base_Type): Return the mutably
	tagged type if given the corresponding internal representation type.
	* sem_ch3.adb (Array_Type_Declaration): In the case where the
	source-level component type of an array type is mutably tagged,
	set the Component_Type field of the base type of the declared
	array type (as opposed to that of the first subtype of the array
	type) to the corresponding internal representation type.
	* sem_ch4.adb (Analyze_Selected_Component): In the case of a
	selected component name which references a component whose type is
	the internal representation type of a mutably tagged type,
	generate a conversion to the mutably tagged type.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix bugs related to mutably tagged types in streaming operations, Put_Image
attributes, aggregates, composite equality comparisons with mutably-tagged
components, and other issues.

gcc/ada/ChangeLog:

	* exp_aggr.adb (Build_Record_Aggr_Code.Gen_Assign): In the case of
	an aggregate component where the component type is mutably tagged
	and the component value is provided by a qualified aggregate (and
	qualified with a specific type), avoid incorrectly rejecting the
	inner aggregate for violating the rule that the type of an
	aggregate shall not be class-wide.
	* exp_attr.adb: For a predefined streaming operation (i.e., Read,
	Write, Input, or Output) of a class-wide type, the external name
	of the tag of the value is normally written out by Output and read
	in by Input. In the case of a mutably tagged type, this is instead
	done in Write and Read.
	* exp_ch4.adb (Expand_Composite_Equality): In the case of an
	equality comparison for a type having a mutably tagged component,
	we want the component comparison to compare two values of the
	mutably tagged type, not two values of the corresponding
	array-of-bytes-ish representation type. Even if there are no
	user-defined equality functions anywhere in sight, comparing the
	array values still doesn't work because undefined bits may end up
	participating in the comparison (resulting in an incorrect result
	of False).
	* exp_put_image.adb: In the case of a class-wide type, the
	predefined Image attribute includes the name of the specific type
	(and a "'" character, to follow qualified expression syntax) to
	indicate the tag of the value. With the introduction of mutably
	tagged types, this case can now arise in the case of a component
	(of either an enclosing array or an enclosing record), not just
	for a top-level object. So we factor the code to do this into a
	new procedure, Put_Specific_Type_Name_Qualifier, so that it can be
	called from more than one place. This reorganization also involves
	replacing the procedure Put_String_Exp with a new procedure,
	Put_String_Exp_To_Buffer, declared in a less nested scope. For
	mutably tagged components (at the source level) the component type
	(at the GNAT tree level) is an array of bytes (actually a two
	field record containing an array of bytes, but that's a detail).
	Appropriate conversions need to be generated so that we don't end
	up generating an image for an array of bytes; this is done at the
	same places where Put_Specific_Type_Name_Qualifier is called
	(for components) by calling Make_Mutably_Tagged_Conversion.
	* exp_strm.adb (Make_Field_Attribute): Add
	Make_Mutably_Tagged_Conversion call where we construct a
	Selected_Component node and the corresponding component type is
	the internal representation type for a mutably tagged type.
	(Stream_Base_Type): Return the mutably
	tagged type if given the corresponding internal representation type.
	* sem_ch3.adb (Array_Type_Declaration): In the case where the
	source-level component type of an array type is mutably tagged,
	set the Component_Type field of the base type of the declared
	array type (as opposed to that of the first subtype of the array
	type) to the corresponding internal representation type.
	* sem_ch4.adb (Analyze_Selected_Component): In the case of a
	selected component name which references a component whose type is
	the internal representation type of a mutably tagged type,
	generate a conversion to the mutably tagged type.
</pre>
</div>
</content>
</entry>
</feed>
