public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/48732] New: Nested loops with small iteration count gobble time in "tree reassociation"
@ 2011-04-22 19:10 arthur.j.odwyer at gmail dot com
  2011-04-23  9:15 ` [Bug tree-optimization/48732] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2011-04-22 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Nested loops with small iteration count gobble time in
                    "tree reassociation"
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arthur.j.odwyer@gmail.com


Created attachment 24076
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24076
Output of "gcc-4.5 -w -O1 -S test.c -Q -v"

The following test case takes inordinately long to compile on my machine
(Ubuntu 10.10, 64-bit), starting with gcc-4.5.

cat >test.c <<EOF
void func_47()
{
  int a, b, c, d, e;
  for (a=0; a < 8; ++a) {
    for (b=0; b < 8; ++b) {
      for (c=0; c < 8; ++c) {
        for (d=0; d < 8; ++d) {
          int l_752[8];
          int j;
          for (j = 0; j < 8; j++)
            l_752[j] = 0;
        }
      }
    }
  }
}
EOF
time gcc -w -O1 -S test.c -Q

On my machine, the timings are as follows:
With gcc-4.4: real 0.027s
With gcc-4.5: real 5.801s, spent 94% of that time in "tree reassociation"
With trunk:   real 3.567s, spent 77% of that time in "tree reassociation"

The only difference in the assembly output is that gcc-4.4 uses "ret" and
gcc-4.5 uses "rep ret".
Adding a fifth nested loop with 8 iterations makes compilation take more than
300 seconds; I killed it at that point.


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

end of thread, other threads:[~2014-06-24 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-22 19:10 [Bug tree-optimization/48732] New: Nested loops with small iteration count gobble time in "tree reassociation" arthur.j.odwyer at gmail dot com
2011-04-23  9:15 ` [Bug tree-optimization/48732] " rguenth at gcc dot gnu.org
2011-04-26 12:17 ` rguenth at gcc dot gnu.org
2014-06-24 10:53 ` rguenth 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).