Should asm("" : : : "memory") order accesses to the GOT?

Franz Sirl
Thu Jun 17 14:17:00 GMT 1999

Am Don, 17 Jun 1999 schrieb Jeffrey A Law:
>In message < >you write:
>  > the subject says it all, should address loads from the GOT considered as
>  > memory accesses?
>It should.  But typically we do not represent GOT references as memory
>This is a fairly generic problem with our PIC code in the sense that we're
>lying to the compiler about what the machine actually does.  Lots of ports
>have the same problem.
>If we ever revamp how we represent PIC internally, this is one of the problems
>I want to fix :-)

Hmm, sounds like a big task. So there's currently no way to order accesses to
the GOT in gcc, independent of platform. Then the only way to fix is to
move these accesses out into a different file.

BTW, Geoff suggested to replace all unspec 8 with something like this:
(define_expand "movsi_got"
  [(set (match_operand:SI 0 "register_operand" "")
        (mem (plus (unspec [(match_operand:SI 1 "got_operand" "")] 8)
                 (match_dup 2))))]

But if all platforms are affected it's better to fix glibc once and forever.


More information about the Gcc mailing list