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

            Bug ID: 88537
           Summary: class nontype template parameter debug mode crash in
                    dwarf2out.c
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanicka at hanicka dot net
  Target Milestone: ---

Created attachment 45253
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45253&action=edit
minimal example which will crash with enabled debug symbols

I found that gcc is crashing in

gcc9crash.cpp:13:1: internal compiler error: in tree_add_const_value_attribute,
at dwarf2out.c:20243

when I tried to emit debug symbols in a program with a "class nontype template
parameter"

Crashing code is attached. You can see it also here:
https://gcc.godbolt.org/z/NOkj54

Compilation with:

g++-HEAD gcc9crash.cpp -std=c++2a -ggdb -v

Using built-in specs.
COLLECT_GCC=g++-HEAD
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/HEAD-0edf78b/libexec/gcc/x86_64-apple-darwin18.2.0/9.0.0/lto-wrapper
Target: x86_64-apple-darwin18.2.0
Configured with: ../configure --build=x86_64-apple-darwin18.2.0
--prefix=/usr/local/Cellar/gcc/HEAD-0edf78b
--libdir=/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD --disable-nls
--enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran,d
--program-suffix=-HEAD --with-gmp=/usr/local/opt/gmp
--with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc
--with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew
GCC HEAD-0edf78b'
--with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--disable-multilib --with-native-system-header-dir=/usr/include
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
gcc version 9.0.0 20181212 (experimental) (Homebrew GCC HEAD-0edf78b) 
COLLECT_GCC_OPTIONS='-std=c++2a' '-ggdb' '-v' '-mmacosx-version-min=10.14.0'
'-asm_macosx_version_min=10.14' '-shared-libgcc' '-mtune=core2'

/usr/local/Cellar/gcc/HEAD-0edf78b/libexec/gcc/x86_64-apple-darwin18.2.0/9.0.0/cc1plus
-quiet -v -D__DYNAMIC__ gcc9crash.cpp -fPIC -quiet -dumpbase gcc9crash.cpp
-mmacosx-version-min=10.14.0 -mtune=core2 -auxbase gcc9crash -ggdb -std=c++2a
-version -o /var/folders/dv/kkg4z5lj0g52m8q8mm0wk6rw0000gn/T//ccQG2L7F.s
GNU C++17 (Homebrew GCC HEAD-0edf78b) version 9.0.0 20181212 (experimental)
(x86_64-apple-darwin18.2.0)
        compiled by GNU C version 9.0.0 20181212 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory
"/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../x86_64-apple-darwin18.2.0/include"
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0

/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0/x86_64-apple-darwin18.2.0

/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0/backward

/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/include

/usr/local/Cellar/gcc/HEAD-0edf78b/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/include-fixed
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
End of search list.
GNU C++17 (Homebrew GCC HEAD-0edf78b) version 9.0.0 20181212 (experimental)
(x86_64-apple-darwin18.2.0)
        compiled by GNU C version 9.0.0 20181212 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 6936071dc75afe7297cddcec7cf6ee71
gcc9crash.cpp:13:1: internal compiler error: in tree_add_const_value_attribute,
at dwarf2out.c:20243
   13 | }
      | ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.

Reply via email to