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

            Bug ID: 85176
           Summary: ICE in force_decl_die, at dwarf2out.c:25922
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: v_lichevsky at tut dot by
  Target Milestone: ---

Created attachment 43825
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43825&action=edit
preprocessed sources

g++-8 ICEs with the following message:

% g++-8 -O1 -flto -g1 test.cpp
lto1: internal compiler error: in force_decl_die, at dwarf2out.c:25922
0x6b2a63 force_decl_die
        ../../src/gcc/dwarf2out.c:25922
0x6b356b flush_limbo_die_list
        ../../src/gcc/dwarf2out.c:30963
0x6bea95 dwarf2out_finish
        ../../src/gcc/dwarf2out.c:31003
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
lto-wrapper: fatal error: g++-8 returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Code that causes the error can be as simple as
#include <iostream>
int main(int argc, char* argv[]) {
    std::cout << "hi\n";
    return 0;
}

Preprocessed file attached.

g++ version:
% g++-8 --version
g++-8 (Debian 8-20180402-1) 8.0.1 20180402 (experimental) [trunk revision
259004]

% g++-8 -v
Using built-in specs.
COLLECT_GCC=g++-8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8-20180402-1'
--with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-8
--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 --with-sysroot=/ --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
gcc version 8.0.1 20180402 (experimental) [trunk revision 259004] (Debian
8-20180402-1)

The error is only triggered when LTO is used together with -g1 option and
optimizations enabled. With any of -g, -g2, -g3, -g0 options g++ will not error
out. Optimization level can be anything except -O0. The bug cannot be
reproduced with g++-7 (I tried Debian package version 7.3.0-14 SVN 20180401
(r258998) from the gcc-7-branch).

Reply via email to