public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/32540]  New: Exponential time behavior in PRE
@ 2007-06-28 20:15 falk at debian dot org
  2007-06-28 20:16 ` [Bug tree-optimization/32540] " falk at debian dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: falk at debian dot org @ 2007-06-28 20:15 UTC (permalink / raw)
  To: gcc-bugs

int f(void);
void acceptloop_th(int *t) {
    int options = 0;
    if (f()) options |= 0x1 << 0;
    if (f()) options |= 0x1 << 1;
    if (f()) options |= 0x1 << 2;
    if (f()) options |= 0x1 << 3;
    if (f()) options |= 0x1 << 4;
    if (f()) options |= 0x1 << 5;
    if (f()) options |= 0x1 << 6;
    if (f()) options |= 0x1 << 7;
    if (f()) options |= 0x1 << 8;
    if (f()) options |= 0x1 << 9;
    if (f()) options |= 0x1 << 10;
    if (f()) options |= 0x1 << 11;
    if (f()) options |= 0x1 << 12;
    if (f()) options |= 0x1 << 13;
    if (f()) options |= 0x1 << 14;
    if (f()) options |= 0x1 << 15;
    if (f()) options |= 0x1 << 16;
    if (f()) options |= 0x1 << 17;
    if (f()) options |= 0x1 << 18;
    if (f()) options |= 0x1 << 19;
    if (f()) options |= 0x1 << 20;
    if (f()) options |= 0x1 << 21;
    if (f()) options |= 0x1 << 22;
    if (f()) options |= 0x1 << 23;
    if (f()) options |= 0x1 << 24;
    if (f()) options |= 0x1 << 25;
    if (f()) options |= 0x1 << 26;
    *t = options;
}

takes many minutes to compile with 4.3. No problem with 4.2. Timing report
shows PRE, and -fno-tree-pre makes it go really fast.

Some timings, where the first number is the number of "if"-lines:
10 gcc -c -O3 mini2.c -DN=$n  0.17s user 0.01s system 97% cpu 0.184 total
11 gcc -c -O3 mini2.c -DN=$n  0.20s user 0.02s system 97% cpu 0.221 total
12 gcc -c -O3 mini2.c -DN=$n  0.28s user 0.01s system 95% cpu 0.306 total
13 gcc -c -O3 mini2.c -DN=$n  0.42s user 0.03s system 97% cpu 0.463 total
14 gcc -c -O3 mini2.c -DN=$n  0.76s user 0.02s system 97% cpu 0.805 total
15 gcc -c -O3 mini2.c -DN=$n  1.52s user 0.03s system 97% cpu 1.604 total
16 gcc -c -O3 mini2.c -DN=$n  3.24s user 0.07s system 97% cpu 3.396 total
17 gcc -c -O3 mini2.c -DN=$n  7.00s user 0.12s system 97% cpu 7.314 total
18 gcc -c -O3 mini2.c -DN=$n  15.01s user 0.21s system 96% cpu 15.748 total
19 gcc -c -O3 mini2.c -DN=$n  33.21s user 0.49s system 94% cpu 35.600 total
20 gcc -c -O3 mini2.c -DN=$n  76.29s user 0.87s system 96% cpu 1:19.94 total

I'll also attach the original source this test case was extracted from.


-- 
           Summary: Exponential time behavior in PRE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: compile-time-hog
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org


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


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

end of thread, other threads:[~2007-11-05 15:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-28 20:15 [Bug tree-optimization/32540] New: Exponential time behavior in PRE falk at debian dot org
2007-06-28 20:16 ` [Bug tree-optimization/32540] " falk at debian dot org
2007-06-28 20:25 ` [Bug tree-optimization/32540] [4.3 Regression] " rguenth at gcc dot gnu dot org
2007-06-29 18:59 ` mmitchel at gcc dot gnu dot org
2007-06-30 14:16 ` dberlin at gcc dot gnu dot org
2007-06-30 14:17 ` dberlin at gcc dot gnu dot org
2007-09-24 20:18 ` falk at debian dot org
2007-10-20  8:03 ` tbm at cyrius dot com
2007-10-20 10:15 ` rguenth at gcc dot gnu dot org
2007-10-20 20:49 ` dberlin at dberlin dot org
2007-10-20 20:52 ` rguenther at suse dot de
2007-11-01 15:26 ` rguenth at gcc dot gnu dot org
2007-11-01 21:16 ` jakub at gcc dot gnu dot org
2007-11-01 21:24 ` dberlin at dberlin dot org
2007-11-03  5:19 ` sebpop at gmail dot com
2007-11-03  5:26 ` sebpop at gmail dot com
2007-11-03  5:54 ` sebpop at gmail dot com
2007-11-05 15:42 ` spop at gcc dot gnu dot org
2007-11-05 15:45 ` spop at gcc dot gnu dot 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).