On Wed, Jun 13, 2012 at 1:08 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
>> +@item -fdelete-dead-exceptions
>> +@opindex fdelete-dead-exceptions
>> +Assume that statements that may raise exceptions but don't otherwise
>> contribute +to the execution of the program can be optimized away.
>> +
>> This flag is set by the frontends according to their language
>> specification. Passes that cause dead exceptions to be removed are enabled
>> independently at different optimization levels.
>>
>> and be done with that.
>
> OK, will make the change.
>
>> Btw, what is "doesn't otherwise contribute to the execution"?
>> That is, is the Ada equivalent of
>>
>>  try { a / maybe_zero; } catch (...) { printf ("maybe_zero was zero!"); }
>>
>> dead code?
>
> Essentially, yes.  There is a special permission to optimize it away if the
> result of the division isn't used.
>
>> Btw, I suppose you need to arrange to properly transfer the flag for LTO
>> in some way (well, or conservatively not remove dead exceptions at
>> link-time).
>
> I can add a flag in 'struct function' next to can_throw_non_call_exceptions.

Not sure if it's worth it though, is it?  This can be done as a followup anyway.

The patch is otherwise ok.

Thanks,
Richard.

> --
> Eric Botcazou

Reply via email to