summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorRichard Henderson2021-01-14 21:04:04 +0100
committerRichard Henderson2021-01-22 23:48:01 +0100
commitc52ea111e0ea2d5368a3ae601baafaae75e3317f (patch)
tree2692f6d7115cc1ed0bef72864258fb75de92406c /include/qemu
parenttcg: update the cpu running flag in cpu_exec_step_atomic (diff)
downloadqemu-c52ea111e0ea2d5368a3ae601baafaae75e3317f.tar.gz
qemu-c52ea111e0ea2d5368a3ae601baafaae75e3317f.tar.xz
qemu-c52ea111e0ea2d5368a3ae601baafaae75e3317f.zip
qemu/compiler: Split out qemu_build_not_reached_always
Provide a symbol that can always be used to signal an error, regardless of optimization. Usage of this should be protected by e.g. __builtin_constant_p, which guards for optimization. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/compiler.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index d620a841e4..cf28bb2bcd 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -215,9 +215,10 @@
* supports QEMU_ERROR, this will be reported at compile time; otherwise
* this will be reported at link time due to the missing symbol.
*/
-#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
- qemu_build_not_reached(void);
+ qemu_build_not_reached_always(void);
+#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
+#define qemu_build_not_reached() qemu_build_not_reached_always()
#else
#define qemu_build_not_reached() g_assert_not_reached()
#endif