Cortex M:qemu abort with optimized code and icount
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
A basic program runs fine if compiled with flag -O0 with gcc, but triggers a qemu abort when compiled with -O1 and run with icount:
"qemu: fatal: IO on conditional branch instruction"
I also noticed the problem on C source like this with -O0:
"int foo = *bar; bar++;" : OK
"int foo = *bar++;" : FAIL (!!!)
Optimized binary attached to this ticket.
command line:
qemu-system-arm -M lm3s6965evb -nographic -kernel hello.bin -serial file:$(tty) -icount 4 -cpu cortex-m4
(working fine without icount)
version:
QEMU emulator version 2.11.50 (v2.11.
Compilation options:
./configure --target-
I have also tested previous versions:
- stock qemu-system-arm 2.5.0 from ubuntu 16.04: OK
- git version: QEMU emulator version 2.10.0 (v2.10.2-dirty): OK
- git version: QEMU emulator version 2.10.90 (v2.11.
tags: | added: arm |
Changed in qemu: | |
status: | Fix Committed → Fix Released |
Yes, it looks like we accidentally broke icount. This patch from the mailing list fixes it: /lists. gnu.org/ archive/ html/qemu- devel/2018- 02/msg06595. html
https:/
though it hasn't been code-reviewed yet.