From nobody Thu Jul 13 18:59:23 2023 X-Original-To: dev-commits-src-main@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 4R23n72p2Xz4mZ4l; Thu, 13 Jul 2023 18:59:23 +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 4R23n72LV4z4LQc; Thu, 13 Jul 2023 18:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689274763; 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=zvV06Nq6il69aI7K9DTnR2Yp191oo08ROnOSFFUF3Y0=; b=v3iUxM4Nf5D4Mmy08xEi9EMIVR+6dDPFG9QzC77V4f/1A19tCr7oyWrYCY13Sn+azaoPpj ofAK1s1IWQHcTQEMDDaaixI5xkWcM8iwULGjB+D48KViG4MmA/BAl4186Z0BXuhv4MkUis ZDqEGlmwI9eEolkHCNcCufdg2w6AobHIYtxMfesWo9phMWEzoNzvM23VMF3bOCD4YAR0ls 2d4OQCD/hE5sGYuM+jv2qy1lrvf0tPW0/qfMm8Hw48A4O+XheDo8hZDrAL7R3xEoeJCAfP DPAP4YsbFEbrSbfdEVbsbfzAm5fC2wVWVFO1Dj7Q29hz3UZg8TIz7dlscpY/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689274763; 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=zvV06Nq6il69aI7K9DTnR2Yp191oo08ROnOSFFUF3Y0=; b=DkI1n2JEhYu41fpNHlw9Rruyzvhj/8GLUewOaV4lUOXAEQ5nrXpXXH/fgtb2PRqg7AYXxQ dETB53z76dXn38iu0k8aZEcc9fGiqVL4+z5fCgpuDAJ0oRbFwyOkt83qGeu8ZCO/YJf7kU mVRV54L+kIcQyl9LFmbXSB8+RaasiaKLuY+dWybLPaq2C2rVN6cxgCpK9fvmDTZQQ1H1UD 23/pIXZrUuM2E/OuenVxkAOdKQJoYGcPLe0xEOph5BfCjcy5B511rNaxzEsYjzOZxuM4pw frml0K//IoKDAdyOo7wZ6yQf/QKwDgqiKWMNpFwM91bK+iRW9QVMuLoPhRr30Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689274763; a=rsa-sha256; cv=none; b=ILAjQSICc8GjsuAeY8ja4SNASYq14gxtiFN/LasKwCliW3lRN+D+nc2ZYgkRjF+kYX587j 888Z0ZV3eWVmwattknrKn3xBvHtn7iFP52pTBk/s55bD2HpJ6tdJFoi+FskrD9dGWT7Wd3 G0OJiTQDVvDzg5u8MZC1y+5KHjJ+BrnSxSrfo2VpL9FfuvuDRx9xWdPtjNPMrIh0HNFDgx Eq+8B9QEfcPdoI/5bc4GATLO0YVq8iQI7x3axl3HS1qx4orzoC0tqbjs5wgroriUODVAkR fJj8obhHJqH5z/W01HDAEjY/1jCBF8KkXO9pmSaoaUTkZkocZHvcmQlVTFHpjA== 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 4R23n71JgRz12M2; Thu, 13 Jul 2023 18:59:23 +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 36DIxNCx058532; Thu, 13 Jul 2023 18:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36DIxNPi058531; Thu, 13 Jul 2023 18:59:23 GMT (envelope-from git) Date: Thu, 13 Jul 2023 18:59:23 GMT Message-Id: <202307131859.36DIxNPi058531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1cd9788408aa - main - Merge commit fde5924dcc69 from llvm-project (by Serge Pavlov): List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1cd9788408aa9ea4fd0fbc3e06bd9a4eaf8d8d22 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1cd9788408aa9ea4fd0fbc3e06bd9a4eaf8d8d22 commit 1cd9788408aa9ea4fd0fbc3e06bd9a4eaf8d8d22 Author: Dimitry Andric AuthorDate: 2023-07-13 18:57:22 +0000 Commit: Dimitry Andric CommitDate: 2023-07-13 18:57:22 +0000 Merge commit fde5924dcc69 from llvm-project (by Serge Pavlov): [clang] Reset FP options before template instantiation AST nodes that may depend on FP options keep them as a difference relative to the options outside the AST node. At the moment of instantiation the FP options may be different from the default values, defined by command-line option. In such case FP attributes would have unexpected values. For example, the code: template void func_01(int last, C) { func_01(last, int()); } void func_02() { func_01(0, 1); } #pragma STDC FENV_ACCESS ON caused compiler crash, because template instantiation takes place at the end of translation unit, where pragma STDC FENV_ACCESS is in effect. As a result, code in the template instantiation would use constrained intrinsics while the function does not have StrictFP attribute. To solve this problem, FP attributes in Sema must be set to default values, defined by command line options. This change resolves https://github.com/llvm/llvm-project/issues/63542. Differential Revision: https://reviews.llvm.org/D154359 Requested by: pkubaj PR: 265755, 265758 MFC after: 1 month --- contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 7a0da8d08333..bed5237749c5 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -5057,6 +5057,10 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, // PushDeclContext because we don't have a scope. Sema::ContextRAII savedContext(*this, Function); + FPFeaturesStateRAII SavedFPFeatures(*this); + CurFPFeatures = FPOptions(getLangOpts()); + FpPragmaStack.CurrentValue = FPOptionsOverride(); + if (addInstantiatedParametersToScope(Function, PatternDecl, Scope, TemplateArgs)) return;