[dmd-internals] non-PODs again

Johannes Pfau johannespfau at googlemail.com
Tue Mar 12 12:00:20 PDT 2013


Am 10.03.2013 07:20, schrieb Walter Bright:
>
> On 3/9/2013 2:18 AM, Johannes Pfau wrote:
>> Am 08.03.2013 19:54, schrieb Walter Bright:
>>>
>>> On 3/8/2013 4:40 AM, Johannes Pfau wrote:
>>>>
>>>> So please explain what's illegal in this concrete example #2.
>>>
>>> If it lives in a register, then exception handling recovery won't 
>>> work on it.
>> It only lives in the register for a very short time though.
>
> What's the point, then? The compiler will cache fields in registers 
> anyway.
The point is passing it in a register should be faster than passing it 
on the stack or even passing by reference.

However, thinking about it I found another issue which shows that we 
have to pass non-PODs (at least those with destructors) by reference. I 
filed a bug report for dmd here:

http://d.puremagic.com/issues/show_bug.cgi?id=9704

I also filed a bug report for gdc. Fixing will have to wait till the 
above bug is fixed though cause the fix may need frontend changes and 
without the above fix non-PODs can't be implemented in gdc because of 
gcc-specific details.
http://gdcproject.org/bugzilla/show_bug.cgi?id=42

-- 
Johannes Pfau



More information about the dmd-internals mailing list