From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28631 invoked by alias); 16 Dec 2010 09:31:59 -0000 Received: (qmail 28614 invoked by uid 22791); 16 Dec 2010 09:31:59 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Dec 2010 09:31:55 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/46957] http://blog.regehr.org/archives/320 Example 1 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 16 Dec 2010 09:31:00 -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 X-SW-Source: 2010-12/txt/msg01877.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46957 --- Comment #2 from Jakub Jelinek 2010-12-16 09:31:43 UTC --- Indeed, that's another possibility, could handle even more complex expressions. On the other side, it makes sense to do it only if the initial value is constant and thus we can expect the result is constant too, otherwise we might risk creating too expensive operation instead of the loop (especially when the loop doesn't roll too many times). And we'd need some peel limit for that too, as for a couple of passes until optimizers clean stuff up we could increase number of stmts a lot.