I think i've found a bug, should / how do i report it.

Don Clugston dac at nospam.com.au
Mon Mar 12 08:25:39 PDT 2007


Chris Warwick wrote:
> "Derek Parnell" <derek at psych.ward> wrote in message 
> news:1898vpzduavha.1b2w76ic8zmeg.dlg at 40tude.net...
>> On Mon, 12 Mar 2007 01:43:34 -0000, Chris Warwick wrote:
>>
>>> Apologys for the previous jibberish.. i've been on honeymoon with D for 
>>> the
>>> last 4 days and havn't had much sleep lol.. So the problem is still there 
>>> i
>>> just wrote out the examples wrong.. getting my movd's and movq's all 
>>> mixed
>>> up.. Anyway copy and past this time so i dont feck up...
>>>
>>> private ulong MMXZERO = 0x0;
>>>     movq       MM0,MMXZERO;
>>>
>>> compiles fine, as expected.
>>>
>>> But the addition of 'const'
>>>
>>> private const ulong MMXZERO = 0x0;
>>>     movq       MM0,MMXZERO;
>>>
>>> causes "bad type/size of operands 'movq'"
>>>
>>> cheers
>>>
>>> cw
>> The MMX instruction 'movq' requires that the source/destination is either
>> MMX register or an address of a 64-bit value, except that both can't be
>> addresses. I believe that the DMD compile optimizes the 'const' value to 
>> be
>> a literal zero so you end up with ...
>>
>>   movq, MM0,0x0
>>
>> which is not allowed.
> 
> Should it really be optimizing typed constants like that, especialy with 
> asm?
> 
> is it worth me bring this issue up somewhere?
> 
> cheers,
> 
> cw

'const' doesn't mean the same as in C++. A const is a constant, not a 
variable. You cannot take the address of a const; in many ways it's more 
like a #define. In theory, the const may not even be allocated any 
storage space at all in the final executable. (In practice, I think it 
always is, but I hope that changes eventually).




More information about the Digitalmars-d-learn mailing list