From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13361 invoked by alias); 12 Feb 2015 14:30:50 -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 13323 invoked by uid 48); 12 Feb 2015 14:30:46 -0000 From: "karl at kleinpaste dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65042] New: gcc5 has a template depth problem that was fine in gcc4 Date: Thu, 12 Feb 2015 14:30: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: karl at kleinpaste dot org 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: 2015-02/txt/msg01369.txt.bz2 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; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node >*]': /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; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node >*]' /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; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node >*]' /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; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >]' /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 >; __gnu_cxx::new_allocator<_Tp>::pointer = std::pair >*]' /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 >; _KeyOfValue = std::_Select1st > >; _Compare = std::less; _Alloc = std::allocator > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node > >*]' /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; _Val = std::pair, std::map > > > >; _KeyOfValue = std::_Select1st, std::map > > > > >; _Compare = std::less >; _Alloc = std::allocator, std::map > > > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node, std::map > > > > >*]' /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; _Val = std::pair, std::map > > > >; _KeyOfValue = std::_Select1st, std::map > > > > >; _Compare = std::less >; _Alloc = std::allocator, std::map > > > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node, std::map > > > > >*]' /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; _Val = std::pair, std::map > > > >; _KeyOfValue = std::_Select1st, std::map > > > > >; _Compare = std::less >; _Alloc = std::allocator, std::map > > > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node, std::map > > > > >*]' /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; _Val = std::pair, std::map > > > >; _KeyOfValue = std::_Select1st, std::map > > > > >; _Compare = std::less >; _Alloc = std::allocator, std::map > > > > >]' /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; _Tp = std::map > > >; _Compare = std::less >; _Alloc = std::allocator, std::map > > > > >]' ../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()); } ^