Message ID | 65223c79fdfd7faf132275415cd9da9852c5bec3.1666257885.git.research_trasio@irq.a4lg.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp153900wrs; Thu, 20 Oct 2022 02:29:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UTGCzflAW1RLTojt71bIffDhTQTz4rSSA2qItEI5PwUvTO9HbIM8MEEPuFLyiAAoUWvsj X-Received: by 2002:a17:907:5c2:b0:77e:def7:65d8 with SMTP id wg2-20020a17090705c200b0077edef765d8mr10402612ejb.487.1666258174569; Thu, 20 Oct 2022 02:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666258174; cv=none; d=google.com; s=arc-20160816; b=v7EK47mwdIxANsuDoUy4rYcjzUtW+Bz0sHzG+FEU3d+5xFRt/If7fhSrWzrM6krnL3 iEeZoD0U3ydTQS/iQU71vONvfvNwU2PXKqbO0vQM7ZsYaa3aWVBVhfvIfywBxIszvttY Q+o4Cdlc/F9UwDesgaJK6Wc5P6Pfaygjl515G4vMOJhVcOg/+953S1Q7+MotmGBAh39d t+5TqdSCUCZbKFlzeNuVuJH7DaIrPQPWu62QJMvqBEpoFogIgGN8HPfeErEqX2vpOeru eQWbmLou0U9mgLffN+AZcHbZT5J2NB6TlU2OSN3iFp/ZVswXRx+aryecZM9+43A9FClP IMxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=JxV3ciybJkNqNC9aG2pC+dxADzmKpySrBJqCnJyoR7Q=; b=uCbsah92ivdiRBJ5+p2OD09obCZZkOXabDPq1MtSgEaC/4JRXUwIwSfDllUWD91pGE Dw6YSxbFKzHwqd115cLcB1OPUOSV3z1fWmfzfEuSuwvy3BoHJeolgSYM22A4eeoFan8m iFAjPT8fMyU6PfgTc7zc8bRYRN69OxS3A9OL9ulP8Yo3NE/0Nsnw7bDq8oM7624TjNy+ x/pctkzk70s5/sc9qJVht/JCUXzvos9UHNPJy+E5zm6IfrAeWiGUXbwrQQh+MKpzYDil YL14glUnYksH3f7dvIs1dRh9O/GIBHvRcg3flYUc4z91SsjNBMxT0gv2y82tMdv0vOVe EAfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=mXwjwPjk; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dr2-20020a170907720200b0078dbec2e632si18798392ejc.620.2022.10.20.02.29.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:29:34 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=mXwjwPjk; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E4B7D3887F53 for <ouuuleilei@gmail.com>; Thu, 20 Oct 2022 09:28:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4B7D3887F53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258089; 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=mXwjwPjki4YAkhap3k/J+ZEsaZV5SV9/qlvF4cjvtoRJc0pf39t7OnzMu/16c0NWI P+YBMqRpJgzA3zEJkFNJCG08Oju6mAEGgAZ5HmJJ8MTKINqStuPHXel0QgmLHoY4Zd YLLmTBYxVQr80dLrwSCBODIm324KrBg6l+SwO53U= X-Original-To: binutils@sourceware.org Delivered-To: binutils@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 55FB73850203 for <binutils@sourceware.org>; Thu, 20 Oct 2022 09:27:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55FB73850203 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 05E3E300089; Thu, 20 Oct 2022 09:27:19 +0000 (UTC) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Mike Frysinger <vapier@gentoo.org>, Nick Clifton <nickc@redhat.com> Subject: [PATCH 04/40] cpu/cris: Initialize some variables on CRIS CPU Date: Thu, 20 Oct 2022 09:25:50 +0000 Message-Id: <65223c79fdfd7faf132275415cd9da9852c5bec3.1666257885.git.research_trasio@irq.a4lg.com> In-Reply-To: <cover.1666257885.git.research_trasio@irq.a4lg.com> References: <cover.1666257885.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Binutils <binutils@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: binutils@sourceware.org Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747198331954604392?= X-GMAIL-MSGID: =?utf-8?q?1747198331954604392?= |
Series |
sim+gdb: Suppress warnings if built with Clang (big batch 1)
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Tsukasa OI
Oct. 20, 2022, 9:25 a.m. UTC
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(+)
Comments
On Thu, 20 Oct 2022, Tsukasa OI via Binutils wrote: > 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. I'd say the problem is an artefact of CGEN code generation, as the conditions are exhaustive. In the generated code it's far from obvious though... > 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. Ok with a comment saying something to the effect of "It's not obvious in generated code that all cases are covered in the conditional settings below, so initialize this to avoid compiler warnings" (and referring to the previous comment for all but the first). Thanks! brgds, H-P
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