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 1CB08384AB5D; Tue, 14 May 2024 02:49:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CB08384AB5D 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1CB08384AB5D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715654968; cv=none; b=Ng1Pm1ff5A/Ze2TwPXPG03rWs3aEmwXkpZFxLmE3HHOnGV6810S2eQXq3twBrJEEvGrmgrU/k8X2LnmmNVnai5UhiaDTeWkSBJ23gI4aBoo8JhgGOGBuNFqJs93ZqB0VW/kThMEB6KRrXY5lUe+oPgenFN0iyxetgbbJC1XNqcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715654968; c=relaxed/simple; bh=FxBCFxDVZq9J9t22XocI6NQRFgA+6CVhzmgXuGmH4lQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sf1yVfuGnpxa8nZq3yxVrTx9GMKscUH8m4GLekLFBbPiAzK953a3q+rtCdJCkVSlP6VC8oMxbEw6Bz437aAFO/q4fm7CcW5erEYQwxsvZ2QikLX2xnMaFznFU4Wc8nizad547UvWnB/GN8jrZXYXot7bt6x5wpvzP493WUvnlhU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44E2OktX012785; Tue, 14 May 2024 02:49:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : mime-version : content-type; s=pp1; bh=/Rnsf+wf/iHgOrdv6d047OgrYEdmR230O6r7ZXeYJgE=; b=oJcW8FveGOIIrsQSnfCEqay+2dpmMzNUUCOgYK8RANR6jXnyo/KRGl//YfLylslxV1Sl vPwDrlw5Xbe/cwvwldEu+hZToFm4Ww5qyLScYTNa78b4pVaTysK16yF1NzlAMTlvs4MD I2u8Fj9D9GDF/aNLlOQWYcdH+VXHzUZjShLYXg2UIK04NI4YeEaW6TBcCsOlN6yWTOWy xse52rErxSaw3oCc/g+K0gijexAfBMxU9H2zzcIzNjzXOP6mvYYocwqXNZok6ltZXw44 mHMqSdWME/Yhg5eOu2VghNSshOQrapG3IzV5P+RCHo6Jj51/EB2rpsXLe5O+vulX1FCs Yw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y3x7w048j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 May 2024 02:49:25 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44E2nOdg020272; Tue, 14 May 2024 02:49:24 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y3x7w048g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 May 2024 02:49:24 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 44E23m9C029603; Tue, 14 May 2024 02:49:23 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3y2n7kjqj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 May 2024 02:49:23 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44E2nL4p19464942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 May 2024 02:49:23 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11FB158066; Tue, 14 May 2024 02:49:21 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFDBD58053; Tue, 14 May 2024 02:49:20 +0000 (GMT) Received: from genoa (unknown [9.40.192.157]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Tue, 14 May 2024 02:49:20 +0000 (GMT) From: Jiufu Guo To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com Subject: Re: [PATCH] report message for operator %a on unaddressible exp References: <20240513025712.889169-1-guojiufu@linux.ibm.com> <20240513110322.GD19790@gate.crashing.org> Date: Tue, 14 May 2024 10:49:17 +0800 In-Reply-To: <20240513110322.GD19790@gate.crashing.org> (Segher Boessenkool's message of "Mon, 13 May 2024 06:03:22 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zX6wp2b0Q23eLkYSXVdS0N5XeWH96pJe X-Proofpoint-ORIG-GUID: -uhyp-9ST5BY-nFoWJBXagsBMyhsu9sJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-13_17,2024-05-10_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 adultscore=0 mlxlogscore=943 clxscore=1015 malwarescore=0 mlxscore=0 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405140019 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_STOCKGEN,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, Thanks for your helpful comments! Segher Boessenkool writes: > Hi! > > On Mon, May 13, 2024 at 10:57:12AM +0800, Jiufu Guo wrote: >> For PR96866, when gcc print asm code for modifier "%a" which requires >> an address operand, > > It requires a *memory* operand, and it outputs its address. This is a > generic modifier btw (not rs6000). Oh, yeap. it outputs the operands's address. I would update words like: which requires an addressable operand. > >> while the operand is with the constraint "X" which >> allow non-address form. An error message would be reported to indicate >> the invalid asm operands. > > "non-address form"? Every mem has an address. > > But 'X' is not memory. What is it at all? Why do we use that when you > *have to* have mem here? "X" allows any thing. This is the reason why the code is *invalid*. Other constraints("r/m") should be better than "X" for "%a". > > The code you add that tests for address_operand looks wrong. I would > expect it to test the operand is memory, instead :-) I understand your concern. While there is a tricky work: before invoking print_operand_address/output_address, the orignal operand (which would be 'mem') is stripped to it's address. So, 'address_operand' is tested for print_operand_address is targets. While I also wonder if "address_operand" is really needed. Because under the condition: ``` else if (SYMBOL_REF_P (x) || GET_CODE (x) == CONST || GET_CODE (x) == LABEL_REF) { ``` 'x' is already known, it only could be: SYMBOL_REF/LABEL_REF or CONST. I would update the patch for this. Thanks for your comments. BR, Jeff(Jiufu) Guo > > > Segher