Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913083 - app-emulation/qemu-8.1.0 ../accel/tcg/cputlb.c: In function ‘do_ld_mmio_beN’: unreachable code reached
Summary: app-emulation/qemu-8.1.0 ../accel/tcg/cputlb.c: In function ‘do_ld_mmio_beN’:...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-26 20:08 UTC by Mike Gilbert
Modified: 2023-11-15 12:50 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (app-emulation:qemu-8.1.0:20230826-194235.log.gz,125.31 KB, application/gzip)
2023-08-26 20:08 UTC, Mike Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2023-08-26 20:08:32 UTC
Created attachment 868780 [details]
build log

FAILED: libqemu-i386-softmmu.fa.p/accel_tcg_cputlb.c.o 
x86_64-pc-linux-gnu-gcc -m64 -mcx16 -Ilibqemu-i386-softmmu.fa.p -I. -I.. -Itarget/i386 -I../target/i386 -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/spice-server -I/usr/include/spice-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/opus -fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -O2 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wundef -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wmissing-format-attribute -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -isystem /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/linux-headers -isystem linux-headers -iquote . -iquote /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0 -iquote /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/include -iquote /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/host/include/x86_64 -iquote /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/host/include/generic -iquote /x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/tcg/i386 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -march=amdfam10 -Og -g -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="i386-softmmu-config-target.h"' '-DCONFIG_DEVICES="i386-softmmu-config-devices.h"' -MD -MQ libqemu-i386-softmmu.fa.p/accel_tcg_cputlb.c.o -MF libqemu-i386-softmmu.fa.p/accel_tcg_cputlb.c.o.d -o libqemu-i386-softmmu.fa.p/accel_tcg_cputlb.c.o -c ../accel/tcg/cputlb.c
In file included from ../accel/tcg/cputlb.c:20:
../accel/tcg/cputlb.c: In function ‘do_ld_mmio_beN’:
/x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/include/qemu/osdep.h:244:35: error: call to ‘qemu_build_not_reached_always’ declared with attribute error: code path is reachable
  244 | #define qemu_build_not_reached()  qemu_build_not_reached_always()
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../accel/tcg/cputlb.c:2121:13: note: in expansion of macro ‘qemu_build_not_reached’
 2121 |             qemu_build_not_reached();
      |             ^~~~~~~~~~~~~~~~~~~~~~
../accel/tcg/cputlb.c: In function ‘do_st_mmio_leN’:
/x/portage/app-emulation/qemu-8.1.0/work/qemu-8.1.0/include/qemu/osdep.h:244:35: error: call to ‘qemu_build_not_reached_always’ declared with attribute error: code path is reachable
  244 | #define qemu_build_not_reached()  qemu_build_not_reached_always()
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../accel/tcg/cputlb.c:2764:13: note: in expansion of macro ‘qemu_build_not_reached’
 2764 |             qemu_build_not_reached();
      |             ^~~~~~~~~~~~~~~~~~~~~~


Portage 3.0.51_p5 (python 3.11.5-final-0, default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr, gcc-13, glibc-2.38-r1, 6.1.46-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.46-dist-x86_64-AMD_Phenom-tm-_II_X6_1055T_Processor-with-glibc2.38
KiB Mem:    32860200 total,  11615200 free
KiB Swap:   33554428 total,  33554428 free
Head commit of repository gentoo: 37643000bea3e0b99ba3d3d57b161ca118def235

sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.41 p2) 2.41.0
ccache version 4.8.2 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           2.7.18_p16-r1::gentoo, 3.11.5::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-util/ccache:           4.8.2::gentoo
dev-util/cmake:            3.27.4::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254.1-r1::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.69-r9::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo, 17.0.0_rc3::gentoo
sys-devel/gcc:             12.3.1_p20230623::gentoo, 13.2.0::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo, 17.0.0_rc3::gentoo
sys-devel/llvm:            16.0.6::gentoo, 17.0.0_rc3::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r1::gentoo
sys-libs/libselinux:       3.5-r1::gentoo
Repositories:

gentoo
    location: /home/floppym/repos/gentoo
    sync-type: git
    sync-uri: ssh://git@git.gentoo.org/repo/gentoo.git
    priority: -1000
    volatile: True

floppym
    location: /home/floppym/repos/floppym
    masters: gentoo
    priority: 30
    volatile: True

cross
    location: /home/floppym/repos/cross
    masters: gentoo
    priority: 40
    volatile: True

local
    location: /home/floppym/repos/local
    masters: gentoo
    priority: 40
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/ssl/certs /usr/share/themes"
CXXFLAGS="-O2 -pipe -march=amdfam10"
DISTDIR="/data/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=6 --binpkg-respect-use=y --binpkg-changed-deps=y --dynamic-deps=n --quiet-build=n --quiet-fail=y --with-bdeps=y --verbose-conflicts"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=amdfam10"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live ccache clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox parallel-fetch parallel-install preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe -march=amdfam10"
GENTOO_MIRRORS="https://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
PKGDIR="/data/cache/binpkgs"
PORTAGE_COMPRESS="gzip"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--ipv4"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/x"
SHELL="/bin/zsh"
USE="X a52 aac acl acpi activities alsa amd64 appindicator branding bzip2 cairo caps cdda cdr cli crypt css cups dbus declarative dri dts dvd dvdr encode exif filecaps flac fontconfig gdbm gif gpm gtk gui iconv icu idn imap ipv6 jpeg kde kwallet lcms libnotify libtirpc lzma mad mng mp3 mp4 mpeg mtp multilib ncurses nls nptl offensive ogg opengl pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 readline screencast sdl seccomp semantic-desktop sound spell ssl startup-notification svg systemd taglib test-rust theora threads tiff truetype udev udisks unicode upower usb vim-syntax vorbis vulkan wayland widgets wxwidgets x264 xattr xcb xcomposite xft xml xv xvid zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 3dnow 3dnowext popcnt sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi efi-64 pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

app-emulation/qemu-8.0.4::gentoo was built with the following:
USE="aio alsa bzip2 curl fdt filecaps gnutls gtk jpeg ncurses nls opengl oss pam png pulseaudio sdl seccomp slirp spice static-user udev usb vhost-net vnc xattr -accessibility -bpf -capstone -debug -doc -fuse -glusterfs -infiniband -io-uring -iscsi -jack -jemalloc -lzo -multipath -nfs -numa -pin-upstream-blobs -plugins -python -rbd -sasl -sdl-image -selinux -smartcard -snappy -ssh -systemtap -test -usbredir -vde -virgl -virtfs -vte -xen -zstd" ABI_X86="64" PYTHON_TARGETS="python3_11 -python3_10 -python3_12" QEMU_SOFTMMU_TARGETS="i386 x86_64 -aarch64 -alpha -arm -avr -cris -hppa -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -xtensa -xtensaeb" QEMU_USER_TARGETS="aarch64 mips mips64 mipsn32 riscv64 -aarch64_be -alpha -arm -armeb -cris -hexagon -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips64el -mipsel -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64le -riscv32 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -x86_64 -xtensa -xtensaeb"
CFLAGS="-march=amdfam10 -Og -g"
CXXFLAGS="-march=amdfam10 -Og -g"
FEATURES="assume-digests binpkg-logs userpriv parallel-install ccache parallel-fetch qa-unresolved-soname-deps nostrip distlocks network-sandbox unmerge-orphans protect-owned ipc-sandbox userfetch binpkg-dostrip binpkg-docompress unknown-features-warn binpkg-multi-instance usersync buildpkg-live config-protect-if-modified ebuild-locks sandbox multilib-strict preserve-libs clean-logs strict sfperms buildpkg fixlafiles sign usersandbox"

>>> Attempting to run pkg_info() for 'app-emulation/qemu-8.0.4'
Using:
  app-emulation/spice-protocol-0.14.4
  sys-firmware/edk2-ovmf-bin-202202
  sys-firmware/seabios-bin-1.16.0
  sys-firmware/ipxe-1.21.1_p20230601
  sys-firmware/sgabios-0.1_pre10
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-26 21:12:51 UTC
I can't seem to reproduce this one myself.

Would you mind reporting it upstream at https://gitlab.com/qemu-project/qemu/-/issues?
Comment 2 Mike Gilbert gentoo-dev 2023-08-26 21:19:49 UTC
Seems to be CFLAGS related. I can successfully build it with -march=x86-64.
Comment 3 Mike Gilbert gentoo-dev 2023-09-03 17:49:18 UTC
qemu upstream calls this a "compiler bug".
Comment 4 Ostashevskyi Viktor 2023-11-15 12:43:38 UTC
I believe the problem is in '-Og', see qemu code (include/qemu/osdep.h):

#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
#define qemu_build_not_reached()  qemu_build_not_reached_always()
#else
#define qemu_build_not_reached()  g_assert_not_reached()
#endif

Probably, '-Og' makes __OPTIMIZE__ defined.

I can confirm that '-Og -U__OPTIMIZE__' builds cleanly.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-15 12:50:22 UTC
(In reply to Ostashevskyi Viktor from comment #4)
> I believe the problem is in '-Og', see qemu code (include/qemu/osdep.h):
> 

The problem is already analysed in the QEMU and GCC bugs linked here.