From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30204 invoked by alias); 5 Sep 2013 02:00:59 -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 30137 invoked by uid 48); 5 Sep 2013 02:00:54 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58318] New: very slow compilation on x86_64-linux with -O3 and -g Date: Thu, 05 Sep 2013 02:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu 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-09/txt/msg00243.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58318 Bug ID: 58318 Summary: very slow compilation on x86_64-linux with -O3 and -g Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code takes much longer to compile with both -O3 and -g on using the current gcc trunk on x86_64-linux (in both 32-bit and 64-bit modes). 4.8 is considerably faster than the trunk, while 4.6 and 4.7 are much slower. For reference, I also included the times for clang and icc. $ 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.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --enable-languages=c,c++,objc,obj-c++,fortran,lto --with-gmp=/usr/local/gcc-trunk --with-mpfr=/usr/local/gcc-trunk --with-mpc=/usr/local/gcc-trunk --with-cloog=/usr/local/gcc-trunk --prefix=/usr/local/gcc-trunk Thread model: posix gcc version 4.9.0 20130904 (experimental) [trunk revision 202240] (GCC) $ $ $ time gcc-trunk -O3 reduced.c 0.06user 0.00system 0:00.23elapsed 30%CPU (0avgtext+0avgdata 51792maxresident)k 0inputs+32outputs (0major+7258minor)pagefaults 0swaps $ $ $ time gcc-trunk -O3 -g reduced.c 11.70user 0.68system 0:18.93elapsed 65%CPU (0avgtext+0avgdata 1133520maxresident)k 0inputs+64outputs (0major+297028minor)pagefaults 0swaps $ $ $ time gcc-4.8 -O3 -g reduced.c 0.89user 0.12system 0:01.54elapsed 65%CPU (0avgtext+0avgdata 487552maxresident)k 0inputs+64outputs (0major+50913minor)pagefaults 0swaps $ $ $ time gcc-4.7 -O3 -g reduced.c 84.09user 0.10system 1:57.58elapsed 71%CPU (0avgtext+0avgdata 580944maxresident)k 0inputs+64outputs (0major+41887minor)pagefaults 0swaps $ $ $ time gcc-4.6 -O3 -g reduced.c 83.83user 0.16system 2:00.92elapsed 69%CPU (0avgtext+0avgdata 558864maxresident)k 0inputs+64outputs (0major+40733minor)pagefaults 0swaps $ $ $ time clang-trunk -O3 -g reduced.c 0.02user 0.00system 0:00.09elapsed 34%CPU (0avgtext+0avgdata 52064maxresident)k 0inputs+40outputs (0major+6282minor)pagefaults 0swaps $ $ $ time icc -O3 -g reduced.c 0.26user 2.39system 0:04.07elapsed 65%CPU (0avgtext+0avgdata 84000maxresident)k 1424inputs+184outputs (14major+16463minor)pagefaults 0swaps $ $ ------------------------------------- int a, b, c, d; int *foo (int *r, short s, short t) { return &c; } short bar (int p) { int t = 0; for (a = 0; a < 8; a++) for (b = 0; b < 8; b++) for (p = 0; p < 8; p++) for (d = 0; d < 8; d++) foo (&t, p, d); bar (0); return 0; } int main () { return 0; }