From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23EF834F244 for ; Tue, 18 Nov 2025 11:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464472; cv=none; b=kDGuBBoOqbxzuUVd9UwQXQGRL5MnH2w/Mz/ikqPg/2Dr3WiGuTxqazkyX+mxmkuQYneZzGTLL/iBH1i0bLHFt+XASVOQBAlY8PtEtxbS07Az6N5MXufcbaf7C3yaQS3KsMgyhPsLdsdIWBfXfnGCaGXzUX/HUyHjqADYSeBla0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464472; c=relaxed/simple; bh=K6s/4amNGf0pf7ZIFo0TdNSHXvDxDsd40eb5y86xe9Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JckTr3Ig8K/jUktP0j+vSlUOLbpttoOSY34hzEaxtp4Pjgf0m/j2CW+vq+jsgPNKB0resMEQZMddK3m09ru+vkvnCfAIeTCzjhJNWe3QdoXGYCPOkABRkEA0VCOKWzYrb6odDHxswBZ5vZ5pxWY3IDw/hUm7TfAtyoE+p6xnBSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UiD+zbO3; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UiD+zbO3" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-42b387483bbso4400650f8f.1 for ; Tue, 18 Nov 2025 03:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763464468; x=1764069268; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=/aDUXRtUCKv7zsIju/A2y6uPDmMCIErmOs+D8t7Rv5M=; b=UiD+zbO3KFzK8c70frad9f9rpA3kj+o0n0LGQU2luUalBUdVWMVUsXyP58kyA7F1IZ 93ppjMlMFn1PsAN7xk2KbDrbdnZF+iACHcqnTnVrHynutkHTadvNdJlWFXbxMizJwtJy PYXQFq6jt2pVDsaKHd0XVg/wry99Pcgji1yl8zbCunaLEd+IrL/QdfKc+/LPpcFGNZiu J241z3wv6/GTolB0MbD3fcj4JKqd5UzePvDh3r2GpUo0QA/boMMU3BR/L/r5pJCeUFBb YVg4lUXZedAKRVSCIrqsHIw2OJXdIMotRgY/JkhrbY4eAU3yv/sYL2xXa/bPKOKGK9Rs dePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763464468; x=1764069268; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/aDUXRtUCKv7zsIju/A2y6uPDmMCIErmOs+D8t7Rv5M=; b=SvJGw5pPlhP8TowNSeNTx41vWHR1CF7TDWOjpVUkFpKVcZV7Om2FiXtqZGcEoeoVGW VT8wE7XiBr0gJVX0uutcUysvpdW6NKGU94MHIoXrQjYZXHQ1VyxxndPBkD7olz1t4f7i zk2qOEew1oequP5MiCiB2dhExAhkeCMhHJsfL3TKOQgTgDGtlfL7dLK9k9llKqbFbENa rrTeQTHTfxY4AGgCrE2O8b/e4wybIrzzQ7/ZT8qZ/pCySS6+G9CH5hQQzxVVDPDwL151 LsNnQg3aYMdsU2M23Q9kGz28O+0uasEVVkttvA4pWbNWKiOlZCyIhn+/aLauEtJc495S wOOg== X-Gm-Message-State: AOJu0YxlVZ7UM3QhcnWcZO5xfW/y9Kjke5vnZhhonsjRUPOOpP0r07oR 6X+nwUIaGxVQjwXu4AK3ZeDQuaoe8JdJErsSgkcGSggI5mdLmUwnnHwR8O7yXcefwBTp30x7NQx yTxQr X-Gm-Gg: ASbGncvg7f+kKcfftw7HR+2RJ3vGfH5LdAHRWLv4FK8OMwmTiUvtcMcpu5REeb+DFP0 8flzWTYeAxlgHJLfRN2EkaFfB0eyZlqgfKX3655SGhoEJbkaxAW/vIPCKAJRWas+Xnr9grthRvX bh9Xd6I8GsU9BZPBc2k5mDkmTY+slvyjWCmAnifu2apRcn6Az2NSdG9DLXFAseM6tDPPFGPJYUz LgmLLZinDx6D9R0seLQpUiehZhZmgl/1Z7DoeJXd9/PX8QQzhMYOmEGLy6jlTMXthspM4m0CV28 XSZ4sAT4KLGLt60Lh0aTUecpnhrJRuBRLYYaa6cVNp7T0+RF7s3MYGDOIsqAe3im69NFQW66j7g 3zHP37Gz/7JVE5PcCe9tCnpvI6+f9Pp5ekAGoeTPyrgrv1WBxH8LiAEy+6CbZsf3S02wV3GI9wt 0qbVelsltVDW/Uc7q8fgJlZf+TVHo= X-Google-Smtp-Source: AGHT+IEd0iAkqXmOtIEhAO4glmU8dBzl0VEeYDqV9Pw7cll8XZEEcSNH4MHbX50DbHm/NNdYr1wMeg== X-Received: by 2002:a05:6000:1846:b0:42b:396e:27fd with SMTP id ffacd0b85a97d-42b59371fa3mr13663856f8f.38.1763464468295; Tue, 18 Nov 2025 03:14:28 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-42b53f17291sm31489518f8f.32.2025.11.18.03.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 03:14:27 -0800 (PST) Date: Tue, 18 Nov 2025 14:14:19 +0300 From: Dan Carpenter To: Toomas Soome Cc: smatch@vger.kernel.org Subject: Re: smatch, __builtin_unreachable() and uninitialized var... Message-ID: References: Precedence: bulk X-Mailing-List: smatch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Nov 17, 2025 at 11:50:42AM +0200, Toomas Soome wrote: > hi! > > While using smatch with OpenZFS code, we have stepped on this issue: > > /home/runner/work/zfs/zfs/zfs/module/icp/algs/aes/aes_modes.c:90 aes_encrypt_contiguous_blocks() error: uninitialized symbol 'rv'. > > > The function is using conditional call to function, which return value is stored to rv and the “impossible” else leg is marked with __builtin_unreachable() as seen there: > > https://github.com/openzfs/zfs/blob/master/module/icp/algs/aes/aes_modes.c#L77 > > it would be nice if smatch could use __builtin_unreachable() there to avoid this error… > Huh. Surprising that I've never noticed that before. I have fixed this locally and will push the change after testing it tonight. (I emailed the Sparse developers to see if they want to change it in their code as well, but either way I will update Smatch). Thanks for the bug report. regards, dan carpenter