diff options
author | Ian Lance Taylor <iant@google.com> | 2016-08-08 19:53:44 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-08 19:53:44 +0000 |
commit | f432d1282d585bbedaa4293ec4bac0b7c8c2024a (patch) | |
tree | 30584249a7b8d17b5cdd6db69cfa4ce4069aa72c /gcc/go/gofrontend | |
parent | 5c9343960762bda86bc64dc19862dcf3088102cd (diff) | |
download | gcc-f432d1282d585bbedaa4293ec4bac0b7c8c2024a.zip gcc-f432d1282d585bbedaa4293ec4bac0b7c8c2024a.tar.gz gcc-f432d1282d585bbedaa4293ec4bac0b7c8c2024a.tar.bz2 |
re PR go/72814 (reflect FAILs on 32-bit Solaris/SPARC: SIGILL)
PR go/72814
runtime: treat zero-sized result value as void
Change the FFI interface to treat a call to a function that returns a
zero-sized result as a call to a function that returns void.
This is part of the fix for https://gcc.gnu.org/PR72814. On 32-bit
SPARC systems, a call to a function that returns a non-zero-sized struct
is followed by an unimp instruction that describes the size of the
struct. The function returns to the address after the unimp
instruction. The libffi library can not represent a zero-sized struct,
so we wind up treating it as a 1-byte struct. Thus in that case libffi
calls the function with an unimp instruction, but the function does not
adjust the return address. The result is that the program attempts to
execute the unimp instruction, causing a crash.
This is part of a change that fixes the crash by treating all functions
that return zero bytes as functions that return void.
Reviewed-on: https://go-review.googlesource.com/25585
* go-gcc.cc (Gcc_backend::function_type): If the return type is
zero bytes, treat the function as returning void.
(return_statement): If the return type is zero bytes, don't
actually return any values.
From-SVN: r239252
Diffstat (limited to 'gcc/go/gofrontend')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a5d7f51..6ec9f7b 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -eeeeff3e3dd6c09aaefdf13cce99a5beff47a095 +5e4c16d4fea39835e16f17c3d2b2e85f5c81d815 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. |