This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA][PATCH] Isolate erroneous paths optimization


On 11/06/13 08:23, Richard Biener wrote:
On Wed, Nov 6, 2013 at 4:20 PM, Ian Lance Taylor <iant@google.com> wrote:
On Wed, Nov 6, 2013 at 7:15 AM, Richard Biener
<richard.guenther@gmail.com> wrote:

But I think that you cannot transform

foo ()
{
   *0 = 1;
}

to __builtin_trap as you can catch the trap via an exception handler
in a caller of foo, no?

That is true.  OK, I can see an argument that when using
-fnon-call-exceptions that kind of code should not be changed to call
__builtin_trap.

In that case I think it would be fine to run the isolate paths
optimization, but to not omit the actual dereference of the NULL
pointer (possibly the dereference could be followed by a trap).

Yeah, we need the trap to properly end the BB (even if that is a
waste instruction generated).
Right. We *really* don't want execution to continue. We've entered an undefined state and continuing execution can lead to all kinds of nasty problems, including security exploits.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]