ERROR:tcg/optimize.c:580:do_constant_folding_2: code should not be reached

Host environment

  • Operating system: Ubuntu 24.04
  • OS/kernel version: 6.6
  • Architecture: ARM
  • QEMU flavor: qemu-system-aarch64
  • QEMU version: 8.2.0
  • QEMU command line:
    ./qemu-system-aarch64 -nodefaults -cpu cortex-a53 -smp 2,sockets=1,dies=1,cores=2,threads=1 -m 4G -machine type=virt,virtualization=on,secure=off,dump-guest-core=off -display vnc=:0,websocket=5700 -device ramfb -monitor telnet:localhost:7100,server,nowait,nodelay -serial pty -device qemu-xhci,id=xhci -device usb-kbd -device usb-tablet -netdev tap,ifname=qemu,script=no,downscript=no,id=hostnet0 -device virtio-net-pci,romfile=,netdev=hostnet0,mac=02:1f:65:bc:2c:0c,id=net0 -object iothread,id=io2 -drive id=cdrom0,media=cdrom,if=none,format=raw,readonly=on,file=/storage/win10arm.iso -device virtio-scsi-pci,id=scsi0,iothread=io2,addr=0x5 -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=10 -drive id=cdrom1,media=cdrom,if=none,format=raw,readonly=on,file=/run/drivers.iso -device usb-storage,drive=cdrom1 -drive file=/storage/data.img,if=none,id=drive-userdata,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on -device virtio-scsi-pci,id=hw-userdata,iothread=io2,bus=pcie.0,addr=0xa -device scsi-hd,bus=hw-userdata.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata,id=userdata,rotation_rate=1,bootindex=3 -drive file=/storage/windows.rom,if=pflash,unit=0,format=raw,readonly=on -drive file=/storage/windows.vars,if=pflash,unit=1,format=raw -device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c

Emulated/Virtualized environment

  • Operating system: Windows 10/11
  • OS/kernel version:
  • Architecture: ARM64

Description of problem

After booting Windows 10 or 11 (ARM) QEMU suddenly quits with:

ERROR:tcg/optimize.c:580:do_constant_folding_2: code should not be reached

It seems like it is missing an OPCODE in that function?

Steps to reproduce

  1. Boot Windows
  2. QEMU quits

Additional information

Edited by kroese