From patchwork Sun Jun 9 15:19:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1945555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=gsK9iIUu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VxzBL5GQpz20KL for ; Mon, 10 Jun 2024 01:19:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F98B3858C48 for ; Sun, 9 Jun 2024 15:19:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id A2EF43858D20 for ; Sun, 9 Jun 2024 15:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2EF43858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A2EF43858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717946356; cv=none; b=Z5rLDxQYtjpSHsxDmlxJtaji4vqj7J3LbYCEacLf6PPkTbUnt6Md/RWSwy5iTK3djktcJchbhiT1NFeZIOVr1Jj2LmJgynXfB9jPysiDi5SWIcP31gpmh7PaQxBaad/Zhm0/VU3Hrz0y7ClLhoFJxx3h9sVZ620Lz8USxPY6jBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717946356; c=relaxed/simple; bh=yfEz+5hPnZGVUKd/XRsDiVzk3WaQWgT9NWSpwGJn21I=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=ACPbhyK4ebXwUjHXlYZOSiFF+AtrdT6Xv5IpW22qZRIMQ/flWIkXj1o2D0TOzVHSN9//4PNKKnQ9s/VeKtc+2ET3FeWgKE3jTyd/VuOFVSls3Epzoe9c9UvVs6PJdReAP9q12EW25y+j8q2PJNE2fMjeNSu/q4+GZkEc/Lu878U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-6e40ee57f45so1501268a12.0 for ; Sun, 09 Jun 2024 08:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717946352; x=1718551152; darn=gcc.gnu.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=TtL6Iqp6DjIpbIwhGh/RF/5PaXJAwoPPnuzkkVP5tKE=; b=gsK9iIUuiNP5a2s91FL1JUoU/T8OMphRUncKXbC1aqItC2Qm1PkK0yTv7npsJgnj/i 5EMG0DTPFU2s27jP3ibAKh2yT3chMdeyr4WOnsj0YWG3r3oZ7F62NkyY+RHNzOJOwLwQ TkySdngbdAtog4Aa66haq80mchgBjpSoms4oH+DroFaSZ28ab9QOTNLkny0oLxYfKHhu 6EV41wG42Vg8LfMoiomotkA2FkKcQ/Aq/uN+K1VpCgoqKABcMe6fugf5zvFhfzA7bHaf yRtB6p2QMCaVTrno1B9Xa9oqYx7kADB+K/nro5QFSZKqMaJZpin4cZ56QFLmpekDjy7K LMZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717946352; x=1718551152; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TtL6Iqp6DjIpbIwhGh/RF/5PaXJAwoPPnuzkkVP5tKE=; b=tXUqFYB67vKCIc5XsSf/UsRwpXXHR5FJi6AcAgZlqOA62Cv3sDt0g6LKH4vru7D3va PU80faMkXTCS75WJge3Df3K9EdgZQx5CtmDdW52k2AxJAQEl3OwnDaHQRCP6PY+gBt12 eHZdgHllm0Nulct4oC6Lst54wh71yPru4wYXTd4JvZHkDcL+uW7PBF1kjoJqaUh3p+St 5yZ6+NSOAw0gwOjXrADYT1H86IOPvVjxtNpYnAUIn2bijUhITD7t6FxR0u5rTrey5ykj mpVCcVf2MhnvxCxIe37fsauQsf0t27Oqx+c46jt6/1EAQLYm96ExBbZs59cfkJPZ95i/ wiAA== X-Gm-Message-State: AOJu0Yx/QahYRya5EW/rWvqmW6QKl0jKXP9xi52CfqCVngYWpYHHXhus 1AQXFwAPGJX/1pSIE3DOSZcos8++4L59WpIVKp8T9TwFb6JbNbclHk6Cww== X-Google-Smtp-Source: AGHT+IEkEIwv/nXxL0AzlJObKn+YyunnVsjOH55qgHzIBYbBpjdMKSwOJUYUXCXXDDq6gTdCb5Tg3Q== X-Received: by 2002:a17:902:d484:b0:1f6:ed74:b4e3 with SMTP id d9443c01a7336-1f6ed74b67bmr65273545ad.3.1717946351871; Sun, 09 Jun 2024 08:19:11 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7e0613sm66216765ad.195.2024.06.09.08.19.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Jun 2024 08:19:11 -0700 (PDT) Message-ID: <9d8d9458-e59d-40d5-84fb-6ae6bf51636b@gmail.com> Date: Sun, 9 Jun 2024 09:19:07 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Content-Language: en-US To: "gcc-patches@gcc.gnu.org" From: Jeff Law Subject: [committed] [RISC-V] Fix false-positive uninitialized variable X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Andreas noted we were getting an uninit warning after the recent constant synthesis changes. Essentially there's no way for the uninit analysis code to know the first entry in the CODES array is a UNKNOWN which will set X before its first use. So trivial initialization with NULL_RTX is the obvious fix. Pushed to the trunk. Jeff commit 932c6f8dd8859afb13475c2de466bd1a159530da Author: Jeff Law Date: Sun Jun 9 09:17:55 2024 -0600 [committed] [RISC-V] Fix false-positive uninitialized variable Andreas noted we were getting an uninit warning after the recent constant synthesis changes. Essentially there's no way for the uninit analysis code to know the first entry in the CODES array is a UNKNOWN which will set X before its first use. So trivial initialization with NULL_RTX is the obvious fix. Pushed to the trunk. gcc/ * config/riscv/riscv.cc (riscv_move_integer): Initialize "x". diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 95f3636f8e4..c17141d909a 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -2720,7 +2720,7 @@ riscv_move_integer (rtx temp, rtx dest, HOST_WIDE_INT value, struct riscv_integer_op codes[RISCV_MAX_INTEGER_OPS]; machine_mode mode; int i, num_ops; - rtx x; + rtx x = NULL_RTX; mode = GET_MODE (dest); /* We use the original mode for the riscv_build_integer call, because HImode