aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-05-17 05:49:22 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-17 05:49:22 +0000
commitfb83aeb49971769172ddc9dbb9051f68f5dbd5ea (patch)
treed305091a480ea1b2f7a8b3217343109ac3ec281f /gcc/go/gofrontend/expressions.h
parent935469daaa5c02ac5104c0d5c04a1f12e23529b1 (diff)
downloadgcc-fb83aeb49971769172ddc9dbb9051f68f5dbd5ea.zip
gcc-fb83aeb49971769172ddc9dbb9051f68f5dbd5ea.tar.gz
gcc-fb83aeb49971769172ddc9dbb9051f68f5dbd5ea.tar.bz2
re PR go/90482 (Many 32-bit Solaris/SPARC tests FAIL with SIGBUS)
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 From-SVN: r271310
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r--gcc/go/gofrontend/expressions.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index 21a214d..3527d7a 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -1063,6 +1063,11 @@ class Expression
static Expression*
pack_direct_iface(Type*, Expression*, Location);
+ // Return an expression of the underlying pointer for a direct interface
+ // type (the opposite of pack_direct_iface).
+ static Expression*
+ unpack_direct_iface(Expression*, Location);
+
// Dump an expression to a dump constext.
void
dump_expression(Ast_dump_context*) const;
@@ -1231,9 +1236,6 @@ class Expression
}
static Expression*
- unpack_direct_iface(Expression*, Location);
-
- static Expression*
get_interface_type_descriptor(Expression*);
static Expression*