On Mon, Nov 11, 2013 at 9:41 AM, Eric Botcazou <ebotca...@adacore.com> wrote:
>> But throw what?  It is up to the runtimes of -fnon-call-exceptions languages
>> to decide if they actually want to throw or do something else in the signal
>> handlers, and what exactly to throw.
>
> Throw nothing per se, __builtin_throw would simply trap and ensure that the
> exception thrown by the signal handlers can be handled properly, i.e. it would
> be recognized by the exception machinery of the compiler as throwing.

Sorry, I don't understand what you are proposing.

Simply trapping doesn't tell you anything about caused the trap.
There are at least two distinct possibilities: NULL pointer
dereference and integer division by zero.  There should be some way to
distinguish those two cases.  It's reasonably easy to do so in a
signal handler.  When should we do if the compiler generate a call to
__builtin_throw?

Since I probably misunderstand, let me ask it a different way.  Let's
say there is code that the compiler can prove will dereference a NULL
pointer.  What should the compiler generate for that case?

Ian

Reply via email to