> > 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.
That's exactly the reason why gnat.dg/memtrap.adb started to fail after Jeff's patch went it. So, if -fisolate-erroneous-paths isn't amended, we'll need to disable it in Ada like in Go. > 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). This would probably work for Ada as well. -- Eric Botcazou