https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104566

            Bug ID: 104566
           Summary: Internal compiler error while building from source
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xanderlenstra at gmail dot com
  Target Milestone: ---

Created attachment 52453
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52453&action=edit
Full terminal output as far as I can scroll back

I was trying to get a compiler with support for c++20, but I'm working on a
university computer so I have no sudo rights. Easiest solution seemed to build
g++10 or newer from source, so I did exactly that, following the tutorial on
https://gcc.gnu.org/install/
I've downloaded it from this mirror:
http://mirror.koddos.net/gcc/releases/gcc-11.2.0/ which is marked as an
official mirror on this page: https://gcc.gnu.org/mirrors.html
Due to space concerns, I only installed the c++ component
('--enable-languages=c++') and did the lean bootstrap ('make bootstrap-lean'),
otherwise I have not deviated from the default commands recommended to be run.
I did have to restart the bootstrap once, as the variable `CPLUS_INCLUDE_PATH`
was already set to a different value, resulting in the crash described in
#61427. I `unset` the variable, and ran the same command again. This time, the
terminal showed the following error:
```
cc1: internal compiler error: in fail_formatted, at selftest.c:63
0x24d14f5 selftest::fail_formatted(selftest::location const&, char const*, ...)
        ../../gcc-11.2.0/gcc/selftest.c:63
0x24d15e4 selftest::assert_streq(selftest::location const&, char const*, char
const*, char const*, char const*)
        ../../gcc-11.2.0/gcc/selftest.c:92
0x24e86d3 test_add_location_if_nearby
        ../../gcc-11.2.0/gcc/diagnostic-show-locus.c:4124
0x2514db1 selftest::for_each_line_table_case(void (*)(selftest::line_table_case
const&))
        ../../gcc-11.2.0/gcc/input.c:3573
0x24ef897 selftest::diagnostic_show_locus_c_tests()
        ../../gcc-11.2.0/gcc/diagnostic-show-locus.c:5266
0x23fb40c selftest::run_tests()
        ../../gcc-11.2.0/gcc/selftest-run-tests.c:98
0x12e8ad5 toplev::run_self_tests()
        ../../gcc-11.2.0/gcc/toplev.c:2265
```

To reiterate, the exact command I ran was `make bootstrap-lean`, while inside
the objdir

The entire output as far as my terminal still shows it, is included as an
attachment. My $HOME on this pc is `/vol/s1935534`.

Running `gcc -v` gave the following output:

```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--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-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --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 --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
```

I have googled for this error, but the only other bug even mentioning the
`fail_formatted` function is #81101, which appears unrelated to building gcc
from source.

If any additional information is required,

Reply via email to