Bug 4610 – std.bigint not working on OSX

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-09T21:37:00Z
Last change time
2010-08-10T13:34:03Z
Keywords
wrong-code
Assigned to
nobody
Creator
clugdbug

Attachments

IDFilenameSummaryContent-TypeSize
709osxbug.dTest case for osxtext/plain5539
710osxbug.SDisassembly of osxbugapplication/octet-stream15526

Comments

Comment #0 by clugdbug — 2010-08-09T21:37:28Z
The Phobos unit tests are reported to fail. Seems to be a problem with the asm routines.
Comment #1 by clugdbug — 2010-08-10T00:20:12Z
Created attachment 709 Test case for osx It's impossible for me to fix this without help, as I don't have access to OSX. If you have access to OSX, please compile the attachment with $ dmd osxbug $ osxbug It should print: 13131325 56161622 8A8A8A94 Please report the output on OSX. Please also provide a disassembly of osxbug.obj, if possible.
Comment #2 by doob — 2010-08-10T02:32:44Z
Created attachment 710 Disassembly of osxbug
Comment #3 by doob — 2010-08-10T02:33:54Z
It prints "13131325 56161622 8A8A8A94" using both Mac OS X 10.5 and 10.6 with dmd v2.047
Comment #4 by clugdbug — 2010-08-10T03:00:38Z
Thanks! Looks like the compiler is not respecting 'naked'. It's inserting some kind of garbage at the top of the function! asm { naked; push ESI; push EDI; push EBX; push EBP; _D6osxbug25__T15multibyteMulAddVa43Z15multibyteMulAddFAkxAkkkZk: call L12D // ???? L12D: pop ECX // ???? mov -010h[EBP],ECX // WHAT ON EARTH WILL THIS DO??? push ESI push EDI push EBX push EBP
Comment #5 by bugzilla — 2010-08-10T12:23:19Z
The call/pop sequence is how the base address for static data is computed. Why it's there for naked functions, I don't know yet.
Comment #6 by bugzilla — 2010-08-10T13:34:03Z