public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code
@ 2013-12-27 23:58 ivanov.maxim at gmail dot com
  2013-12-27 23:59 ` [Bug c++/59614] " ivanov.maxim at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ivanov.maxim at gmail dot com @ 2013-12-27 23:58 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
@ 2013-12-27 23:59 ` ivanov.maxim at gmail dot com
  2013-12-28  0:06 ` ivanov.maxim at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ivanov.maxim at gmail dot com @ 2013-12-27 23:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

--- Comment #1 from Maxim Ivanov <ivanov.maxim at gmail dot com> ---
Created attachment 31526
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31526&action=edit
example of templated code which takes forever to compile by 4.9


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
  2013-12-27 23:59 ` [Bug c++/59614] " ivanov.maxim at gmail dot com
@ 2013-12-28  0:06 ` ivanov.maxim at gmail dot com
  2013-12-28  0:38 ` steven at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ivanov.maxim at gmail dot com @ 2013-12-28  0:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

--- Comment #2 from Maxim Ivanov <ivanov.maxim at gmail dot com> ---
Oh, g++ cmdline arguments are just "-std=c++11 -save-temps"


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
  2013-12-27 23:59 ` [Bug c++/59614] " ivanov.maxim at gmail dot com
  2013-12-28  0:06 ` ivanov.maxim at gmail dot com
@ 2013-12-28  0:38 ` steven at gcc dot gnu.org
  2014-01-07 11:53 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2013-12-28  0:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |compile-time-hog
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-12-28
                 CC|                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Steven Bosscher <steven at gcc dot gnu.org> ---
Classic case of quadratic behavior. 
Why do even experienced developers continue to add this kind of
obvious bottle-necks?!


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
                   ` (2 preceding siblings ...)
  2013-12-28  0:38 ` steven at gcc dot gnu.org
@ 2014-01-07 11:53 ` rguenth at gcc dot gnu.org
  2014-01-07 22:14 ` jason at gcc dot gnu.org
  2014-01-08 19:00 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-07 11:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
                   ` (3 preceding siblings ...)
  2014-01-07 11:53 ` rguenth at gcc dot gnu.org
@ 2014-01-07 22:14 ` jason at gcc dot gnu.org
  2014-01-08 19:00 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-07 22:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


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

* [Bug c++/59614] [4.9 regression] Explostion in compile time of heavily templated code
  2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
                   ` (4 preceding siblings ...)
  2014-01-07 22:14 ` jason at gcc dot gnu.org
@ 2014-01-08 19:00 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-08 19:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59614

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-01-08 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-27 23:58 [Bug c++/59614] New: [4.9 regression] Explostion in compile time of heavily templated code ivanov.maxim at gmail dot com
2013-12-27 23:59 ` [Bug c++/59614] " ivanov.maxim at gmail dot com
2013-12-28  0:06 ` ivanov.maxim at gmail dot com
2013-12-28  0:38 ` steven at gcc dot gnu.org
2014-01-07 11:53 ` rguenth at gcc dot gnu.org
2014-01-07 22:14 ` jason at gcc dot gnu.org
2014-01-08 19:00 ` jason 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).