FS#45429 - [gcc] internal compiler error: in instantiate_class_template_1, at cp/pt.c:9254

Attached to Project: Arch Linux
Opened by Benny (mail2benny) - Tuesday, 23 June 2015, 11:53 GMT
Last edited by Allan McRae (Allan) - Monday, 29 June 2015, 11:19 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi,

Description:
I found a internal compiler error in gcc-5.1.0.

I have attached the file bug.cc. It runs, if I compile with clang (or gcc-4.9.2) using:

clang++ -std=c++11 -o bug bug.cc

If I compile with gcc (g++) using g++ -std=c++11 -o bug bug.cc I get:

In file included from /usr/include/c++/5.1.0/vector:61:0,
from bug.cc:3:
/usr/include/c++/5.1.0/bits/allocator.h: In instantiation of ‘struct std::allocator<void (*)(void*)>::rebind<void (*)(void*)>’:
/usr/include/c++/5.1.0/bits/alloc_traits.h:48:2: required by substitution of ‘template<class _Alloc2, class _Tp2> static constexpr std::true_type std::__alloctr_rebind_helper<_Alloc, _Tp>::_S_chk(typename _Alloc2::rebind<_Tp2>::other*) [with _Alloc2 = std::allocator<tfuncptr<d> >; _Tp2 = void (*)(void*)]’
/usr/include/c++/5.1.0/bits/alloc_traits.h:55:50: required from ‘class std::__alloctr_rebind_helper<std::allocator<tfuncptr<d> >, void (*)(void*)>’
/usr/include/c++/5.1.0/bits/alloc_traits.h:200:69: required by substitution of ‘template<class _Alloc> template<class _Tp> using rebind_alloc = typename std::__alloctr_rebind<_Alloc, _Tp>::__type [with _Tp = void (*)(void*); _Alloc = std::allocator<tfuncptr<d> >]’
/usr/include/c++/5.1.0/ext/alloc_traits.h:169:65: required from ‘struct __gnu_cxx::__alloc_traits<std::allocator<tfuncptr<d> > >::rebind<void (*)(void*)>’
/usr/include/c++/5.1.0/bits/stl_vector.h:75:28: required from ‘struct std::_Vector_base<void (*)(void*), std::allocator<tfuncptr<d> > >’
/usr/include/c++/5.1.0/bits/stl_vector.h:214:11: required from ‘class std::vector<tfuncptr<d> >’
bug.cc:15:25: required from here
/usr/include/c++/5.1.0/bits/allocator.h:104:16: internal compiler error: in instantiate_class_template_1, at cp/pt.c:9254
struct rebind
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

Not sure if an Arch bug or upstream.

Additional info:
Name : gcc
Version : 5.1.0-4
Description : The GNU Compiler Collection - C and C++ frontends
Architecture : x86_64
URL : http://gcc.gnu.org
Licenses : GPL LGPL FDL custom
Groups : base-devel
Provides : None
Depends On : gcc-libs=5.1.0-4 binutils>=2.25 libmpc
Optional Deps : None
Required By : clang gcc-fortran ghc intel-advisor-xe intel-compiler-base intel-inspector-xe intel-ipp intel-mkl png2ico
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 101.18 MiB
Packager : Allan McRae <allan@archlinux.org>
Build Date : Thu 21 May 2015 11:12:58 AM CEST
Install Date : Mon 22 Jun 2015 05:04:46 PM CEST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature

Steps to reproduce:
1) Download bug.cc attached in this bug report
2) Try to compile it with gcc-5.1.0-4
3) Observe the internal compiler error

Cheers,
Benny
   bug.cc (0.7 KiB)
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 29 June 2015, 11:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  gcc-5.1.0-5
Comment by Benny (mail2benny) - Tuesday, 23 June 2015, 14:15 GMT
Apologies, small change to bug.cc:
* Fixed working with gcc-4.9.2
   bug.cc (0.7 KiB)
Comment by Allan McRae (Allan) - Wednesday, 24 June 2015, 06:47 GMT

Loading...