From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19382 invoked by alias); 27 Dec 2013 23:58:17 -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 19361 invoked by uid 48); 27 Dec 2013 23:58:12 -0000 From: "ivanov.maxim at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code Date: Fri, 27 Dec 2013 23:58: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ivanov.maxim at gmail dot com 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 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: 2013-12/txt/msg02281.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614 Bug ID: 59614 Summary: [4.9 regression] Explostion in compile time of heavily templated code Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ivanov.maxim at gmail dot com 4.9 takes forever to compile code, which compiles in 9 seconds by version 4.8.2. gdb shows that g++ spends time in "mark_type_abi_tags" function, which was introduced in http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9181c3d9ceed054efd8488eaea91d89353bb8d21 If I read patch correctly, 4.9 visits all template arguments recursively for every template instantiation, but 4.8 didn't, at least not in "check_abi_tags". I created following somewhat pathological, but still correct test case, with help of Boost.MPL and Boost.Fusion, to make very deep template with high number of occurrences of same templates in different parts of that template tree, you can find it in this ticket attachment (had to compress it, otherwise it wouldn't fit into bugzilla's 1000K size limit). Version I was testing on is: GNU C++ (SUSE Linux) version 4.9.0 20131210 [trunk revision 205857] (x86_64-suse-linux) compiled by GNU C version 4.9.0 20131210 [trunk revision 205857], GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0 Thank you for your time.