From patchwork Thu Oct 20 09:32:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 59146 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6475383FBAF for ; Thu, 20 Oct 2022 09:37:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6475383FBAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258627; 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=d7vclgde9h5LIU9uenH04rLpSj4DFjF7ibw4yR6hAdIan/gkblhHmz8xkV0pa1WRO yH/6HtggEUFj2kIo8tuWuAPHj1B3LzI5fqWr+MnxENsZ7aoNW4E8yRctmcDYN3PvwX 8OfQ3YJA/00xqGt8pDKsiVpna45T8iAS0Toa0x8Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 X-Spam-Status: No, score=-12.1 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 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: , X-Patchwork-Original-From: Tsukasa OI via Gdb-patches From: Tsukasa OI Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@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