Bug 19528 – asm ptoblem

Status
NEW
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-12-30T20:50:14Z
Last change time
2024-12-13T19:01:47Z
Keywords
iasm, pull
Assigned to
No Owner
Creator
steven kladitis
Moved to GitHub: dmd#19521 →

Attachments

IDFilenameSummaryContent-TypeSize
1721Bitcoin_address_validation.ddoes notc cimpile witjh -O -inlinetext/plain15984

Comments

Comment #0 by steven_kladitis — 2018-12-30T20:50:14Z
the following code compiles in 32 ,but not in 64 bit. int main() { import std.stdio; long i; asm { mov EAX,10; add EAX,20; mov i,EAX; } writeln(i," ",i.sizeof); return 0; } -- in 32 bit I get --> 30 8 in 64 bit it gets length error at lc:\rosetta>dmd -m64 machine_code.d machine_code.d(14): Error: bad type/size of operands mov -- commint out the move instruction I get ==> 0 8 the size of 'i' and 'EAX' are the same in both. This is in -> DMD32 D Compiler v2.084.0-rc.1
Comment #1 by steven_kladitis — 2018-12-30T20:55:32Z
Created attachment 1721 does notc cimpile witjh -O -inline this compiles instantly in DMD32 D Compiler v2.084.0-rc.1 with --> dmd -O but the compiler sits forever in compile with -> dmd -O -inline
Comment #2 by steven_kladitis — 2018-12-30T20:57:23Z
this on windows 64 bit. 32g RAM AND DMD32 D Compiler v2.084.0-rc.1
Comment #3 by steven_kladitis — 2018-12-30T21:14:36Z
i do not know how I made this one issue, but it should be two. 1. for the asm 2. for the dmd -O -inline.
Comment #4 by iamthewilsonator — 2019-01-07T03:46:48Z
EAX is 32 bits ib size, a long is 64, I'm surprised the 32-bit one compiles to be honest. The hang with -O -inline is not good though.
Comment #5 by maxhaton — 2022-05-20T18:56:58Z
This doesn't hang anymore, but it shouldn't compile in 32 bit mode. X86 doesn't have a mov m64, r32 instruction.
Comment #6 by dlang-bot — 2022-05-21T00:42:05Z
@maxhaton created dlang/dmd pull request #14152 "Fix Issues 23130, 19528 : Inline asm was too liberal about operand si…" fixing this issue: - Fix Issues 23130, 19528 : Inline asm was too liberal about operand sizes. A 8-byte type was only considered 8 bytes in 64 bit code, for some reason. This led to inconsistent compilation of extended asm. I tried to add an error message suggesting the use of an instruction like movsx but this code is spaghetti. https://github.com/dlang/dmd/pull/14152
Comment #7 by robert.schadek — 2024-12-13T19:01:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19521 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB