• Keith Randall's avatar
    [dev.ssa] cmd/compile: simplify 386+PIC+globals a bit · 94c8e59a
    Keith Randall authored
    We shouldn't issue instructions like MOVL foo(SB), AX directly from the
    SSA backend.  Instead we should do LEAL foo(SB), AX; MOVL (AX), AX.
    
    This simplifies obj logic because now only LEAL needs to be treated
    specially.  The register allocator uses the LEAL to in effect allocate
    the temporary register required for the shared library thunk calls.
    
    Also, the LEALs can now be CSEd.  So code like
        var g int
        func f() { g += 5 }
    Requires only one thunk call instead of 2.
    
    Change-Id: Ib87d465f617f73af437445871d0ea91a630b2355
    Reviewed-on: https://go-review.googlesource.com/26814
    Run-TryBot: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarDavid Chase <drchase@google.com>
    94c8e59a
386.rules 60.1 KB