On 4/19/21 12:18 PM, Philippe Mathieu-Daudé wrote:
+#define STUB_HELPER(NAME, ...) \
+    static inline void gen_helper_##NAME(__VA_ARGS__) \
+    { qemu_build_not_reached(); }

Does this really work when optimization is on? I suspect you need additional cleanups before you can use qemu_build_not_reached().

In particular:

 (1) check_cp0_enabled must return a boolean, so that the
     caller can avoid emitting dead code after the
     exception is emitted.

 (2) check_cp0_enabled must be adjusted to Know that
     cp0 access is always forbidden in user-only mode.

Otherwise, I can't see how the compiler can prove that the call to gen_cache_operation, and thus gen_helper_cache, is unreachable.

In the meantime, you can use g_assert_not_reached() in STUB_HELPER. With that changed,

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~

Reply via email to