* target/riscv: warning on current master: writing 8 bytes into a region of size 4
@ 2025-10-09 16:25 Richard W.M. Jones
0 siblings, 0 replies; only message in thread
From: Richard W.M. Jones @ 2025-10-09 16:25 UTC (permalink / raw)
To: qemu-riscv
When compiling the latest master branch, CONFIG_ATOMIC64 is defined,
and I get this warning:
----
In function ‘stq_he_p’,
inlined from ‘translator_ld’ at ../accel/tcg/translator.c:359:13,
inlined from ‘translator_ldl_end’ at ../accel/tcg/translator.c:491:10,
inlined from ‘translator_ldl’ at /home/rjones/d/qemu/include/exec/translator.h:201:12,
inlined from ‘decode_opc’ at ../target/riscv/translate.c:1236:18,
inlined from ‘riscv_tr_translate_insn’ at ../target/riscv/translate.c:1348:5:
/home/rjones/d/qemu/include/qemu/bswap.h:295:5: warning: writing 8 bytes into a region of size 4 [-Wstringop-overflow=]
295 | __builtin_memcpy(ptr, &v, sizeof(v));
| ^
../accel/tcg/translator.c: In function ‘riscv_tr_translate_insn’:
../accel/tcg/translator.c:489:14: note: destination object ‘val’ of size 4
489 | uint32_t val;
| ^
../accel/tcg/translator.c:489:14: note: at offset [1, 4] into destination object ‘val’ of size 4
----
Looking at the code I can see why it's happening. However I don't see
a simple fix.
The function 'translator_ldl_end' really wants a 32 bit result, and it
seems like the 64 bit case would never be called, although I'm not
sure ...
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-09 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 16:25 target/riscv: warning on current master: writing 8 bytes into a region of size 4 Richard W.M. Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).