From patchwork Tue Jul 20 18:38:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 59352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F336FB6F0E for ; Wed, 21 Jul 2010 04:39:02 +1000 (EST) Received: (qmail 28657 invoked by alias); 20 Jul 2010 18:39:00 -0000 Received: (qmail 28646 invoked by uid 22791); 20 Jul 2010 18:38:59 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Jul 2010 18:38:55 +0000 Received: (qmail 20066 invoked from network); 20 Jul 2010 18:38:54 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Jul 2010 18:38:54 -0000 Date: Tue, 20 Jul 2010 11:38:53 -0700 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Subject: [rs6000,committed] fix abs_isel patterns Message-ID: <20100720183853.GK26037@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org While debugging other problems, I noticed that my isel patch: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01298.html was causing ICEs when compiling libgcc. After making the isel patterns only accept lt/eq/gt comparison codes, the *abs2_isel splitters split to RTL that's not recognizable. (This should have shown up when compiling libgcc for powerpc-eabispe, but doesn't because the default processor for that target isn't an isel-capable processor...patch forthcoming.) Fixed with the below patch, which reverses the sense of the condition in the patterns, along with the operands. Applied as obvious after testing on powerpc-eabispe. -Nathan * config/rs6000/rs6000.md (abs2_isel, nabs2_isel): Reverse sense of if_then_else condition. Index: config/rs6000/rs6000.md =================================================================== --- config/rs6000/rs6000.md (revision 162343) +++ config/rs6000/rs6000.md (working copy) @@ -2105,10 +2105,10 @@ (define_insn_and_split "abs2_isel" (compare:CC (match_dup 1) (const_int 0))) (set (match_dup 0) - (if_then_else:GPR (ge (match_dup 3) + (if_then_else:GPR (lt (match_dup 3) (const_int 0)) - (match_dup 1) - (match_dup 2)))] + (match_dup 2) + (match_dup 1)))] "") (define_insn_and_split "nabs2_isel" @@ -2124,10 +2124,10 @@ (define_insn_and_split "nabs2_isel (compare:CC (match_dup 1) (const_int 0))) (set (match_dup 0) - (if_then_else:GPR (ge (match_dup 3) + (if_then_else:GPR (lt (match_dup 3) (const_int 0)) - (match_dup 2) - (match_dup 1)))] + (match_dup 1) + (match_dup 2)))] "") (define_insn_and_split "abssi2_nopower"