This is the mail archive of the 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: i386/asm-4 test: use amd64's natural addressing mode on all OSs

On Aug 15, 2019, Uros Bizjak <> wrote:

> The immediate of lea is limited to +-2GB

... and we're talking about a code offset within a tiny translation
unit, with both reference and referenced address within the same
section.  It would be very surprising if the offset got up to 2KB, let
alone 2GB ;-)

The reason the testcase even mentions absolute addresses AFAICT is not
that it wishes to use them, it's that there's no portable way to use
PC-relative addresses on IA-32 (*), so the test gives up on platforms
that mandate PIC and goes with absolute addressing there.  I'm pretty
sure if it had a choice it would happily use PC-relative addressing,
even with a reasonably short range, if that was readily available...

(*) Something like 'call 1f; 1: popl %0; leal $foo-1b(%0), %0' is the
closest to widely available I'm aware of, but the '1f/1b' notation is
only available with GNU as AFAIK.

Alexandre Oliva, freedom fighter  he/him
Be the change, be Free!                 FSF Latin America board member
GNU Toolchain Engineer                        Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás - Che GNUevara

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