diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2018-08-06 14:52:59 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2018-08-06 17:53:14 -0400 |
| commit | c6cc93bca69abc258513af8cf2370b14e70fd8fb (patch) | |
| tree | 5171c1b4271eae0166d1b94993eaea3602ee7114 | |
| parent | ff06176b87078ce56cc7b6b3405a029ef3d0046f (diff) | |
| download | haskell-c6cc93bca69abc258513af8cf2370b14e70fd8fb.tar.gz | |
rts: Ensure that the_gc_thread is aligned
Since we cast this to a gc_thread the compiler may assume that it's aligned.
Make sure that this is so. Fixes #15482.
| -rw-r--r-- | rts/sm/GC.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 742ae360c5..9b3151641e 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -128,7 +128,11 @@ uint32_t mutlist_MUTVARS, gc_thread **gc_threads = NULL; #if !defined(THREADED_RTS) -StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)]; +/* Use conservative alignment since we will cast this to a gc_thread and + * consequently the compiler may assume it is aligned. See #15482. + */ +StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)] + __attribute__((aligned(sizeof(W_)))); #endif // Number of threads running in *this* GC. Affects how many |
