From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id r/B+CDBwVmMPDRAAWB0awg (envelope-from ) for ; Mon, 24 Oct 2022 07:00:00 -0400 Received: by simark.ca (Postfix, from userid 112) id 130941E112; Mon, 24 Oct 2022 07:00:00 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=fd78SrFs; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B79C61E0CB for ; Mon, 24 Oct 2022 06:59:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 561A23857C46 for ; Mon, 24 Oct 2022 10:59:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 561A23857C46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666609199; bh=pVXacUArqFReQJFfToGFedsAtKW1a10H0LfTHyMcl7Q=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fd78SrFsS/V+0CpYGgUomUZ3efOkbPWc3fZXVBd5pizDZS8vOdPypOFDOF2LdGEJU CHjIUZE/Pi41YxAh/6gjTvZrpT9mGf+yoa2Vi5X0VYgihcllmnWKDwTiTRCf9n5iB4 MqjwKEzb3XaJ8xAgaf/5GsfvwfEXuTd+kflFjrh0= 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 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) 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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