[Bug c++/60210] New: segfault when trying to use a const template using

florent.hivert at lri dot fr gcc-bugzilla@gcc.gnu.org
Sat Feb 15 10:59:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60210

            Bug ID: 60210
           Summary: segfault when trying to use a const template using
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: florent.hivert at lri dot fr

Created attachment 32143
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32143&action=edit
preprocessed code

The following code triggers a segfault:

   template <typename T> struct S {};
   template <typename T> using constS = const S<T>;
   template <typename T> void FOO(constS<T> a) {}

If const is removed the problem disappear. Follows the full log. I also got the
same problem with various version of g++.



g++ -v -save-temps -Wall -Wextra -std=c++11 bug3.cpp -o bug3
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--program-suffix=-4.8 --enable-linux-futex --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-std=c++11' '-o'
'bug3' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-suse-linux/4.8/cc1plus -E -quiet -v -D_GNU_SOURCE
bug3.cpp -mtune=generic -march=x86-64 -std=c++11 -Wall -Wextra -fpch-preprocess
-o bug3.ii
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.8
 /usr/include/c++/4.8/x86_64-suse-linux
 /usr/include/c++/4.8/backward
 /usr/lib64/gcc/x86_64-suse-linux/4.8/include
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed
 /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-std=c++11' '-o'
'bug3' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-suse-linux/4.8/cc1plus -fpreprocessed bug3.ii -quiet
-dumpbase bug3.cpp -mtune=generic -march=x86-64 -auxbase bug3 -Wall -Wextra
-std=c++11 -version -o bug3.s
GNU C++ (SUSE Linux) version 4.8.1 20130909 [gcc-4_8-branch revision 202388]
(x86_64-suse-linux)
        compiled by GNU C version 4.8.1 20130909 [gcc-4_8-branch revision
202388], GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (SUSE Linux) version 4.8.1 20130909 [gcc-4_8-branch revision 202388]
(x86_64-suse-linux)
        compiled by GNU C version 4.8.1 20130909 [gcc-4_8-branch revision
202388], GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8f4f3cbd488ac89b0f495172228a1742
bug3.cpp:3:40: internal compiler error: Segmentation fault
 template <typename T> void FOO(constS<T> a) {}



More information about the Gcc-bugs mailing list