diff options
author | Zenghui Yu | 2020-02-05 15:15:45 +0100 |
---|---|---|
committer | Richard Henderson | 2020-02-28 19:58:41 +0100 |
commit | b59ea3640cc03f1f609fc5155605be71f43bcd2e (patch) | |
tree | f110f9b30c95da92a7bef6cc8ac665481c3e6cb2 /tcg/arm | |
parent | accel/tcg: fix race in cpu_exec_step_atomic (bug 1863025) (diff) | |
download | qemu-b59ea3640cc03f1f609fc5155605be71f43bcd2e.tar.gz qemu-b59ea3640cc03f1f609fc5155605be71f43bcd2e.tar.xz qemu-b59ea3640cc03f1f609fc5155605be71f43bcd2e.zip |
compiler.h: Don't use compile-time assert when __NO_INLINE__ is defined
Our robot reported the following compile-time warning while compiling
Qemu with -fno-inline cflags:
In function 'load_memop',
inlined from 'load_helper' at /qemu/accel/tcg/cputlb.c:1578:20,
inlined from 'full_ldub_mmu' at /qemu/accel/tcg/cputlb.c:1624:12:
/qemu/accel/tcg/cputlb.c:1502:9: error: call to 'qemu_build_not_reached' declared with attribute error: code path is reachable
qemu_build_not_reached();
^~~~~~~~~~~~~~~~~~~~~~~~
[...]
It looks like a false-positive because only (MO_UB ^ MO_BSWAP) will
hit the default case in load_memop() while need_swap (size > 1) has
already ensured that MO_UB is not involved.
So the thing is that compilers get confused by the -fno-inline and
just can't accurately evaluate memop_size(op) at compile time, and
then the qemu_build_not_reached() is wrongly triggered by (MO_UB ^
MO_BSWAP). Let's carefully don't use the compile-time assert when
no functions will be inlined into their callers.
Reported-by: Euler Robot <euler.robot@huawei.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Message-Id: <20200205141545.180-1-yuzenghui@huawei.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/arm')
0 files changed, 0 insertions, 0 deletions