On 26/11/15 21:21, David Holmes wrote: > Strictly speaking it is of course reachable, but if we do reach it we > expect never to return. As per the thread Mario pointed to we ran into > problems trying to mark this as not returning. But I wonder whether > lying to the compiler about the reachability of it would be a > workaround? Of course if the compiler used that information to elide the > ShouldNotReachHere() then that is not acceptable.
I've put the unreachable declaration after ShouldNotReachHere(), so that will not be affected at all. It is the responsibility of ShouldNotReachHere() to make sure that control doesn't, er, reach here. A __builtin_unreachable declration is better from this point of view than declaring ShouldNotReachHere() to never return. On April 20 Mikael Gerdin posted http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-April/018093.html It claims to solve the problems with the stack trace. I think it's not been reviewed. Andrew.
