[Issue 1140] ICE(cod1.c) casting last function parameter to 8 byte value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 7 23:58:14 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1140
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #5 from Don <clugdbug at yahoo.com.au> 2009-10-07 23:58:13 PDT ---
This seems to be a superficial ICE. It only happens in this wierd situation,
when a parameter, which was passed in a register, needs to be stored into a
double-register (EDX:EAX).
In this case, the existing register can't be re-used, even though it satisfies
all the conditions in cod1 line 3433.
We simply need to add an extra condition to prevent the register being
re-used.After this simple change, correct code is generated instead of the ICE.
I think this case never occurs in the calling conventions used in DMC.
Of course, taking the address of an parameter, then casting it to the wrong
size is a highly dubious thing
to be doing, since it's getting whatever happens to be on the stack. Unsafe
mode only!
PATCH (against DMD2.033) cod1.c, line 3434:
// See if we can use register that parameter was passed in
if (regcon.params && e->EV.sp.Vsym->Sclass == SCfastpar &&
- regcon.params & mask[e->EV.sp.Vsym->Spreg])
+ regcon.params & mask[e->EV.sp.Vsym->Spreg] && sz!=REGSIZE*2)
{ assert(sz <= REGSIZE);
reg = e->EV.sp.Vsym->Spreg;
forregs = mask[reg];
mfuncreg &= ~forregs;
regcon.used |= forregs;
return fixresult(e,forregs,pretregs);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list