b59ea3640c
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> |
||
---|---|---|
.. | ||
atomic128.h | ||
atomic.h | ||
base64.h | ||
bcd.h | ||
bitmap.h | ||
bitops.h | ||
bswap.h | ||
buffer.h | ||
co-shared-resource.h | ||
compiler.h | ||
config-file.h | ||
coroutine_int.h | ||
coroutine.h | ||
cpuid.h | ||
crc32c.h | ||
ctype.h | ||
cutils.h | ||
dbus.h | ||
drm.h | ||
envlist.h | ||
error-report.h | ||
event_notifier.h | ||
fifo8.h | ||
fifo32.h | ||
filemonitor.h | ||
futex.h | ||
guest-random.h | ||
hbitmap.h | ||
help_option.h | ||
host-utils.h | ||
id.h | ||
int128.h | ||
iov.h | ||
iova-tree.h | ||
jhash.h | ||
job.h | ||
lockable.h | ||
log-for-trace.h | ||
log.h | ||
main-loop.h | ||
memfd.h | ||
mmap-alloc.h | ||
module.h | ||
notify.h | ||
nvdimm-utils.h | ||
option_int.h | ||
option.h | ||
osdep.h | ||
path.h | ||
plugin-memory.h | ||
plugin.h | ||
pmem.h | ||
processor.h | ||
qdist.h | ||
qemu-plugin.h | ||
qemu-print.h | ||
qht.h | ||
qsp.h | ||
queue.h | ||
range.h | ||
ratelimit.h | ||
rcu_queue.h | ||
rcu.h | ||
readline.h | ||
seqlock.h | ||
sockets.h | ||
stats64.h | ||
sys_membarrier.h | ||
systemd.h | ||
thread-posix.h | ||
thread-win32.h | ||
thread.h | ||
throttle-options.h | ||
throttle.h | ||
timed-average.h | ||
timer.h | ||
typedefs.h | ||
unicode.h | ||
units.h | ||
uri.h | ||
uuid.h | ||
vfio-helpers.h | ||
win_dump_defs.h | ||
xattr.h | ||
xxhash.h |