From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10947 invoked by alias); 15 Feb 2014 10:59:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 10916 invoked by uid 48); 15 Feb 2014 10:59:18 -0000 From: "florent.hivert at lri dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60210] New: segfault when trying to use a const template using Date: Sat, 15 Feb 2014 10:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: florent.hivert at lri dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg01390.txt.bz2 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 struct S {}; template using constS = const S; template void FOO(constS 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 void FOO(constS a) {}