public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65042] New: gcc5 has a template depth problem that was fine in gcc4
@ 2015-02-12 14:30 karl at kleinpaste dot org
  2015-02-12 15:16 ` [Bug c++/65042] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: karl at kleinpaste dot org @ 2015-02-12 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65042
           Summary: gcc5 has a template depth problem that was fine in
                    gcc4
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: karl at kleinpaste dot org

Created attachment 34740
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34740&action=edit
class description employing layered string- and int-indexed maps-within-maps

Attached is modulecache.hh, part of Xiphos, which was recently involved in a
Fedora gcc5 mass rebuild test for upcoming Fedora 22.  This file exhibits a
template complaint regarding nested std::map usage.  The nesting provides an
intuitive access to data content by allowing subscripting at any map level to
obtain all subordinate content.

The plain fact is that this code has been compiling in gcc4 since approximately
2008.  It was then found that using -ftemplate-depth=128 makes the gcc5
compilation survive, but I don't see why this should be necessary, considering
that the code has been fine for 7 years preceding, without use of any such
modifiers.  Has the default depth limit changed in gcc5?

FYI recommended to file this report by an involved Fedora engineer; I am Xiphos
project admin.

In file included from /usr/include/c++/5.0.0/map:60:0,
                 from ../src/main/modulecache.hh:45,
                 from ../src/main/modulecache.cc:30:
/usr/include/c++/5.0.0/bits/stl_tree.h: In instantiation of 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_destroy_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = int; _Val = std::pair<const int,
ModuleCache::CacheVerse>; _KeyOfValue = std::_Select1st<std::pair<const int,
ModuleCache::CacheVerse> >; _Compare = std::less<int>; _Alloc =
std::allocator<std::pair<const int, ModuleCache::CacheVerse> >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const int, ModuleCache::CacheVerse> >*]':
/usr/include/c++/5.0.0/bits/stl_tree.h:562:17:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_drop_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = int; _Val = std::pair<const int,
ModuleCache::CacheVerse>; _KeyOfValue = std::_Select1st<std::pair<const int,
ModuleCache::CacheVerse> >; _Compare = std::less<int>; _Alloc =
std::allocator<std::pair<const int, ModuleCache::CacheVerse> >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const int, ModuleCache::CacheVerse> >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:1493:16:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = int; _Val = std::pair<const int,
ModuleCache::CacheVerse>; _KeyOfValue = std::_Select1st<std::pair<const int,
ModuleCache::CacheVerse> >; _Compare = std::less<int>; _Alloc =
std::allocator<std::pair<const int, ModuleCache::CacheVerse> >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const int, ModuleCache::CacheVerse> >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:859:17:   required from
'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with
_Key = int; _Val = std::pair<const int, ModuleCache::CacheVerse>; _KeyOfValue =
std::_Select1st<std::pair<const int, ModuleCache::CacheVerse> >; _Compare =
std::less<int>; _Alloc = std::allocator<std::pair<const int,
ModuleCache::CacheVerse> >]'
/usr/include/c++/5.0.0/bits/stl_map.h:96:11:   required from 'void
__gnu_cxx::new_allocator<_Tp>::destroy(__gnu_cxx::new_allocator<_Tp>::pointer)
[with _Tp = std::pair<const int, std::map<int, ModuleCache::CacheVerse> >;
__gnu_cxx::new_allocator<_Tp>::pointer = std::pair<const int, std::map<int,
ModuleCache::CacheVerse> >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:521:9:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_destroy_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = int; _Val = std::pair<const int,
std::map<int, ModuleCache::CacheVerse> >; _KeyOfValue =
std::_Select1st<std::pair<const int, std::map<int, ModuleCache::CacheVerse> >
>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int,
std::map<int, ModuleCache::CacheVerse> > >; std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const
int, std::map<int, ModuleCache::CacheVerse> > >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:562:17:   [ skipping 14 instantiation
contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/c++/5.0.0/bits/stl_tree.h:521:9:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_destroy_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = const std::basic_string<char>; _Val =
std::pair<const std::basic_string<char>, std::map<int, std::map<int,
std::map<int, std::map<int, ModuleCache::CacheVerse> > > > >; _KeyOfValue =
std::_Select1st<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
_Compare = std::less<const std::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:562:17:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_drop_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = const std::basic_string<char>; _Val =
std::pair<const std::basic_string<char>, std::map<int, std::map<int,
std::map<int, std::map<int, ModuleCache::CacheVerse> > > > >; _KeyOfValue =
std::_Select1st<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
_Compare = std::less<const std::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:1493:16:   required from 'void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Link_type) [with _Key = const std::basic_string<char>; _Val =
std::pair<const std::basic_string<char>, std::map<int, std::map<int,
std::map<int, std::map<int, ModuleCache::CacheVerse> > > > >; _KeyOfValue =
std::_Select1st<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
_Compare = std::less<const std::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >*]'
/usr/include/c++/5.0.0/bits/stl_tree.h:859:17:   required from
'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with
_Key = const std::basic_string<char>; _Val = std::pair<const
std::basic_string<char>, std::map<int, std::map<int, std::map<int,
std::map<int, ModuleCache::CacheVerse> > > > >; _KeyOfValue =
std::_Select1st<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >;
_Compare = std::less<const std::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::basic_string<char>, std::map<int,
std::map<int, std::map<int, std::map<int, ModuleCache::CacheVerse> > > > > >]'
/usr/include/c++/5.0.0/bits/stl_map.h:163:14:   required from 'std::map<_Key,
_Tp, _Compare, _Alloc>::map() [with _Key = const std::basic_string<char>; _Tp =
std::map<int, std::map<int, std::map<int, std::map<int,
ModuleCache::CacheVerse> > > >; _Compare = std::less<const
std::basic_string<char> >; _Alloc = std::allocator<std::pair<const
std::basic_string<char>, std::map<int, std::map<int, std::map<int,
std::map<int, ModuleCache::CacheVerse> > > > > >]'
../src/main/modulecache.cc:34:23:   required from here
/usr/include/c++/5.0.0/bits/stl_tree.h:521:22: fatal error: template
instantiation depth exceeds maximum of 25 (use -ftemplate-depth= to increase
the maximum)
       { get_allocator().destroy(__p->_M_valptr()); }
                      ^


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-13 11:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-12 14:30 [Bug c++/65042] New: gcc5 has a template depth problem that was fine in gcc4 karl at kleinpaste dot org
2015-02-12 15:16 ` [Bug c++/65042] " jakub at gcc dot gnu.org
2015-02-12 18:06 ` mcepl at cepl dot eu
2015-02-12 18:15 ` mpolacek at gcc dot gnu.org
2015-02-12 18:17 ` jakub at gcc dot gnu.org
2015-02-12 18:24 ` [Bug libstdc++/65042] " jakub at gcc dot gnu.org
2015-02-12 18:28 ` mpolacek at gcc dot gnu.org
2015-02-13 11:40 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).