824 – "mov EAX, func;" and "lea EAX, func;" generate incorrect code

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 824 - "mov EAX, func;" and "lea EAX, func;" generate incorrect code
Summary: "mov EAX, func;" and "lea EAX, func;" generate incorrect code
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P3 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2007年01月09日 09:16 UTC by Thomas Kühne
Modified: 2014年02月15日 13:13 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2007年01月09日 09:16:20 UTC
# void foo(){}
# 
# void bar(){
# asm{
# mov ECX, foo;
# lea EDX, foo;
# }
# }
DMD-1.00 generates the following code for bar:
804a0c4:	55	push	ebp
804a0c5:	8b ec	mov	ebp,esp
804a0c7:	8b 00	mov	eax,DWORD PTR [eax]
804a0c9:	8b c0	mov	eax,eax
804a0cb:	5d	pop	ebp
804a0cc:	c3	ret
Comment 1 Walter Bright 2007年01月27日 18:56:26 UTC
Fixed DMD 1.001
Comment 2 Thomas Kühne 2007年02月15日 03:42:09 UTC
Added to DStress as
http://dstress.kuehne.cn/run/a/asm_lea_02_A.d
http://dstress.kuehne.cn/run/a/asm_mov_04_A.d 


AltStyle によって変換されたページ (->オリジナル) /