From nobody Sat Apr 20 10:32:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VM7BX370vz5HW5k; Sat, 20 Apr 2024 10:32:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VM7BX08fKz4QH1; Sat, 20 Apr 2024 10:32:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OSTCjpgz9FWFRGGcLTRZuKawuI48tSkGIt69b4G5/zU=; b=uig4VvsNfyOiauYTGSaYGsOwcZzLJA2PhkP5nmzA2ikyhkPvTr/N2b4kqZFuqg7QTvcjvq NWLGQbj6ilh+SzQb0M+/WLd2yGs24GsBZS2rADuH0UXyBtcVp9gBXUsSqamU+yXzX9Obtb mjNx7LI8a2LlKkiJwLJDrfLyIbYx+6DavUOAnLpt2JxBkY5d5YS85VjmvYi1rkzgvGThXt qWeETog1ETtAE2NoBFIwMPR1LbvkjoatpVlHdefA6hMCrecyPNgr/BqOxWRdMvQutbFQxL n/lPrsOmPoZBfZVA/ZDyEcDW7R0aDcZRTD9Cmn5NtGA5P9qIThKEMsZTiO7vhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713609172; a=rsa-sha256; cv=none; b=olX/0AqU6lC2vMhnl2gwmYbMHuhPKsMLDmacE+y6jLJ5p8yWGExnM+fC2kZMtMZJyuMgI3 3yNoY6g1UVdt29O37Y+jgoGfdXsRyiIOY5OFCUjMGyhreTYpCOLkkuyU/Gy6Yls6sRN/pY hkGdVrnIpbPDc1Bn0umE9arT4JL34OBI7lnEeFPnlYVlmr6FvSsk5rhrvHr0S6kSgvrET6 /+jq2y6xDfRQapEuplCGOZwuZFA/VDl/9siEvx0Qt9cQ/baKq2YhM3OtHZfG+FuAh7Laqb TbsRZzCp3qcGSMd02Ua1KzhA7kyPSZBEEyxuKUx3bkpa4Rc1WrA1yG9MccYMbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OSTCjpgz9FWFRGGcLTRZuKawuI48tSkGIt69b4G5/zU=; b=s55Y9GsydvVe6nlfjRBVJHN/flxfDd0FxU4ulpRsp3FjAz+jsrKAkp6c1enUWUh8KIjKrn 59tMVgKF/zyb4FgzoKcbgcm3jo2414dreT1ia8TqOmThGVCdjCWXsKQJvTKEknDG3bTaMq GeP+dDgfcXWi28MXAsxINJy1ey7o7h5BQTX7d4c8BiugnKaaSEh/y+qr/U0vnxrPHHSC3H CnIn78sGfSUVhKAjF0VxApwUbuX8lDhlyuzz0dMRbvbWod7YP8M2blbdMtEZ4/D046hJTX AMdLpKrjNI5EL6y/8E7mNAAyUfigzEYRkmfv8/SoYDxSd1OJNM7WgEQm/cbzAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VM7BW5XNczZ9p; Sat, 20 Apr 2024 10:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43KAWpqk012107; Sat, 20 Apr 2024 10:32:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43KAWpSM012103; Sat, 20 Apr 2024 10:32:51 GMT (envelope-from git) Date: Sat, 20 Apr 2024 10:32:51 GMT Message-Id: <202404201032.43KAWpSM012103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 40d5cf3f394d - stable/14 - Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40d5cf3f394d72b9c6a9ce69cebd95d168b1fa72 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=40d5cf3f394d72b9c6a9ce69cebd95d168b1fa72 commit 40d5cf3f394d72b9c6a9ce69cebd95d168b1fa72 Author: Dimitry Andric AuthorDate: 2024-04-15 16:24:39 +0000 Commit: Dimitry Andric CommitDate: 2024-04-20 10:03:26 +0000 Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com): [SimplifyCFG] Fix crash when there is unreachable large index (#88616) The large case index out of scope is dead code, but it is still be created for TableContents in SwitchLookupTable::SwitchLookupTable, so make sure the table size after growing should not get smaller. Fix https://github.com/llvm/llvm-project/issues/88607 This should fix "Assertion failed: (idx < size()), function operator[]" when building the science/dynare port. PR: 276104, 278320 Reported by: yuri MFC after: 1 month (cherry picked from commit 514c98ba14a0f590891844d1a6bec0ac4de54489) --- contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 13eae549b2ce..f95dae1842fe 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -6710,9 +6710,11 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder, return SwitchLookupTable::WouldFitInRegister( DL, UpperBound, KV.second /* ResultType */); })) { + // There may be some case index larger than the UpperBound (unreachable + // case), so make sure the table size does not get smaller. + TableSize = std::max(UpperBound, TableSize); // The default branch is unreachable after we enlarge the lookup table. // Adjust DefaultIsReachable to reuse code path. - TableSize = UpperBound; DefaultIsReachable = false; } }