From patchwork Wed Mar 15 23:09:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pat Haugen X-Patchwork-Id: 739467 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 3vk6lC35pBz9rxl for ; Thu, 16 Mar 2017 10:10:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="U383xsI8"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=WkAm4 51zZHcEBN0ZKpy5YoESI/1i7GMIjDoEg3u4MIUrRiZ55k+fqiJ0SW2TeGU4w7PD8 h30N34dSE6xa5pTphurZfTOvJGDk2J4U/NAFc8QvzmF/zg7iTlyo80C5Ltf1Nf7B ZCMqfN6Fbn4PhFB8zspVafjqZQpbFprByQGfCg= 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:from :subject:to:cc:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=Vh354+KyBv3 0foSqfRHhYUqeRW0=; b=U383xsI8M9rmBZFm8Ss/Rkqz2WqxwjwezSbISQ2VNtd RrqzmyX9M9TpoOlTafV3HaF0DTeK5SqG65/9iy1l1lmybJR+vUBx7vMIX57QeYqj ySxYr0cRzC990MrgWxCSkfmgi+IM8IEwPlPECjB4ZDHN7jPFNQjPF0RzROri7k9c = Received: (qmail 56636 invoked by alias); 15 Mar 2017 23:10:06 -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 56623 invoked by uid 89); 15 Mar 2017 23:10:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=sk:pthauge, U*pthaugen X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Mar 2017 23:10:04 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2FN8Y1a055015 for ; Wed, 15 Mar 2017 19:10:03 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2978fhhejc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Mar 2017 19:10:03 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Mar 2017 19:10:01 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 15 Mar 2017 19:09:59 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2FN9wJD41418950; Wed, 15 Mar 2017 23:09:58 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B20AD12403F; Wed, 15 Mar 2017 19:09:54 -0400 (EDT) Received: from oc1687012634.ibm.com (unknown [9.10.86.166]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 7DD2F124035; Wed, 15 Mar 2017 19:09:54 -0400 (EDT) From: Pat Haugen Subject: [PATCH rs6000] Fix PR79951, ICE for unrecognizable insn with -mno-cmpb To: GCC Patches Cc: Segher Boessenkool , David Edelsohn Date: Wed, 15 Mar 2017 18:09:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17031523-0040-0000-0000-000002E6BC68 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006789; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00834371; UDB=6.00409744; IPR=6.00612028; BA=6.00005214; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014664; XFM=3.00000013; UTC=2017-03-15 23:10:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031523-0041-0000-0000-000006DABB8C Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-15_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703150176 X-IsSubscribed: yes The define_expand for copysign3 will call gen_copysign3_fcpsgn if either TARGET_CMPB || VECTOR_UNIT_VSX_P (mode) are true, but gen_copysign3_fcpsgn is missing the check of VECTOR_UNIT_VSX_P (mode) which results in an unrecognizable insn ICE. This is fixed with the following patch. Bootstrap/regtest on powerpc64le with no new regressions. Ok for trunk? Ok for backport to GCC 5/6 branches after testing? -Pat 2017-03-15 Pat Haugen PR target/79951 * config/rs6000/rs6000.md (copysign3_fcpsgn): Test for VECTOR_UNIT_VSX_P (mode) too. testsuite/ChangeLog: 2017-03-15 Pat Haugen * gcc.target/powerpc/pr79951.c: New. + Index: config/rs6000/rs6000.md =================================================================== --- config/rs6000/rs6000.md (revision 246180) +++ config/rs6000/rs6000.md (working copy) @@ -4831,7 +4831,7 @@ (define_insn "copysign3_fcpsgn" (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" ",") (match_operand:SFDF 2 "gpc_reg_operand" ",")] UNSPEC_COPYSIGN))] - "TARGET__FPR && TARGET_CMPB" + "TARGET__FPR && (TARGET_CMPB || VECTOR_UNIT_VSX_P (mode))" "@ fcpsgn %0,%2,%1 xscpsgndp %x0,%x2,%x1" Index: testsuite/gcc.target/powerpc/pr79951.c =================================================================== --- testsuite/gcc.target/powerpc/pr79951.c (nonexistent) +++ testsuite/gcc.target/powerpc/pr79951.c (working copy) @@ -0,0 +1,10 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -S -mno-cmpb" } */ + +float testf (float x, float y) +{ + return __builtin_copysignf (x, y); +}