From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 18B50385840C for ; Mon, 24 Oct 2022 10:59:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 18B50385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 6AD67300089; Mon, 24 Oct 2022 10:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1666609176; bh=pVXacUArqFReQJFfToGFedsAtKW1a10H0LfTHyMcl7Q=; h=Message-ID:Date:Mime-Version:Subject:To:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=X68LoobBFpzuwO7DaP6PscvuilL8A8/7y7ej9Chzk2ezxyCuoRBKse15x9/Ifg0DS BHoMHmn9zF5+51uWUAb6XvpNW1aNdwYd6dOq2pBfW4t44gArYNJwAmeKMYZeV1F2dm 9SCpFLvH7ZeU49sLpexIlK85yLPf1jZw0sl/wI6M= Message-ID: <1518fba5-45ce-443c-057d-c409ecc80a71@irq.a4lg.com> Date: Mon, 24 Oct 2022 19:59:34 +0900 Mime-Version: 1.0 Subject: Re: [PATCH 27/40] sim/ppc: Add extra parenthesis to avoid ambiguity Content-Language: en-US To: Mike Frysinger , gdb-patches@sourceware.org References: <24f4d89aafc682360eb2b37005096f4b5b31124f.1666258361.git.research_trasio@irq.a4lg.com> From: Tsukasa OI In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,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 2022/10/24 0:05, Mike Frysinger wrote: > On 20 Oct 2022 09:32, Tsukasa OI wrote: >> Clang generates a warning if it considers that an expression is misleading >> due to a lack of parenthesis ("-Wparentheses"). >> On the default configuration, it causes a build failure >> (unless "--disable-werror" is specified). >> >> This commit adds extra parenthesis to avoid ambiguity. >> --- >> sim/ppc/altivec.igen | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sim/ppc/altivec.igen b/sim/ppc/altivec.igen >> index 63fe95a53d5..eda7af9dd6a 100644 >> --- a/sim/ppc/altivec.igen >> +++ b/sim/ppc/altivec.igen >> @@ -231,7 +231,7 @@ void::model-function::ppc_insn_vr_vscr:itable_index index, model_data *model_ptr >> busy_ptr->vscr_busy = 1; >> >> if (out_vmask) >> - busy_ptr->nr_writebacks = 1 + (PPC_ONE_BIT_SET_P(out_vmask)) ? 1 : 2; >> + busy_ptr->nr_writebacks = (1 + (PPC_ONE_BIT_SET_P(out_vmask))) ? 1 : 2; > > fairly certain this is incorrect. this pretty much guarantees that "1" will > always be used and never "2". > > Andrew posted a diff fix that i think is correct. > -mike I agree that. I kept the original semantics but this is definitely a bug (I think Andrew's fix is correct). I will leave it to Andrew (PATCH 05/10). Thanks, Tsukasa