From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15395 invoked by alias); 14 Jan 2014 08:49:46 -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 15342 invoked by uid 48); 14 Jan 2014 08:49:41 -0000 From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/59802] New: excessive compile time in loop unswitching Date: Tue, 14 Jan 2014 08:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dcb314 at hotmail dot com 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 attachments.created 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: 2014-01/txt/msg01429.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59802 Bug ID: 59802 Summary: excessive compile time in loop unswitching Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Created attachment 31830 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31830&action=edit gzipped C++ source code I just compiled the attached code with gcc trunk 20140112 on a x86_64 box with flag -O3 and it took over eight minutes. Using only -O2 took a more reasonable 2 minutes 38 seconds. For reference, the redhat version of gcc 482 took 2 minutes 32 seconds for -O3 and 2 minutes 11 seconds for -O2. I can see that for -O2, trunk is using about 30 seconds more CPU time, which is fine, but for -O3 over 5 minutes more. I tried flag -ftime-report and here are all the times > 1%. Execution times (seconds) phase opt and generate : 465.18 (100%) usr 0.50 (57%) sys 468.04 (100%) wall 130935 kB (59%) ggc loop invariant motion : 22.50 ( 5%) usr 0.01 ( 1%) sys 22.85 ( 5%) wall 2 kB ( 0%) ggc loop unswitching : 302.37 (65%) usr 0.01 ( 1%) sys 303.82 (65%) wall 72 kB ( 0%) ggc CPROP : 85.02 (18%) usr 0.09 (10%) sys 85.52 (18%) wall 4445 kB ( 2%) ggc TOTAL : 466.12 0.88 469.55 221219 kB Suggest code rework for trunk for -O3, maybe in the area of loop unswitching. This bug may be a duplicate of bug 38518