From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KGrAIA4XUWNYsA4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 05:38:22 -0400 Received: by simark.ca (Postfix, from userid 112) id 83E751E112; Thu, 20 Oct 2022 05:38:22 -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=XccMlMkn; 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=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 1E46E1E0D5 for ; Thu, 20 Oct 2022 05:38:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F088395C031 for ; Thu, 20 Oct 2022 09:37:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F088395C031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258623; bh=JxV3ciybJkNqNC9aG2pC+dxADzmKpySrBJqCnJyoR7Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XccMlMknd6DA777ErdhgvPMGpE88hVuMl/tsis+1FcLEzufidJQ9v2WE3dOoUAvBI VUye/HykB3b7WWnVXhqkSM4iXpOSknlHuClkZX4gaRAc/KV4x/molqOB9kvO0uM2Sb /a+72rel8hRwQWt9Yscc+JeJr8hZdoEpYSF4VJNw= 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 92548383159B for ; Thu, 20 Oct 2022 09:33:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92548383159B Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id EAF14300089; Thu, 20 Oct 2022 09:33:35 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 04/40] cpu/cris: Initialize some variables on CRIS CPU Date: Thu, 20 Oct 2022 09:32:09 +0000 Message-Id: <65223c79fdfd7faf132275415cd9da9852c5bec3.1666258361.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" GCC / Clang generate a warning if a variable may be used uninitialized on some cases (Clang: "-Wsometimes-uninitialized"). When the program is being built by Clang with the default configuration, it causes a build failure (unless "--disable-werror" is specified). Those error occur on sim/cris/semcrisv{10,32}f-switch.c but they are CGEN-generated files. The real cause of this problem is in cpu/cris.cpu which does not initialize certain variables. This commit ensures such variables are initialized to zero by default. Note that this commit itself does not regenerate CRIS CPU related files with CGEN because it still has several issues preventing regeneration. They are to be fixed in the later commits. cpu/ChangeLog: * cris.cpu: Initialize condres, newval and tmpres variables. --- cpu/cris.cpu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpu/cris.cpu b/cpu/cris.cpu index 97b44581e78..cd85f4e94e2 100644 --- a/cpu/cris.cpu +++ b/cpu/cris.cpu @@ -541,6 +541,7 @@ (sequence BI ((SI tmpcond) (BI condres)) + (set condres 0) (set tmpcond condno) (.splice cond @@ -2655,6 +2656,7 @@ (sequence ((SI rno) (SI newval)) (set rno (regno Pd)) + (set newval 0) (.splice cond ; No sanity check for constant special register here, since the @@ -3698,6 +3700,7 @@ (sequence SI ((SI tmpcode) (SI tmpval) (SI tmpres)) + (set tmpres 0) (set tmpcode swapcode) (set tmpval val) (.splice -- 2.34.1