[Ada] Fix compiler crash on function returning array at -O

Eric Botcazou ebotcazou@adacore.com
Tue May 28 08:26:00 GMT 2019


This is a regression present on all active branches.  The compiler segfaults 
on a function returning an array variable declared locally and used in a 
grandchild function but not in its parent function (which is a child of the 
first function).

Tested on x86_64-suse-linux, applied on all active branches.


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

	* gcc-interface/trans.c (walk_nesting_tree): New static function.
	(finalize_nrv): Use it to walk the entire nesting tree.


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

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

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt79.ads
Type: text/x-adasrc
Size: 111 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190528/f2b18bda/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt79.adb
Type: text/x-adasrc
Size: 362 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190528/f2b18bda/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 1735 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190528/f2b18bda/attachment-0002.bin>


More information about the Gcc-patches mailing list