[Issue 18553] New: Inline assembler: CR2, CR3 control registers not available in 64-bit code
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 4 19:25:28 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18553
Issue ID: 18553
Summary: Inline assembler: CR2, CR3 control registers not
available in 64-bit code
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: jonfandrew at gmail.com
The following code fails to compile in 64-bit mode, even though CR2 and CR3
become 64-bit registers in 64-bit code.
void main()
{
size_t faultAddress;
asm
{
mov RAX, CR2;
mov faultAddress[RBP], RAX;
}
}
The equivalent 32-bit code compiles fine when using dmd -m32:
void main()
{
size_t faultAddress;
asm
{
mov EAX, CR2;
mov faultAddress[EBP], EAX;
}
}
I think adding CR2 and CR3 to the regtab64 array in iasm.d will correct the
problem, but I'm not super smart on the compiler internals and didn't want to
embarrass myself with an ignorant PR.
-Doc
--
More information about the Digitalmars-d-bugs
mailing list