gcc 9 compilation fails on atom CPU specifically

Bug #1918982 reported by Josh Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-9 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

While this may be a bug in gcc, reporting here per https://gcc.gnu.org/bugs/.

https://github.com/anarkiwi/atomgccpuzzle based on Ubuntu 20.04, reproduces a difference in behaviour when the gcc frontend runs on an atom-based CPU via qemu (the same issue occurs outside Docker, and/or when run on an Intel Celeron J series CPU).

$ docker build -f Dockerfile .
[...]
 ---> Running in cf6eac22eacf
Scanning dependencies of target srsenb_mac
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_carrier.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/mac.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/ue.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_grid.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_harq.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_metric.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_ue.cc.o

In file included from /root/srsLTE/srsenb/hdr/stack/mac/scheduler_common.h:25,
                 from /root/srsLTE/srsenb/hdr/stack/mac/scheduler_ue.h:25,
                 from /root/srsLTE/srsenb/hdr/stack/mac/scheduler_grid.h:26,
                 from /root/srsLTE/srsenb/src/stack/mac/scheduler_grid.cc:22:
/root/srsLTE/lib/include/srslte/adt/bounded_bitset.h: In member function 'srsenb::alloc_outcome_t srsenb::sf_grid_t::alloc_ul_data(srsenb::sched_ue*, srsenb::prb_interval, bool)':
/root/srsLTE/lib/include/srslte/adt/bounded_bitset.h:219:32: error: 'newmask.srslte::bounded_bitset<100, true>::buffer[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  219 | buffer[i] &= other.buffer[i];
      | ~~~~~~~~~~~~^
cc1plus: all warnings being treated as errors
make[3]: *** [srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/build.make:115: srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_grid.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:8921: srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:8928: srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/rule] Error 2
make: *** [Makefile:3265: srsenb_mac] Error 2
The command '/bin/sh -c make -j srsenb_mac' returned a non-zero code: 2

However, a docker build without qemu with the exact same source code, installed packages, base image succeeds.

$ docker build -f Dockerfile.ok .
[...]
 ---> Running in e43b65fff3d1
Scanning dependencies of target srsenb_mac
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_grid.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_carrier.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/mac.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/ue.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_harq.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_metric.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler.cc.o
[100%] Building CXX object srsenb/src/stack/mac/CMakeFiles/srsenb_mac.dir/scheduler_ue.cc.o
[100%] Linking CXX static library libsrsenb_mac.a
[100%] Built target srsenb_mac
Removing intermediate container e43b65fff3d1
 ---> b8f0322dc5f2
Step 14/14 : ENTRYPOINT ["/bin/sh"]
 ---> Running in 46d14114fafc
Removing intermediate container 46d14114fafc
 ---> 3f781ac8f8bb
Successfully built 3f781ac8f8bb

$ lsb_release -d
Description: Ubuntu 20.04.2 LTS

$ gcc -version
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
$ apt-cache policy gcc-9
gcc-9:
  Installed: 9.3.0-17ubuntu1~20.04
  Candidate: 9.3.0-17ubuntu1~20.04
  Version table:
 *** 9.3.0-17ubuntu1~20.04 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     9.3.0-10ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Revision history for this message
Matthias Klose (doko) wrote :

please recheck with the recent gcc-9 version in 20.04 LTS, and with the default compiler in 22.04 LTS

Changed in gcc-9 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gcc-9 (Ubuntu) because there has been no activity for 60 days.]

Changed in gcc-9 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.