Date: Sat, 21 Aug 2021 15:15:06 GMT From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d5c7f929b50d - stable/11 - Apply upstream clang fix for assertion failure compiling devel/capnproto Message-ID: <202108211515.17LFF65Z094173@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c7f929b50dbd5965c500ab42c93d0a2736ef99 commit d5c7f929b50dbd5965c500ab42c93d0a2736ef99 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-21 15:13:10 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> 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<MaterializeTemporaryExpr>(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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108211515.17LFF65Z094173>