[Ada] Fix crash on declaration of constant with discriminated type

Eric Botcazou ebotcazou@adacore.com
Sat Mar 26 11:13:00 GMT 2011


The compiler crashes on the declaration of a constant with discriminated record 
type and variable size, if the constant is initialized to an aggregate which 
assigns the length of an array with variable size to a discriminant.  The 
problem is again an incorrect sharing of a tree node between two types.

Tested on i586-suse-linux, applied on the mainline.


2011-03-26  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Create TYPE_DECL
	for the padded type built to support a specified size or alignment.


2011-03-26  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/discr27.ad[sb]: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 1199 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110326/f0942541/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: discr27.adb
Type: text/x-adasrc
Size: 583 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110326/f0942541/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: discr27.ads
Type: text/x-adasrc
Size: 75 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110326/f0942541/attachment-0002.bin>


More information about the Gcc-patches mailing list