[Issue 23418] New: double argument is passed on stack, but assumed to be in XMM0 register
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 16 02:05:54 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23418
Issue ID: 23418
Summary: double argument is passed on stack, but assumed to be
in XMM0 register
Product: D
Version: D2
Hardware: x86
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
bool test_eqz(double x) { return x == 0; }
int abc(int i)
{
test_eqz(123);
return 2;
}
compiled with -m32 -O yields:
_D5test38test_eqzFfZb:
xorps XMM1,XMM1
ucomiss XMM1,XMM0 <--- XMM0 should be loaded from stack!
jp LA
je LE
LA: xor EAX,EAX
jmp short L13
LE: mov EAX,1
L13: ret 4 <--- correctly popped from stack
add [EAX],AL
_D5test33abcFiZi:
sub ESP,018h
movss XMM0,_D5test312__ModuleInfoZ at SYM32[03h]
sub ESP,4
movss [ESP],XMM0 <--- XMMO passed on stack!
call _D5test38test_eqzFfZb at PC32
add ESP,0Ch
add ESP,0Ch
mov EAX,2
ret
--
More information about the Digitalmars-d-bugs
mailing list