On Mon, Mar 5, 2012 at 12:01 AM, Uros Bizjak <ubiz...@gmail.com> wrote:
> On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>>> @@ -11388,6 +11400,11 @@ ix86_decompose_address (rtx addr, struct
>>> ix86_address *out)
>>> disp = addr; /* displacement */
>>> + /* Since address override works only on the (reg) part in fs:(reg),
>>> + we can't use it as memory operand. */
>>> + if (Pmode != word_mode && seg == SEG_FS && (base || index))
>>> + return 0;
>>> Can you explain the above some more? IMO, if the override works on
>>> (reg) part, this is just what we want.
>> When Pmode == SImode, we have
>> fs segment register == 0x1001
>> base register (SImode) == -1 (0xffffffff).
>> We are expecting address to be 0x1001 - 1 == 0x1000. But, what we get
>> is 0x1000 + 0xffffffff, not 0x1000 since 0x67 address prefix only applies to
>> base register to zero-extend 0xffffffff to 64bit.
> I would call this a bug in the specification - I guess that
> 0x1001(%eax) works correctly.
This is how hardware works.
> We will treat this issue as a bug.
I also was surprised by this behavior.