From d45f87cf3599b3614ea4b126728aedeb51737695 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 May 2021 13:35:42 +0200 Subject: score: Add _CPU_Context_switch_no_return() The __builtin_unreachable() cannot be used with current GCC versions to tell the compiler that a function does not return to the caller, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151 Add a no return variant of _CPU_Context_switch() to avoid generation of dead code in _Thread_Start_multitasking() if RTEMS was built with SMP support enabled. --- cpukit/score/src/threadstartmultitasking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/threadstartmultitasking.c b/cpukit/score/src/threadstartmultitasking.c index a0b465a226..094a535394 100644 --- a/cpukit/score/src/threadstartmultitasking.c +++ b/cpukit/score/src/threadstartmultitasking.c @@ -59,7 +59,7 @@ void _Thread_Start_multitasking( void ) * executing to the currently selected heir thread. */ _CPU_Context_Set_is_executing( &trash, true ); - _CPU_Context_switch( &trash, &heir->Registers ); + _CPU_Context_switch_no_return( &trash, &heir->Registers ); RTEMS_UNREACHABLE(); } #else -- cgit v1.2.3