From patchwork Wed Nov 19 20:34:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 412499 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 C72A3140139 for ; Thu, 20 Nov 2014 07:34:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=bDqYdMyx9jXr8RYkJutmeaEdDYIH3ac+5Le1D5iNFR+r9U 0P7Q2gLPQn1nuxZebyC0c/Xvpgu9efRkCTGN2VZ1C+EEtTW6scTwf3489beXIgno 0Xov6IolQMf4p/7QJ558WsytyZMP1OesEwEzOAp2gF97hDWL0jFSkzvGyLobI= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=OpvNMGiRJ0cZFAkPSGbwhctJknU=; b=DzvwkF5bSKWV0joQKNoQ NLrOInytfoQZlrshLrFneLUrc03K5V2/dYtA91J848p4Rdu/3qw/rQgwkfRVwk4p VhWRVdaYIPuiU9RUfwL3R56CM7fsaepI3Tqqv1yVK4pnAlN6vJnkTjDm+Hw4uMs/ n9eFDgJ3s6qjzba4EMjM+5k= Received: (qmail 19662 invoked by alias); 19 Nov 2014 20:34:16 -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 19637 invoked by uid 89); 19 Nov 2014 20:34:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f176.google.com Received: from mail-lb0-f176.google.com (HELO mail-lb0-f176.google.com) (209.85.217.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 19 Nov 2014 20:34:13 +0000 Received: by mail-lb0-f176.google.com with SMTP id p9so176010lbv.35 for ; Wed, 19 Nov 2014 12:34:10 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.43.197 with SMTP id y5mr4397120lal.82.1416429250204; Wed, 19 Nov 2014 12:34:10 -0800 (PST) Received: by 10.152.127.168 with HTTP; Wed, 19 Nov 2014 12:34:10 -0800 (PST) Date: Wed, 19 Nov 2014 21:34:10 +0100 Message-ID: Subject: [PATCH, i386]: Fix PR 63947, Wrong fcmov suffix From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Hello! Carry flag checks from overflow tests can propagate into FP cmove instructions. However, while "c" and "nc" suffixes are allowed as suffixes in integer cmove insns, they are not allowed in FP cmove insns. Patch generates equivalent "b" and "nb" suffixes for FP mode. 2014-11-19 Uros Bizjak PR target/63947 * config/i386/i386.c (put_condition_code) : Output "b" and "nb" suffix for FP mode. testsuite/ChangeLog: 2014-11-19 Uros Bizjak PR target/63947 * gcc.target/i386/pr63947.c: New test. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Patch was committed to mainline SVN and will be backported to all active branches. Uros. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 217789) +++ config/i386/i386.c (working copy) @@ -14953,7 +14953,7 @@ put_condition_code (enum rtx_code code, machine_mo if (mode == CCmode) suffix = "b"; else if (mode == CCCmode) - suffix = "c"; + suffix = fp ? "b" : "c"; else gcc_unreachable (); break; @@ -14976,9 +14976,9 @@ put_condition_code (enum rtx_code code, machine_mo break; case GEU: if (mode == CCmode) - suffix = fp ? "nb" : "ae"; + suffix = "nb"; else if (mode == CCCmode) - suffix = "nc"; + suffix = fp ? "nb" : "nc"; else gcc_unreachable (); break; Index: testsuite/gcc.target/i386/pr63947.c =================================================================== --- testsuite/gcc.target/i386/pr63947.c (revision 0) +++ testsuite/gcc.target/i386/pr63947.c (working copy) @@ -0,0 +1,9 @@ +/* PR target/63947 */ +/* { dg-do assemble } */ +/* { dg-options "-Os" } */ +/* { dg-additional-options "-march=i686" { target ia32 } } */ + +long double foo (unsigned a, unsigned b) +{ + return a + b < a; +}