https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67354
Bug ID: 67354 Summary: internal compiler error: in add_to_same_comdat_group, at symtab.c:421 Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bgreen0 at gmail dot com Target Milestone: --- Created attachment 36255 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36255&action=edit preprocessor output The attached preprocessed code generates an internal compiler error when compiled with the -Os option. Tested with g++ 5.1 and 5.2. Preprocessed file attached. Here is the command line out output: $ g++ -v -save-temps -std=gnu++11 -Wall -Wextra -Os -c -o gccbug.o gccbug.cpp Using built-in specs. COLLECT_GCC=g++ Target: x86_64-unknown-linux-gnu Configured with: /build/gcc-multilib/src/gcc-5.2.0/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --with-default-libstdcxx-abi=gcc4-compatible Thread model: posix gcc version 5.2.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++11' '-Wall' '-Wextra' '-Os' '-c' '-o' 'gccbug.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/cc1plus -E -quiet -v -D_GNU_SOURCE gccbug.cpp -mtune=generic -march=x86-64 -std=gnu++11 -Wall -Wextra -Os -fpch-preprocess -o gccbug.ii ignoring nonexistent directory "/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0 /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/x86_64-unknown-linux-gnu /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/backward /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include /usr/local/include /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++11' '-Wall' '-Wextra' '-Os' '-c' '-o' 'gccbug.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/cc1plus -fpreprocessed gccbug.ii -quiet -dumpbase gccbug.cpp -mtune=generic -march=x86-64 -auxbase-strip gccbug.o -Os -Wall -Wextra -std=gnu++11 -version -o gccbug.s GNU C++11 (GCC) version 5.2.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.2.0, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++11 (GCC) version 5.2.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.2.0, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 18422b8e6e00646fd4f8fbf484d27148 gccbug.cpp: In instantiation of ‘Test::Test(Args&& ...) [with Args = {}]’: /usr/include/c++/5.2.0/ext/new_allocator.h:120:4: required from ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Test; _Args = {}; _Tp = Test]’ /usr/include/c++/5.2.0/bits/alloc_traits.h:256:4: required from ‘static std::_Require<typename std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::type> std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Test; _Args = {}; _Alloc = std::allocator<Test>; std::_Require<typename std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::type> = void]’ /usr/include/c++/5.2.0/bits/alloc_traits.h:402:16: required from ‘static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Test; _Args = {}; _Alloc = std::allocator<Test>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]’ /usr/include/c++/5.2.0/bits/shared_ptr_base.h:522:39: required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {}; _Tp = Test; _Alloc = std::allocator<Test>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’ /usr/include/c++/5.2.0/bits/shared_ptr_base.h:617:4: required from ‘std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Test; _Alloc = std::allocator<Test>; _Args = {}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’ /usr/include/c++/5.2.0/bits/shared_ptr_base.h:1097:35: required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Test>; _Args = {}; _Tp = Test; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’ /usr/include/c++/5.2.0/bits/shared_ptr.h:319:64: required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Test>; _Args = {}; _Tp = Test]’ /usr/include/c++/5.2.0/bits/shared_ptr.h:614:39: required from ‘std::shared_ptr<_Tp1> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Test; _Alloc = std::allocator<Test>; _Args = {}]’ /usr/include/c++/5.2.0/bits/shared_ptr.h:629:39: required from ‘std::shared_ptr<_Tp1> std::make_shared(_Args&& ...) [with _Tp = Test; _Args = {}]’ gccbug.cpp:13:33: required from here gccbug.cpp:10:2: internal compiler error: in add_to_same_comdat_group, at symtab.c:421 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions.