From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20356 invoked by alias); 10 Apr 2009 14:35:02 -0000 Received: (qmail 20218 invoked by uid 48); 10 Apr 2009 14:34:37 -0000 Date: Fri, 10 Apr 2009 14:35:00 -0000 Subject: [Bug target/39726] New: [cond-optab] ColdFire pessimizations on QImode/HImode tests X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bonzini at gnu dot org" 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: 2009-04/txt/msg00932.txt.bz2 unsigned char v; int baz (unsigned char u, unsigned char w) { if ((u - w) & 0x80) v = 1; } Combine does not like as much as for m68k the RTL produced by the optimizers, because of the lack of byte operations: (insn 10 9 11 f.c:5 (set (reg:QI 35) - (and:QI (subreg:QI (reg:SI 34) 3) -(insn 11 10 12 f.c:5 (set (cc0) - (compare (reg:QI 35) (const_int 0 [0x0]))) -1 (nil)) vs. (insn 10 9 11 f.c:5 (set (reg:QI 35) + (subreg:QI (reg:SI 34) 3)) -1 (nil)) + +(insn 11 10 12 f.c:5 (set (reg:SI 36) + (and:SI (subreg:SI (reg:QI 35) 0) (const_int -128 [0xffffff80]))) -1 (nil)) +(insn 12 11 13 f.c:5 (set (reg:QI 37) + (subreg:QI (reg:SI 36) 3)) -1 (nil)) + +(insn 13 12 14 f.c:5 (set (cc0) + (compare (reg:QI 37) (const_int 0 [0x0]))) -1 (nil)) The extra insn 12 is present because of this in dojump.c: 564 /* The RTL optimizers prefer comparisons against pseudos. */ 565 if (GET_CODE (temp) == SUBREG) 566 { 567 /* Compare promoted variables in their promoted mode. */ 568 if (SUBREG_PROMOTED_VAR_P (temp) 569 && REG_P (XEXP (temp, 0))) 570 temp = XEXP (temp, 0); 571 else 572 temp = copy_to_reg (temp); 573 } -- Summary: [cond-optab] ColdFire pessimizations on QImode/HImode tests Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bonzini at gnu dot org OtherBugsDependingO 39714 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39726