This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Print SImode register names to force addr32 prefix


On Fri, Nov 9, 2012 at 10:17 AM, H.J. Lu <hjl.tools@gmail.com> wrote:

> Since x32 runs in 64-bit mode, for address -0x40000300(%rax), hardware
> sign-extends displacement from 32-bits to 64-bits and adds it to %rax.
> But x32 wants 32-bit -0x40000300, not 64-bit -0x40000300.  This patch
> uses 32-bit registers instead of 64-bit registers when displacement
> < -16*1024*1024.  -16*1024*1024 is used instead of 0 so that we will
> still generate -16(%rsp) instead of -16(%esp).
>
> Tested it on Linux/x32.  OK to install?

This problem uncovers a bug in the middle-end, so I guess it would be
better to fix it there.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]