When building RawThreapee 5.5: Assertion failed: (Result.isUninit() && "temporary created multiple times"), function createTemporary, file /usr/src/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp, line 1174. c++: error: unable to execute command: Abort trap (core dumped) c++: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) Target: x86_64-unknown-freebsd13.0 Thread model: posix InstalledDir: /usr/bin repro file thingy: https://unrelentingtech.s3.dualstack.eu-west-1.amazonaws.com/main-068a89.tar.zst I haven't updated my -CURRENT to clang7 in base yet, but I guess this clang version is now in 12.. (Are assertions enabled in -STABLE??)
A commit references this bug: Author: dim Date: Thu Dec 20 18:28:55 UTC 2018 New revision: 342281 URL: https://svnweb.freebsd.org/changeset/base/342281 Log: Pull in r329671 from upstream clang trunk (by Akira Hatanaka): [ExprConstant] Use an AST node and a version number as a key to create an APValue and retrieve it from map Temporaries. The version number is needed when a single AST node is visited multiple times and is used to create APValues that are required to be distinct from each other (for example, MaterializeTemporaryExprs in default arguments and VarDecls in loops). rdar://problem/36505742 Differential Revision: https://reviews.llvm.org/D42776 This should fix 'Assertion failed: (Result.isUninit() && "temporary created multiple times"), function createTemporary' errors (if assertions are enabled, otherwise the compiler internal state might go bad), when building the graphics/rawtherapee port. Direct commit to stable/11 and stable/12, since head already has clang 7.0.1, which includes this change. PR: 234144 Changes: stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
Note that assertions aren't enabled in -STABLE branches and releases. But since this assertion showed that some internal state wasn't consistent, it was better to apply the upstream fix, even though it isn't trivial.
(In reply to Dimitry Andric from comment #2) Thanks!
Added https://reviews.freebsd.org/D18699 for including the patch in the llvm60 port.