[Ada] Do not generate dangling references to bounds

Eric Botcazou ebotcazou@adacore.com
Mon May 27 11:13:00 GMT 2019


This prevents gigi from generating dangling references to the bounds of an 
aliased parameter of an unconstrained array type.  This cannot happen in 
strict Ada but you can bypass the rules by means of 'Unchecked_Access.

Tested on x86_64-suse-linux, applied on the mainline and 9 branch.


2019-05-27  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
	(gnat_to_gnu): Do not convert the result if it is a reference to an
	unconstrained array used as the prefix of an attribute reference that
	requires an lvalue.


2019-05-27  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/aliased2.adb: New test.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 2519 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190527/8d42c0dc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aliased2.adb
Type: text/x-adasrc
Size: 376 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190527/8d42c0dc/attachment-0001.bin>


More information about the Gcc-patches mailing list