]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR go/90482
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 May 2019 05:49:22 +0000 (05:49 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 May 2019 05:49:22 +0000 (05:49 +0000)
commitfa502e3a0065f80dbc83c3d48bc9e2a252710ac8
treed305091a480ea1b2f7a8b3217343109ac3ec281f
parent0cde8d2e7e33a0bc0c0056d3b62adf82e95d6ce3
PR go/90482
    compiler: make value method of direct interface type takes pointer

    Currently, a value method of a direct interface type takes the
    value of the receiver, which is pointer shaped, as the first
    parameter. When this method is called through interface, we
    actually pass the interface data as a pointer. On most platforms
    this is ok, as the underlying calling convention is the same,
    except that on SPARC32, the calling convention is actually
    different.

    This CL changes the method function actually takes a pointer.
    The function will convert the pointer to the pointer-shaped
    receiver type (a no-op conversion from machine code's aspect).
    For a direct call, in the caller we convert the receiver to a
    pointer (also no-op conversion) before invoking the method. For
    an interface call, we pass the pointer as before. This way, it is
    consistent that we always pass a pointer.

    Hopefully this fixes SPARC32 build and https://gcc.gnu.org/PR90482.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177758

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271310 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/types.cc