On 08/08/2012 09:27 AM, Dehao Chen wrote: > On Wed, Aug 8, 2012 at 8:56 AM, Richard Henderson <r...@redhat.com> wrote: >> On 08/07/2012 06:25 AM, Richard Guenther wrote: >>> (is re-setting _every_ stmt location really ok in all cases?) >> >> I'm certain that it's not, though you can't tell that from C++. >> >> Examine instead a Java test case using try-finally. In Java the >> contents of the finally would be incorrectly relocated from their >> original source line to the new line Dehao has decided upon. > > This makes sense. I was thinking what else can reside in the finally > block, and apparently I was ignoring Java... > >> >> I can see the desire for wanting the call to ~t() to appear from >> the return statement. And for C++ we'll get the correct lines for >> the contents of ~t() post inlining (which happens after tree-eh). > > Even if inline gives it right source position, it'll still have > incorrect inline stack. > >> >> But unless the C++ front end uses something like UNKNOWN_LOCATION >> on the destructor call, I don't see how we can tell the Java and >> C++ cases apart. And if we can't, then I don't think we can make >> this change at all. > > Then we should probably assign UNKNOWN_LOCATION for these destructor > calls, what do you guys think?
I think it's certainly plausible. I can't think what other problems such a change would cause. Jason? r~