www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Issue 5689

reply James Miller <james aatch.net> writes:
Hey,

Whats the word on this issue:

http://d.puremagic.com/issues/show_bug.cgi?id=5689

Its kinda killing my ability to profile my code here, since the
program is no longer valid when compiled with -profile.

--
James Miller
Mar 15 2012
next sibling parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
"James Miller" <james aatch.net> wrote in message 
news:mailman.693.1331810915.4860.digitalmars-d puremagic.com...
 Hey,

 Whats the word on this issue:

 http://d.puremagic.com/issues/show_bug.cgi?id=5689

 Its kinda killing my ability to profile my code here, since the
 program is no longer valid when compiled with -profile.

 --
 James Miller

Yum, looks like another xmm codegen bug. I'll add it to my todo list.
Mar 15 2012
prev sibling next sibling parent reply James Miller <james aatch.net> writes:
On 16 March 2012 03:00, Daniel Murphy <yebblies nospamgmail.com> wrote:
 "James Miller" <james aatch.net> wrote in message
 news:mailman.693.1331810915.4860.digitalmars-d puremagic.com...
 Hey,

 Whats the word on this issue:

 http://d.puremagic.com/issues/show_bug.cgi?id=3D5689

 Its kinda killing my ability to profile my code here, since the
 program is no longer valid when compiled with -profile.

 --
 James Miller

Yum, looks like another xmm codegen bug. =C2=A0I'll add it to my todo lis=


Out of curiosity, what does -profile do that could cause this bug? Seems like an odd cause, since in my specific case, I don't even get an error, just crazy values, -2^31 to ~10^38, in later calculations -- James Miller
Mar 15 2012
parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
"James Miller" <james aatch.net> wrote in message 
news:mailman.707.1331841671.4860.digitalmars-d puremagic.com...
 Out of curiosity, what does -profile do that could cause this bug?
 Seems like an odd cause, since in my specific case, I don't even get
 an error, just crazy values, -2^31 to ~10^38, in later calculations

 --
 James Miller

IIRC the code that actually does -profile is in the backend, and is done with very low-level calls. Inserting calls can change the register usage patterns, interfere with cse elimination, etc. I assume this is what is happening, and with x64 and doubles that mean xmm codegen, which is still relatively new and buggy. Could you post the disassembly? (with intel syntax please) It might be possible to work around it by changing the calling convention of uniform and/or the functions it calls.
Mar 15 2012
prev sibling parent reply James Miller <james aatch.net> writes:
On 16 March 2012 14:36, Daniel Murphy <yebblies nospamgmail.com> wrote:
 "James Miller" <james aatch.net> wrote in message
 news:mailman.707.1331841671.4860.digitalmars-d puremagic.com...
 Out of curiosity, what does -profile do that could cause this bug?
 Seems like an odd cause, since in my specific case, I don't even get
 an error, just crazy values, -2^31 to ~10^38, in later calculations

 --
 James Miller

IIRC the code that actually does -profile is in the backend, and is done with very low-level calls. =C2=A0Inserting calls can change the register =

 patterns, interfere with cse elimination, etc. =C2=A0I assume this is wha=

 happening, and with x64 and doubles that mean xmm codegen, which is still
 relatively new and buggy.

 Could you post the disassembly? (with intel syntax please)

 It might be possible to work around it by changing the calling convention=

 uniform and/or the functions it calls.

My code uses floats, so I just tested using floats instead of doubles and while I don't get the error, I do get incorrect values. I'll post the code I used and the disassembly to bugzilla. -- James Miller
Mar 15 2012
parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
"James Miller" <james aatch.net> wrote in message 
news:mailman.744.1331866908.4860.digitalmars-d puremagic.com...

 My code uses floats, so I just tested using floats instead of doubles
 and while I don't get the error, I do get incorrect values. I'll post
 the code I used and the disassembly to bugzilla.

 --
 James Miller

It might be worth trying it against this patch: https://github.com/D-Programming-Language/dmd/pull/769 On the off chance that I've already fixed it.
Mar 15 2012