From nobody Tue Nov 26 06:59:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1709118441; cv=none; d=zohomail.com; s=zohoarc; b=gs3XNUFFA/B/PsVk2LvGcFDatLrv5O/+77Ilhl6ZbDgHYAj57U69zsU2Pn+++4NQqEMpMztb4MHzkd3mECl849feSOQqvIxGt1P5ncE6onyM76PEdxrt66fTc1K2t+p2lEJ2kIZD/S3L5q10Ebj7iPvjtoMtlSZWXczwWrcHtXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709118441; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Adv1FeZ7IQtv7tUa449DMgYXIFGMSB/pjlycFke2cbM=; b=jFz0BBEEVgsVvuWigbV6/Me75vDeXGoBLJyF92lCm3A1o+v95SpOK4qLiV2vnKYoQ1T+drpxwH7D3AAEnzGi/ka66DytgxNz4u9VxfgQKmoHaVib4qbqHBQXhdfCQJRTOsMzgAb073A2VgIeUxUHlBcmKKE/UBNiW0A6lsTIEHA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709118441249699.8946585472967; Wed, 28 Feb 2024 03:07:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfHm0-0002F3-Ft; Wed, 28 Feb 2024 06:06:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfHlx-0002EN-ON for qemu-devel@nongnu.org; Wed, 28 Feb 2024 06:06:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfHlw-00006e-BE for qemu-devel@nongnu.org; Wed, 28 Feb 2024 06:06:49 -0500 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613--CFiGRCIOEqv5FP8tiNkSg-1; Wed, 28 Feb 2024 06:06:45 -0500 Received: by mail-il1-f198.google.com with SMTP id e9e14a558f8ab-36516d55c5fso48323285ab.2 for ; Wed, 28 Feb 2024 03:06:45 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id eq21-20020a0566384e3500b00474874acfe1sm1482377jab.172.2024.02.28.03.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709118407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Adv1FeZ7IQtv7tUa449DMgYXIFGMSB/pjlycFke2cbM=; b=iTVjOUh7eKOCJ+F9qYqRQfyLuiaITmtdEhFz0nx1I3I/RGxjwXv1UYpet0QPvd789YC8HB z3S4JlNs3krPP92sNVPfW5SzCKA5YfthV0tmBWpBSOqi4RHpBdBWXFO2aHPNILeCfaUfxs iKxpkePZudWpfP1Sunpn/GwNEXK6f6Y= X-MC-Unique: -CFiGRCIOEqv5FP8tiNkSg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709118404; x=1709723204; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Adv1FeZ7IQtv7tUa449DMgYXIFGMSB/pjlycFke2cbM=; b=U0iRdzM6LsCuT5Z80Mvl230xe34VBIHk2udwDkZDWIFuQPVRYvLveEy5HH6Toeh1h7 L0SoTBg4/b9VCbTKi9kJTqCRRbrjVSdhMXtuB8mjhGhkyb2E4RSs+ojVoKpv009Hwpxu NEHok5425ERu/m22hI/sPX8k93R0Jiqq3sphttGdbYx3oXrUsp2/4tydOycLrqB5mWaj uVnO6HF8/tUF2/qOBulFDrXyifZGNGx+M1wjO3fw9qUjWZmzyW2gKPImf8H8uPllu5YO ht8szklktCf9uYd8umZumJV850MXhs5mi0NAs2LMt9jA3zEOjoKd8hkVReM/8Xa5qM5d AO7A== X-Gm-Message-State: AOJu0YwmjOhZy7F73MLjiQPuug563bv+DUEpoE7UWOxyYhQqqL0rqyUR u/sLn+RVEo4wqluC1yPPsclAJwtfivBJMHes/HaAnx4iiVRDJ9cwHtid/vryr1kUIkiZCPyVJLH hTPJXiiHFlwYx4YYFz+OFNo6sEkRIW19TW/E5/O2uPHLd+nX4895A1R3mchMdCySP5M32BIo9TF DbRJOh+i27E19tUs2J2MkpTTB9/OZSwU/ZYr8u X-Received: by 2002:a92:cf4d:0:b0:365:13c0:1bc3 with SMTP id c13-20020a92cf4d000000b0036513c01bc3mr12809656ilr.20.1709118404389; Wed, 28 Feb 2024 03:06:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuHXd2Kjd9FJHmXrSn7ukxh+8gNE0HPi0ZvMN2ky7Lsa6gZBQrKen4/h88cj01+ezMsNlm8A== X-Received: by 2002:a92:cf4d:0:b0:365:13c0:1bc3 with SMTP id c13-20020a92cf4d000000b0036513c01bc3mr12809633ilr.20.1709118404046; Wed, 28 Feb 2024 03:06:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH] tcg/optimize: fix uninitialized variable Date: Wed, 28 Feb 2024 12:06:41 +0100 Message-ID: <20240228110641.287205-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.088, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1709118441934100001 Content-Type: text/plain; charset="utf-8" The variables uext_opc and sext_opc are used without initialization if TCG_TARGET_extract_i{32,64}_valid returns false. The result, depending on the compiler, might be the generation of extract and sextract opcodes with invalid offset and count, or just random data in the TCG opcode stream. Fixes: ceb9ee06b71 ("tcg/optimize: Handle TCG_COND_TST{EQ,NE}", 2024-02-03) Cc: Richard Henderson Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 79e701652bf..752cc5c56b6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2102,7 +2102,8 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) =20 static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) { - TCGOpcode and_opc, sub_opc, xor_opc, neg_opc, shr_opc, uext_opc, sext_= opc; + TCGOpcode and_opc, sub_opc, xor_opc, neg_opc, shr_opc; + TCGOpcode uext_opc =3D 0, sext_opc =3D 0; TCGCond cond =3D op->args[3]; TCGArg ret, src1, src2; TCGOp *op2; --=20 2.43.2