[patch] Get rid of useless EH cleanups at -O0

Eric Botcazou ebotcazou@adacore.com
Mon Sep 14 09:57:00 GMT 2015


Hi,

this patchlet makes it possible to get rid of useless EH cleanups generated at 
-O0 in Ada for simple constructs involving VLAs:

  declare
    S : String (1 .. N);
  begin
    ...
  end;

by duplicating finally blocks that contain only a stack restore.  Then the EH 
optimization machinery (which is also run at -O0) can remove the cleanups.

Tested on x86_64-suse-linux, OK for the mainline?


2015-09-14  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-eh.c (lower_try_finally_dup_block): Clear location information
	on stack restore statements.
	(decide_copy_try_finally): Do not consider a stack restore statement as
	coming from sources.


2015-09-14  Eric Botcazou  <ebotcazou@adacore.com>

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

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 1391 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150914/6a9105b8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: array24.adb
Type: text/x-adasrc
Size: 257 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150914/6a9105b8/attachment-0001.bin>


More information about the Gcc-patches mailing list