From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 1CE4738582AD; Thu, 1 Sep 2022 08:29:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1CE4738582AD Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2818JE2h015951; Thu, 1 Sep 2022 08:29:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=YoRLJxcOBiTxm93sQ2nR5XYKikY3hBAtH3SwQVpwwAQ=; b=Zc1gJxN5cIwtUV/pAhf79OMzovot6QKzjLmJplpjBgteRsV1WC9J43Q6WJuXByysg5Rm ocYPz5eVETZgAuMvac8zXPnPma+9tP8er3Vn4tZ35fS81F/4PS+sNxv3mc9F9Q5W59OV zuleS3YM+qiw5lLPozuAm8H2/qJTwc0k7KUf8xj4dsWtwtbDMA2MhLlwvXTDoh1H+YEF XWJFyVJgNob0MOLTf3WxyLEr8lFqtifH/wlqc+u0AZDZB+0R6ovSufwdHCQcv5NKE0Zg gmv7s3sqegIUIkF+NOQsdSoygizyJj0xeZMdkersGa0+3vz/0rmXqsJoZ/3hb6LeHRP4 mQ== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jas4f89jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 08:29:05 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2818OIoG020518; Thu, 1 Sep 2022 08:29:03 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 3j7ahj6f4d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 08:29:03 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2818T0nn41812352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Sep 2022 08:29:00 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D1A9AE04D; Thu, 1 Sep 2022 08:29:00 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE7DDAE045; Thu, 1 Sep 2022 08:28:58 +0000 (GMT) Received: from [9.200.42.102] (unknown [9.200.42.102]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 1 Sep 2022 08:28:58 +0000 (GMT) Message-ID: Date: Thu, 1 Sep 2022 16:28:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] rs6000: Don't ICE when we disassemble an MMA variable [PR101322] Content-Language: en-US To: Peter Bergner Cc: GCC Patches , Segher Boessenkool References: <9c6a44db-1239-466a-2990-42207b7eb264@linux.ibm.com> <6cf4ceb2-9deb-93b4-bd94-ab08c08eb330@linux.ibm.com> From: "Kewen.Lin" In-Reply-To: <6cf4ceb2-9deb-93b4-bd94-ab08c08eb330@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ZU12ep8rMYORtHlU2LkEGjYnDhfUxK9h X-Proofpoint-ORIG-GUID: ZU12ep8rMYORtHlU2LkEGjYnDhfUxK9h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_05,2022-08-31_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209010035 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>> + if (TREE_TYPE (TREE_TYPE (src_ptr)) != src_type) >>> >>> This line looks unexpected, the former is type char while the latter is type __vector_pair *. >>> >>> I guess you meant to compare the type of pointer type like: >>> >>> TREE_TYPE (TREE_TYPE (src_ptr)) != TREE_TYPE (src_type) >> >> Maybe? However, if that is the case, how can it be working for me? >> Let me throw this in the debugger and verify the types and I'll report >> back with what I find. > > Ok, you are correct. Thanks for catching that! I don't think we need > those matching outer TREE_TYPE() uses. I think just a simple: > > if (TREE_TYPE (src_ptr) != src_type) > > ...should suffice. > Yeah, it's enough for the associated test case. :) > >>> or even with mode like: >>> >>> TYPE_MODE (TREE_TYPE (TREE_TYPE (src_ptr))) != TYPE_MODE (TREE_TYPE (src_type)) > > I'd rather not look at the mode here, since OOmode/XOmode doesn't necessarily > mean __vector_{pair,quad}, so I'll go with the modified test above. Good point. I thought the cv qualifier can affect the type equality check and assumed for test case like: void foo (char *resp, const __vector_pair *vpp) { __builtin_vsx_disassemble_pair (resp, (__vector_pair *) vpp); } , we don't want to have the conversion there and the ICE seems related to the underlying mode, so I thought maybe you wanted to use TYPE_MODE. >>>> + src_ptr = build1 (VIEW_CONVERT_EXPR, src_type, src_ptr); >>> >>> Nit: NOP_EXPR seems to be better suited here for pointer conversion. > > Ok, this works too, so code changed to use it. Thanks! > > Question for my own education, when would you use VIEW_CONVERT_EXPR over NOP_EXPR? tree.def has some note about VIEW_CONVERT_EXPR, it quite matches what Segher replied. In my experience, VIEW_CONVERT_EXPR are used a lot for vector type conversion. BR, Kewen