On Wed, Nov 6, 2013 at 4:20 PM, Ian Lance Taylor <i...@google.com> wrote: > On Wed, Nov 6, 2013 at 7:15 AM, Richard Biener > <richard.guent...@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). Richard. > Ian