From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 323CB3858D38; Thu, 16 May 2024 14:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 323CB3858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 323CB3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=63.228.1.57 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715871415; cv=none; b=QmOLhSwhdfAKczHZSCfroUKPkfnq7mkhHTXpttmVGi2QLrgZJWlvnyywd0nT/Mv4WW26EaBPBUd7aQ9utPA1Hu0RWKMB40ZWqlxFsnrv6y8hg+W/WOax87Wf4eTlPPE90X2cgaraKPlpHKJ+tFlCviyxpYpg0Yq2hSiQDhH4Boc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715871415; c=relaxed/simple; bh=cuIK8SENL5HmOxuQR4hTA3rCkGoMb+zs0/ibvtA/MY0=; h=Date:From:To:Subject:Message-ID:Mime-Version; b=gFlT2yzgcTbvAUGbcagHJLXW7xzGGEyQJRp3J2ZGxAwuwXtqVHO4LR97l1BjhPvdVtg77CzLYdM+QfIuxTxwKrLnwe8C7q04DsJVeA1TtFiTqDBlO5EmEnqvkN/ud5d7bv4q1Bi0P4OMFbpDJRGbcttHt0J/vJP+CyajJGvbrf8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 44GEtqJL004303; Thu, 16 May 2024 09:55:52 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 44GEtqAi004302; Thu, 16 May 2024 09:55:52 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 16 May 2024 09:55:51 -0500 From: Segher Boessenkool To: Jiufu Guo Cc: "Kewen.Lin" , dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] report message for operator %a on unaddressible exp Message-ID: <20240516145551.GJ19790@gate.crashing.org> References: <20240513025712.889169-1-guojiufu@linux.ibm.com> <20240514092054.GF19790@gate.crashing.org> <20240514104333.GG19790@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,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! On Thu, May 16, 2024 at 02:56:49PM +0800, Jiufu Guo wrote: > Jiufu Guo writes: > > Segher Boessenkool writes: > >> On Tue, May 14, 2024 at 05:53:56PM +0800, Jiufu Guo wrote: > >>> Thanks so much for your great review! > >>> Reference other messages, I'm wondering "invalid %%a value" may be > >>> acceptable, or "invalid %%a address expression in TOC" maybe better. > >> > >> "%%a requires a memory operand"? Maybe even print out the actual > >> operand given, too. > > > > Thanks! I updated the code using: > > "%%a requires a memory reference operand", since the actual operand > > is treated as the address. > > I suspect one thing here: if "%%a requires memory" is accurate vs. > "%%a requires a memory reference". > > Reference the words from doc: > https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Generic-Operand-Modifiers > a: Substitute a memory reference, with the actual operand treated as the > address. > > And for below code: > '("#%a0" : :"m"(x))' is not accepted. Yeah, it always confuses me. Sorry. The operand is the actual address. > While '("#%a0" : :"r"(&x))' is ok. > > So, it may be more accurate that: "%%a" as requirement of address of > memory. That sounds good yes. Segher