From owner-dev-commits-src-branches@freebsd.org Sat Aug 21 15:15:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1249D67412B; Sat, 21 Aug 2021 15:15:07 +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 4GsMWH02wHz4hqY; Sat, 21 Aug 2021 15:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 DDC3B7049; Sat, 21 Aug 2021 15:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LFF6QC094174; Sat, 21 Aug 2021 15:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LFF65Z094173; Sat, 21 Aug 2021 15:15:06 GMT (envelope-from git) Date: Sat, 21 Aug 2021 15:15:06 GMT Message-Id: <202108211515.17LFF65Z094173@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: d5c7f929b50d - stable/11 - Apply upstream clang fix for assertion failure compiling devel/capnproto 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/11 X-Git-Reftype: branch X-Git-Commit: d5c7f929b50dbd5965c500ab42c93d0a2736ef99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 15:15:07 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c7f929b50dbd5965c500ab42c93d0a2736ef99 commit d5c7f929b50dbd5965c500ab42c93d0a2736ef99 Author: Dimitry Andric AuthorDate: 2021-08-21 15:13:10 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 15:14:00 +0000 Apply upstream clang fix for assertion failure compiling devel/capnproto Merge commit 48c70c1664aa from llvm git (by Richard Smith): Extend memset-to-zero optimization to C++11 aggregate functional casts Aggr{...}. We previously missed these cases due to not stepping over the additional AST nodes representing their syntactic form. Direct commit to stable/11, as both main and stable/13 already have this fix as part of clang 12.0.1. Reported by: fernape PR: 257961 --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index 53dbfecfc538..658f0778796b 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1732,7 +1732,9 @@ void AggExprEmitter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) /// non-zero bytes that will be stored when outputting the initializer for the /// specified initializer expression. static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { - E = E->IgnoreParens(); + if (auto *MTE = dyn_cast(E)) + E = MTE->getSubExpr(); + E = E->IgnoreParenNoopCasts(CGF.getContext()); // 0 and 0.0 won't require any non-zero stores! if (isSimpleZero(E, CGF)) return CharUnits::Zero(); @@ -1781,7 +1783,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { } } - + // FIXME: This overestimates the number of non-zero bytes for bit-fields. CharUnits NumNonZeroBytes = CharUnits::Zero(); for (unsigned i = 0, e = ILE->getNumInits(); i != e; ++i) NumNonZeroBytes += GetNumNonZeroBytesInInit(ILE->getInit(i), CGF);