public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/62016] New: very slow compilation at -O3 on x86_64-linux-gnu
@ 2014-08-05  5:12 su at cs dot ucdavis.edu
  2014-08-05  9:07 ` [Bug ipa/62016] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-08-05  5:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62016

            Bug ID: 62016
           Summary: very slow compilation at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following test case takes the current gcc trunk much longer to compile at
-O3 on x86_64-linux (in both 32-bit and 64-bit modes). 

It also affects gcc 4.8.x and 4.9.x, and is a regression from 4.7.x. 

This is likely due to the inliner as the code compiles fine with -fno-inline.  

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140804 (experimental) [trunk revision 213529] (GCC) 
$ 
$ time gcc-trunk -O2 small.c    
0.02user 0.01system 0:00.28elapsed 15%CPU (0avgtext+0avgdata 50912maxresident)k
0inputs+32outputs (1major+6643minor)pagefaults 0swaps
$ time gcc-4.7 -O3 small.c
0.11user 0.02system 0:00.71elapsed 19%CPU (0avgtext+0avgdata 65344maxresident)k
0inputs+32outputs (1major+7683minor)pagefaults 0swaps
$ 
$ time gcc-trunk -O3 -fno-inline small.c
0.04user 0.01system 0:00.47elapsed 12%CPU (0avgtext+0avgdata 51776maxresident)k
0inputs+32outputs (1major+6709minor)pagefaults 0swaps
$ 
$ time gcc-trunk -O3 small.c
8.43user 0.28system 0:34.83elapsed 25%CPU (0avgtext+0avgdata
1622880maxresident)k
0inputs+32outputs (1major+106347minor)pagefaults 0swaps
$ 


----------------------------------


#include <assert.h>

int a, b, c, d, e, f, g, h, i, j;

void
fn1 (int *p1, int *p2)
{
  for (; a; a++)
    {
      assert (p1 == 0);
      fn1 (0, p2);
      fn1 (&i, &b);
      fn1 (&f, 0);
    }
}

void
fn2 ()
{
  fn1 (&c, 0);
  fn1 (&d, 0);
  fn1 (&e, 0);
  fn1 (&g, 0);
  fn1 (&h, 0);
  fn1 (&j, 0);
}

int 
main ()
{
  fn2 (); 
  return 0; 
}


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

end of thread, other threads:[~2015-06-26 20:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05  5:12 [Bug ipa/62016] New: very slow compilation at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-08-05  9:07 ` [Bug ipa/62016] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
2014-08-05  9:08 ` rguenth at gcc dot gnu.org
2014-08-05  9:11 ` trippels at gcc dot gnu.org
2014-08-07 20:50 ` hubicka at gcc dot gnu.org
2014-08-11  9:10 ` jakub at gcc dot gnu.org
2014-08-11 10:44 ` jakub at gcc dot gnu.org
2014-11-24 13:04 ` [Bug ipa/62016] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2014-12-19 13:28 ` jakub at gcc dot gnu.org
2014-12-19 21:19 ` hubicka at gcc dot gnu.org
2015-01-16  7:19 ` hubicka at gcc dot gnu.org
2015-01-16  9:34 ` [Bug ipa/62016] [4.8/4.9 " rguenth at gcc dot gnu.org
2015-06-23  8:19 ` rguenth at gcc dot gnu.org
2015-06-26 19:56 ` [Bug ipa/62016] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:28 ` jakub 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).