From patchwork Thu Jun 30 22:55:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 642793 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 3rgZdB5Ys2z9t0p for ; Fri, 1 Jul 2016 08:55:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cAirBYoL; 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=d0Dyf Kgj+cfCpbBj8EIOPo1utBHB2I5W5xiNw+Y2C60WFQKkgVD8/vQXOddV/iRYGoxhz KZGj3WOSh0DGe37PjmwZyTHcYe1z8vElv/tBcBT1ff8bfbo0b7ktzUm3MY5pD3mB FckCzukVGFcLXdyeTKkKmeijPgPmCKMwYLcdW8= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=5rZ2XkRefuY o9iKeBPOVjPdU7+I=; b=cAirBYoL5l+1PtfxKpwsqxSeWAY68HBil+iNjtFBAsr r4ULBSNExU+XVqeWv1lda7BO9i4e1HLkcYfTOaYw7e91KLScx6i1oNzzhfQPy8V8 BOnl4Y78SJM+5bjghLc0IfuCzGW5KAjZyFUE2ZysYzZaIkeaEBAQ56eIt+I/UTKs = Received: (qmail 7339 invoked by alias); 30 Jun 2016 22:55:17 -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 7330 invoked by uid 89); 30 Jun 2016 22:55:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 spammy=VSX, vsx, from_type, tdmode 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 (AES256-SHA encrypted) ESMTPS; Thu, 30 Jun 2016 22:55:13 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5UMmdWl115187 for ; Thu, 30 Jun 2016 18:55:10 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 23uwnp6npc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 30 Jun 2016 18:55:10 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Jun 2016 16:55:09 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Jun 2016 16:55:07 -0600 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: bergner@vnet.ibm.com Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 1C0B31FF0043; Thu, 30 Jun 2016 16:54:50 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5UMt6h446268558; Thu, 30 Jun 2016 15:55:06 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C8DD6E048; Thu, 30 Jun 2016 16:55:06 -0600 (MDT) Received: from Peters-MacBook-Pro.local (unknown [9.80.197.111]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 680FD6E03F; Thu, 30 Jun 2016 16:55:05 -0600 (MDT) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Aaron Sawdey , Bill Schmidt , Michael Meissner From: Peter Bergner Subject: [PATCH, rs6000] Fix PR target/71698, ICE in reload copying TDmode values to GPR regs Date: Thu, 30 Jun 2016 17:55:04 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16063022-0020-0000-0000-00000939817E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16063022-0021-0000-0000-0000534DDBA5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-30_08:, , 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-1604210000 definitions=main-1606300219 X-IsSubscribed: yes We currently don't allow TDmode values to use direct moves, since they live in register pairs and the most significant word is always in the even-numbered register which does not match subreg ordering in little endian mode. The following patch fixes PR71698 by disallowing reload from using direct moves for TDmode values. This passed bootstrap and regtesting with no regressions. Ok for trunk? This is also broken on the FSF 6 branch, so is this ok there too after bootstrap and regtesting there? Peter gcc/ PR target/71698 * config/rs6000/rs6000.c (rs6000_secondary_reload_simple_move): Disallow TDmode values. gcc/testsuite/ PR target/71698 * gcc.target/powerpc/pr71698.c: New test. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 237893) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -19194,7 +19194,8 @@ rs6000_secondary_reload_simple_move (enu simple move insns are issued. At present, 32-bit integers are not allowed in FPR/VSX registers. Single precision binary floating is not a simple move because we need to convert to the single precision memory layout. - The 4-byte SDmode can be moved. */ + The 4-byte SDmode can be moved. TDmode values are disallowed since they + need special direct move handling, which we do not support yet. */ size = GET_MODE_SIZE (mode); if (TARGET_DIRECT_MOVE && ((mode == SDmode) || (TARGET_POWERPC64 && size == 8)) @@ -19202,7 +19203,7 @@ rs6000_secondary_reload_simple_move (enu || (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE))) return true; - else if (TARGET_DIRECT_MOVE_128 && size == 16 + else if (TARGET_DIRECT_MOVE_128 && size == 16 && mode != TDmode && ((to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE) || (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE))) return true; Index: gcc/testsuite/gcc.target/powerpc/pr71698.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr71698.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr71698.c (working copy) @@ -0,0 +1,13 @@ +/* Test for a reload ICE arising from trying to direct move a TDmode value. */ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-require-effective-target dfp } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-options "-O1 -mcpu=power9 -mno-lra" } */ + +extern void testvad128 (int n, ...); +void +testitd128 (_Decimal128 g01d128) +{ + testvad128 (1, g01d128); +}