From patchwork Mon Dec 9 14:54:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 299072 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 91A072C00A9 for ; Tue, 10 Dec 2013 01:54:34 +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:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=Uoi+5JRV35Pw6le5U aSnYJKcmgXfY7yUERVXJt49R0hkU13MpBxICoa6uZZAZXXj/uw/gZ4R1yUjlcR0Y OopAxJB/XaBL2OWaPsYkobJJ9K8aNr+JHw06esQz0rakK/FYkB4/2DMQfLj3fHLh ezW9CBVe4/vPS0VfzL+NTpfOis= 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:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=ZEcAGo0o24Oy3FhuMogjv9q bohw=; b=v0c1ycKwZG7EDDCe8bdNBsUU7mNxXquMSpP4181Inn5BXWUw6MTwusS d0G3Bo5xs8KV0qru0fCu61MEFq7GGGnE7txVUoAkgzLHWVpDP8wZIIS6vKQb+buA J+yEBrrz9IfJYUa9G++nNSZvmpINtdRQ4buwy59J3A33BREaPpIc= Received: (qmail 14233 invoked by alias); 9 Dec 2013 14:54:28 -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 14222 invoked by uid 89); 9 Dec 2013 14:54:27 -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, T_FROM_12LTRDOM autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Dec 2013 14:54:27 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Vq2Ds-0003wO-0q from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Mon, 09 Dec 2013 06:54:12 -0800 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Dec 2013 06:54:11 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Mon, 9 Dec 2013 14:54:09 +0000 Message-ID: <52A5D98A.50603@codesourcery.com> Date: Mon, 9 Dec 2013 15:54:02 +0100 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130926 Thunderbird/17.0.9 MIME-Version: 1.0 To: GCC Patches Subject: [gomp4, 2/23] BImode fixes in combine References: <52A5D8D4.2030803@codesourcery.com> In-Reply-To: <52A5D8D4.2030803@codesourcery.com> We'll be the first port to use BImode and have STORE_FLAG_VALUE==-1. That has exposed some bugs, one of them is in combine where we can end up calling num_sign_bit_copies for a BImode value. However, the return value is always 1 in that case, so it doesn't tell us anything and is going to be misinterpreted by the caller. gcc/ * combine.c (combine_simplify_rtx): Avoid using num_sign_bit_copies for single-bit modes. ------------------------------------------------------------------------ Index: gcc/combine.c =================================================================== --- gcc/combine.c (revision 422344) +++ gcc/combine.c (revision 422345) @@ -5742,10 +5742,14 @@ combine_simplify_rtx (rtx x, enum machin ; else if (STORE_FLAG_VALUE == -1 - && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT - && op1 == const0_rtx - && (num_sign_bit_copies (op0, mode) - == GET_MODE_PRECISION (mode))) + && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT + && op1 == const0_rtx + /* There's always at least one sign bit copy in a + one-bit mode, so the call to num_sign_bit_copies + tells us nothing in that case. */ + && GET_MODE_PRECISION (mode) > 1 + && (num_sign_bit_copies (op0, mode) + == GET_MODE_PRECISION (mode))) return gen_lowpart (mode, expand_compound_operation (op0)); @@ -5765,6 +5769,7 @@ combine_simplify_rtx (rtx x, enum machin && new_code == EQ && GET_MODE_CLASS (mode) == MODE_INT && op1 == const0_rtx && mode == GET_MODE (op0) + && GET_MODE_PRECISION (mode) > 1 && (num_sign_bit_copies (op0, mode) == GET_MODE_PRECISION (mode))) {