diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-23 18:15:22 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-23 18:15:22 +0000 |
commit | 5785236764921a60320622d6a63dd52ef4fb23ac (patch) | |
tree | 807c3b6f6779fa8ab24d85323f1593d91af510de /libgo | |
parent | a23d48fd11c7313cc7f71ef0937a75000cf1fb53 (diff) |
PR go/79037
compiler, runtime: align gc data for m68k
The current GC requires that the gc data be aligned to at least a 4
byte boundary, because it uses the lower two bits of the address for
flags (see LOOP and PRECISE in runtime/mgc0.c). As the gc data is
stored as a [...]uintptr, that is normally always true. However, on
m68k, that only guarantees 2 byte alignment. Fix it by forcing the
alignment.
The parfor code used by the current GC requires that the parfor data
be aligned to at least an 8 byte boundary. The code in parfor.c
verifies this. This is normally true, as the data uses uint64_t
values, but, again, this must be enforced explicitly on m68k.
Fixes GCC PR 79037.
Reviewed-on: https://go-review.googlesource.com/35478
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244824 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/runtime/go-unsafe-pointer.c | 3 | ||||
-rw-r--r-- | libgo/runtime/parfor.c | 2 | ||||
-rw-r--r-- | libgo/runtime/runtime.h | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c index b98068365e14..cce2e95ac289 100644 --- a/libgo/runtime/go-unsafe-pointer.c +++ b/libgo/runtime/go-unsafe-pointer.c @@ -36,7 +36,8 @@ static const String reflection_string = sizeof REFLECTION - 1 }; -const uintptr unsafe_Pointer_gc[] = {sizeof(void*), GC_APTR, 0, GC_END}; +const uintptr unsafe_Pointer_gc[] __attribute__((aligned(4))) = + {sizeof(void*), GC_APTR, 0, GC_END}; extern const FuncVal runtime_pointerhash_descriptor __asm__ (GOSYM_PREFIX "runtime.pointerhash$descriptor"); diff --git a/libgo/runtime/parfor.c b/libgo/runtime/parfor.c index b49826fe568a..d64d74ccd360 100644 --- a/libgo/runtime/parfor.c +++ b/libgo/runtime/parfor.c @@ -11,7 +11,7 @@ struct ParForThread { // the thread's iteration space [32lsb, 32msb) - uint64 pos; + uint64 pos __attribute__((aligned(8))); // stats uint64 nsteal; uint64 nstealcnt; diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index 5fd115589a7c..644fe9286541 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -191,7 +191,7 @@ struct ParFor // otherwise parfor may return while other threads are still working ParForThread *thr; // array of thread descriptors // stats - uint64 nsteal; + uint64 nsteal __attribute__((aligned(8))); // force alignment for m68k uint64 nstealcnt; uint64 nprocyield; uint64 nosyield; |