From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4665 invoked by alias); 1 Feb 2011 11:28:12 -0000 Received: (qmail 4655 invoked by uid 22791); 1 Feb 2011 11:28:11 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_KD 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; Tue, 01 Feb 2011 11:28:07 +0000 From: "rakdver at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45122] [4.6 Regression] -funsafe-loop-optimizations causes FAIL: gcc.c-torture/execute/pr27285.c execution 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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rakdver at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: aoliva at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 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: Tue, 01 Feb 2011 11:28: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: 2011-02/txt/msg00057.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45122 --- Comment #16 from Zdenek Dvorak 2011-02-01 11:27:13 UTC --- (In reply to comment #15) > Ah, the reason why pr19210-* fail is that those loops have non-const/pure call > in it. So, while single_exit (loop) == exit, loop_only_exit_p (loop, exit) > still returns false. > So, the question is if we really need to give up on -funsafe-loop-optimizations > whenever loop_only_exit_p (loop, exit), or if a single_exit (loop) == exit > test would be sufficient for that. I believe single_exit (loop) test would sufficiently match the expectations of -funsafe-loop-optimizations. This would misscompile code like while (b) { foo(b); b -= 8; } in the case that b is not divisible by 8, on the assumption that there are no nontrivial infinite loops; which seems reasonable.