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: [PATCH] Set correct source location for deallocator calls


On 08/08/2012 09:27 AM, Dehao Chen wrote:
> On Wed, Aug 8, 2012 at 8:56 AM, Richard Henderson <rth@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~


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