From 767d86e6dc51494813efae4139178574277b3013 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Thu, 6 Apr 2017 17:22:15 +0200 Subject: [PATCH] base-hw: workaround for compiling with GCC 6 Issue #2382 --- repos/base-hw/src/lib/base/thread_bootstrap.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repos/base-hw/src/lib/base/thread_bootstrap.cc b/repos/base-hw/src/lib/base/thread_bootstrap.cc index 955dbc0c7..506ae2231 100644 --- a/repos/base-hw/src/lib/base/thread_bootstrap.cc +++ b/repos/base-hw/src/lib/base/thread_bootstrap.cc @@ -62,6 +62,8 @@ void prepare_reinit_main_thread() { prepare_init_main_thread(); } ** Thread ** ************/ +/* prevent the compiler from optimizing out the 'this' pointer check */ +__attribute__((optimize("-fno-delete-null-pointer-checks"))) Native_utcb *Thread::utcb() { if (this) { return &_stack->utcb(); }