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 CA0153858C60; Tue, 14 May 2024 09:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA0153858C60 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 CA0153858C60 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=1715677946; cv=none; b=cVKS1alF/5OeSvf7B8BDhDlVAMEoB78NHxcjQSfwE22wUgkDMo+FFfAB3SGxTZck5aJ8lWh5Kb3HWUwGhz/ea5AJUNRhmZ6eKRFeDHVaBIoBu87fYer30E8xsEWsvovJ4OmUZ2eersBlNOUOL1UvD1uUrwC1HFzDEwlxCLEtV80= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715677946; c=relaxed/simple; bh=87nZknOXyqPjYSWmxJFnWKPQmTexLYmGXluBBwY2ecY=; h=Date:From:To:Subject:Message-ID:Mime-Version; b=JY9Ir790KSw1Pu9xTjlJ9bB8W7STaVYDIensUfJZC0k0Z/kZQrtcTsxaK8OvIndoCrzKN36Z36Fh3vQe7dsgEUEpxfdih2FySM4S6YZyjJC+A2UupvhDukFfam38FFyVLU5Xhe+K/bPlmz8rQeub3qvUw2bvHJewv+FgznLzNuU= 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 44E9BOqG020244; Tue, 14 May 2024 04:11:24 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 44E9BN8s020243; Tue, 14 May 2024 04:11:23 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 14 May 2024 04:11:23 -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: <20240514091123.GE19790@gate.crashing.org> References: <20240513025712.889169-1-guojiufu@linux.ibm.com> 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=-8.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_STOCKGEN,SPF_HELO_PASS,SPF_PASS,TXREP 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: On Tue, May 14, 2024 at 11:00:38AM +0800, Jiufu Guo wrote: > >> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > >> index 117999613d8..50943d76f79 100644 > >> --- a/gcc/config/rs6000/rs6000.cc > >> +++ b/gcc/config/rs6000/rs6000.cc > >> @@ -14659,6 +14659,12 @@ print_operand_address (FILE *file, rtx x) > >> else if (SYMBOL_REF_P (x) || GET_CODE (x) == CONST > >> || GET_CODE (x) == LABEL_REF) > >> { > >> + if (this_is_asm_operands && !address_operand (x, VOIDmode)) > > > > Do we really need this_is_asm_operands here? > I understand your point: > since in function 'print_operand_address' which supports not only user > asm code. So, it maybe incorrect if 'x' is not an 'address_operand', > no matter this_is_asm_operands. > > Here, 'this_is_asm_operands' is needed because it would be treated as an > user fault in asm-code (otherwise, internal_error in the compiler). You almost never want to test for asm, and just give the same error you would give in non-asm. It is the same problem after all, and giving the user the same error message is the most helpful thing to do! It can be useful to not say "ICE", but it already is prevented from doing that here. Segher