From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1956 invoked by alias); 26 Jun 2011 20:49:08 -0000 Received: (qmail 1947 invoked by uid 22791); 26 Jun 2011 20:49:07 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_EG,TW_LR 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; Sun, 26 Jun 2011 20:48:53 +0000 From: "oleg.endo@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49468] SH Target: inefficient integer abs code X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: oleg.endo@t-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Attachment #24560 is obsolete 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: Sun, 26 Jun 2011 20:49: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-06/txt/msg02259.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49468 Oleg Endo changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24560|0 |1 is obsolete| | --- Comment #4 from Oleg Endo 2011-06-26 20:48:19 UTC --- Created attachment 24603 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24603 Proposed patch Thanks for checking. I missed to tell the expanders that the T bit is clobbered by insns such as negdi2 and abssi2 / absdi2. The negdi2 expander that I have changed caused the libstdc++ tests to fail when formatting a -1LL. Another (reduced) example: long long x (long long i, int j, long long k) { if (j & 5) return -i; return -k; } ..ended up as (the "j & 5" got lost)... mov.l @(4,r15),r1 clrt mov.l @r15,r2 negc r1,r1 negc r2,r0 bt/s .L8 clrt negc r5,r1 negc r4,r0 .L8: rts nop