From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 416 invoked by alias); 13 Oct 2012 16:18:18 -0000 Received: (qmail 374 invoked by uid 48); 13 Oct 2012 16:18:04 -0000 From: "rearnsha at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54829] bad optimization: sub followed by cmp w/ zero (x86 & ARM) Date: Sat, 13 Oct 2012 16:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rearnsha 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 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: 2012-10/txt/msg01272.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54829 --- Comment #6 from Richard Earnshaw 2012-10-13 16:18:03 UTC --- Note also that flag setting behaviour of the PPC instruction essentially is a comparison of the result against zero. On ARM the flags are set as if the two input operands were compared; that's not the same as comparing the result with zero.