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

Bernd Schmidt bschmidt@redhat.com
Tue Sep 15 09:20:00 GMT 2015

On 09/14/2015 11:56 AM, Eric Botcazou wrote:

> 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.

Does this improve debugging, or is it necessary to have the restores 

> 2015-09-14  Eric Botcazou  <ebotcazou@adacore.com>
> 	* gnat.dg/array24.adb: New test.

How do I compile Ada tests, analogously to "./cc1 tst.c"? I get the 

./gnat1 tst.adb
fatal error, run-time library not installed correctly
cannot locate file system.ads
compilation abandoned


More information about the Gcc-patches mailing list