From patchwork Fri Jan 17 00:14:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 311894 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 11FF62C0082 for ; Fri, 17 Jan 2014 11:14:52 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=nIcxJsLvZWLkA15G0GOoOn39vO0m/KMiXb8HLYUIZ2wXXbMg9eCYl 3S1LGZuVO79uc1D9VBhM0lQPIoK8YfAnGLbzeHtXEvFfDoHqnirmlC6BrPP78NuY 0g+SPlMRBTNOj0ADjtRcqZF93YS7/oviykfshHratu9IcAzSaiw7pU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=default; bh=IZ20yAFxILaoPl6T0nMRQYjJfZU=; b=w5vsS6eAfFCiuCziyzQwyQ2dJcgI MCwr6hvPCmYyLGZ9N1c26Trfyn1J2rnXVVwjAmb5+lunTOWoqsrTHi/aDTsTENWN 1fmFHzzWCx/XqKA2MsS/Sfa62DZa1bLzuxdZV0UD+fzTURG/AVm6SHUvs/KFm1Z0 TKzCHbDRR2yrt38= Received: (qmail 6477 invoked by alias); 17 Jan 2014 00:14:45 -0000 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 Received: (qmail 6466 invoked by uid 89); 17 Jan 2014 00:14:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: multi.imgtec.com Received: from multi.imgtec.com (HELO multi.imgtec.com) (194.200.65.239) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Jan 2014 00:14:43 +0000 Message-ID: <1389917678.3022.45.camel@ubuntu-sellcey> Subject: Re: [Patch, cilk, C++] Fix cilk testsuite failure From: Steve Ellcey To: Andrew Pinski , Richard Sandiford CC: Jeff Law , GCC Patches Date: Thu, 16 Jan 2014 16:14:38 -0800 In-Reply-To: References: <5676f26c-f6d8-4798-8bdc-2b7b07f08925@BAMAIL02.ba.imgtec.org> <52D77276.80201@redhat.com> <1389904644.3022.32.camel@ubuntu-sellcey> <1389914554.3022.42.camel@ubuntu-sellcey> MIME-Version: 1.0 X-SEF-Processed: 7_3_0_01192__2014_01_17_00_14_41 Here is a new patch to fix c-c++-common/cilk-plus/AN/builtin_func_double2.c on MIPS. When generating code for: (insn:TI 76 79 98 (set (reg:SI 2 $2 [orig:228 D.1939+-3 ] [228]) (if_then_else:SI (ne:SI (reg:CC 67 $fcc0) (const_int 0 [0])) (reg:SI 2 $2 [orig:228 D.1939+-3 ] [228]) (reg:SI 4 $4 [246]))) 609 {*movsi_on_cc} (nil)) The MIPS GCC compiler is generating: movz $4,$6,$fcc0 instead of movf $4,$6,$fcc0 This is because GCC is checking the 'ne' operator mode which is SI instead of the register operand mode which is CC. The not-equal operator is originally generated with a CC mode but it gets changed to SI during the combine optimization phase. This patch fixes the problem by changing the mode check to look at the register operand instead of the operator. It was tested with my mips-mti-linux-gnu target and I verified it fixes the bug and causes no regressions. OK to checkin? Steve Ellcey sellcey@mips.com 2014-01-15 Andrew Pinski Steve Ellcey PR target/59462 * config/mips/mips.c (mips_print_operand): Check operand mode instead of operator mode. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 617391c..60cb8ee 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -8184,7 +8184,7 @@ mips_print_operand (FILE *file, rtx op, int letter) case 't': { int truth = (code == NE) == (letter == 'T'); - fputc ("zfnt"[truth * 2 + (GET_MODE (op) == CCmode)], file); + fputc ("zfnt"[truth * 2 + (GET_MODE (XEXP (op, 0)) == CCmode)], file); } break;