configure.ac |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 384f946b12a5c19719f527ff9a20e7125bcf7b22
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Apr 22 14:26:01 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Apr 22 15:23:15 2021 +0200

    Detect a Clang consteval bug
    
    ...that hit us since 21584b304b21bfe6b99b6f29018c6b754ea28fc0 "make
    OUString(OUStringLiteral) constructor constexpr" e.g. at
    
    > [CXX] sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx
    > Assertion failed: (getOperand(0)->getType() == 
cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a 
pointer to Val type!"), function AssertOK, file 
~/github.com/llvm/llvm-project/llvm/lib/IR/Instructions.cpp, line 1469.
    > PLEASE submit a bug report to https://bugs.llvm.org/ and include the 
crash backtrace, preprocessed source, and associated run script.
    > Stack dump:
    > 0.    Program arguments: ~/llvm/inst/bin/clang++ -target 
arm64-apple-macos -stdlib=libc++ -mmacosx-version-min=11.0 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
 -ferror-limit=0 -DAARCH64 -DBOOST_ERROR_CODE_HEADER_ONLY 
-DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=gcc3 -DDBG_UTIL -DMACOSX 
-DMAC_OS_X_VERSION_MAX_ALLOWED=110100 -DMAC_OS_X_VERSION_MIN_REQUIRED=110000 
-DNO_PTHREAD_PRIORITY -DOSL_DEBUG_LEVEL=1 -DSAL_LOG_INFO -DSAL_LOG_WARN -DUNIX 
-DUNX -D_DEBUG -D_PTHREADS -D_REENTRANT "-DCPPUNIT_PLUGIN_EXPORT=extern \"C\" 
SAL_DLLPUBLIC_EXPORT" -fvisibility=hidden -Werror -Xclang -load -Xclang 
~/lo/core/compilerplugins/clang/plugin.so -Xclang -add-plugin -Xclang loplugin 
-Xclang -plugin-arg-loplugin -Xclang --debug -Wall -Wno-missing-braces 
-Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunreachable-code 
-Wunused-macros -Wembedded-directive -finput-charset=UTF-8 -fmessage-length=0 
-fno-common -pipe -fstack-protector-strong
  -fdiagnostics-color=always -Wdeprecated-copy-dtor -Wimplicit-fallthrough 
-Wunused-exception-parameter -Wrange-loop-analysis -fvisibility-inlines-hidden 
-fPIC -Woverloaded-virtual -Wshadow -Wno-ctor-dtor-privacy -fno-strict-aliasing 
-fsigned-char -std=c++2b -O0 -fstrict-aliasing -fstrict-overflow -ggdb2 
-gsplit-dwarf -Xclang -debug-info-kind=constructor -DEXCEPTIONS_ON -fexceptions 
-DLIBO_INTERNAL_ONLY -c 
~/lo/core/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx -o 
~/lo/core/workdir/CxxObject/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.o
 -MMD -MT 
~/lo/core/workdir/CxxObject/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.o
 -MP -MF 
~/lo/core/workdir/Dep/CxxObject/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.d_
 -I~/lo/core/external/boost/include -I~/lo/core/workdir/UnpackedTarball/boost 
-I~/lo/core/sal/qa/inc -I~/lo/core/workdir/UnpackedTarball/cppunit/include 
-I~/lo/core/include 
-I~/azul.com/zulu16.28.11-ca-jdk16.0.0-macosx_aarch64/zulu-16.jdk/Contents/
 Home/include 
-I~/azul.com/zulu16.28.11-ca-jdk16.0.0-macosx_aarch64/zulu-16.jdk/Contents/Home/include/darwin
 -I~/lo/core/config_host
    > 1.    <eof> parser at end of file
    > 2.    Per-file LLVM IR generation
    > 3.    
~/lo/core/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx:24:10: 
Generating code for declaration '(anonymous namespace)::Test::test'
    > Stack dump without symbol names (ensure you have llvm-symbolizer in your 
PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
    > 0  clang++                  0x00000001026d3408 
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
    > 1  clang++                  0x00000001026d24cc 
llvm::sys::RunSignalHandlers() + 128
    > 2  clang++                  0x00000001026d2b84 
llvm::sys::CleanupOnSignal(unsigned long) + 236
    > 3  clang++                  0x0000000102628c0c (anonymous 
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) + 128
    > 4  clang++                  0x0000000102628df0 
CrashRecoverySignalHandler(int) + 152
    > 5  libsystem_platform.dylib 0x0000000185c49c44 _sigtramp + 56
    > 6  libsystem_pthread.dylib  0x0000000185c01c24 pthread_kill + 292
    > 7  libsystem_c.dylib        0x0000000185b49864 abort + 104
    > 8  libsystem_c.dylib        0x0000000185b48b68 err + 0
    > 9  clang++                  0x0000000104f30fc8 
llvm::StoreInst::AssertOK() (.cold.6) + 0
    > 10 clang++                  0x0000000101fc1110 
llvm::StoreInst::AssertOK() + 164
    > 11 clang++                  0x0000000101fc1504 
llvm::StoreInst::StoreInst(llvm::Value*, llvm::Value*, bool, llvm::Align, 
llvm::AtomicOrdering, unsigned char, llvm::Instruction*) + 316
    > 12 clang++                  0x00000001022acee4 
llvm::IRBuilderBase::CreateAlignedStore(llvm::Value*, llvm::Value*, 
llvm::MaybeAlign, bool) + 144
    > 13 clang++                  0x00000001029ef018 
clang::CodeGen::CodeGenFunction::EmitAggregateStore(llvm::Value*, 
clang::CodeGen::Address, bool) + 216
    > 14 clang++                  0x0000000102a6235c 
clang::StmtVisitorBase<std::__1::add_pointer, (anonymous 
namespace)::AggExprEmitter, void>::Visit(clang::Stmt*) + 8400
    > 15 clang++                  0x0000000102a66ca4 (anonymous 
namespace)::AggExprEmitter::VisitCastExpr(clang::CastExpr*) + 2132
    > 16 clang++                  0x0000000102a5f318 
clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, 
clang::CodeGen::AggValueSlot) + 532
    > 17 clang++                  0x0000000102a496e4 
clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(clang::Expr const*, 
clang::CodeGen::Address, clang::Qualifiers, bool) + 364
    > 18 clang++                  0x0000000102a4a438 
clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(clang::MaterializeTemporaryExpr
 const*) + 1708
    > 19 clang++                  0x0000000102a49210 
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 1588
    > 20 clang++                  0x0000000102a4bd78 
clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(clang::Expr const*) 
+ 36
    > 21 clang++                  0x00000001029f9314 
clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, 
clang::Expr const*, clang::QualType) + 672
    > 22 clang++                  0x00000001029f8a10 
clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, 
clang::CodeGen::CodeGenFunction::PrototypeWrapper, 
llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* 
const, clang::Stmt const* const> >, 
clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, 
clang::CodeGen::CodeGenFunction::EvaluationOrder) + 1344
    > 23 clang++                  0x0000000102a5da38 
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, 
clang::CodeGen::CGCallee const&, clang::CallExpr const*, 
clang::CodeGen::ReturnValueSlot, llvm::Value*) + 2176
    > 24 clang++                  0x0000000102a5ce00 
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, 
clang::CodeGen::ReturnValueSlot) + 560
    > 25 clang++                  0x0000000102a66428 clang::CodeGen::RValue 
llvm::function_ref<clang::CodeGen::RValue 
(clang::CodeGen::ReturnValueSlot)>::callback_fn<(anonymous 
namespace)::AggExprEmitter::VisitCallExpr(clang::CallExpr const*)::$_0>(long, 
clang::CodeGen::ReturnValueSlot) + 72
    > 26 clang++                  0x0000000102a662bc (anonymous 
namespace)::AggExprEmitter::withReturnValueSlot(clang::Expr const*, 
llvm::function_ref<clang::CodeGen::RValue (clang::CodeGen::ReturnValueSlot)>) + 
620
    > 27 clang++                  0x0000000102a63564 (anonymous 
namespace)::AggExprEmitter::VisitCallExpr(clang::CallExpr const*) + 160
    > 28 clang++                  0x0000000102a5f318 
clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, 
clang::CodeGen::AggValueSlot) + 532
    > 29 clang++                  0x0000000102a496e4 
clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(clang::Expr const*, 
clang::CodeGen::Address, clang::Qualifiers, bool) + 364
    > 30 clang++                  0x0000000102a4a438 
clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(clang::MaterializeTemporaryExpr
 const*) + 1708
    > 31 clang++                  0x0000000102a49210 
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 1588
    > 32 clang++                  0x0000000102a4bd78 
clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(clang::Expr const*) 
+ 36
    > 33 clang++                  0x00000001029f9314 
clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, 
clang::Expr const*, clang::QualType) + 672
    > 34 clang++                  0x00000001029f8a10 
clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, 
clang::CodeGen::CodeGenFunction::PrototypeWrapper, 
llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* 
const, clang::Stmt const* const> >, 
clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, 
clang::CodeGen::CodeGenFunction::EvaluationOrder) + 1344
    > 35 clang++                  0x0000000102a6849c 
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr
 const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, 
clang::NestedNameSpecifier*, bool, clang::Expr const*) + 1164
    > 36 clang++                  0x0000000102a69218 
clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr
 const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot) + 124
    > 37 clang++                  0x0000000102a5cd20 
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, 
clang::CodeGen::ReturnValueSlot) + 336
    > 38 clang++                  0x0000000102a504ac 
clang::CodeGen::CodeGenFunction::EmitCallExprLValue(clang::CallExpr const*) + 52
    > 39 clang++                  0x0000000102a48c78 
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 156
    > 40 clang++                  0x0000000102a48d70 
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 404
    > 41 clang++                  0x0000000102a489f4 
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 32
    > 42 clang++                  0x0000000102b51b6c 
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, 
llvm::ArrayRef<clang::Attr const*>) + 276
    > 43 clang++                  0x0000000102b59b74 
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
 const&, bool, clang::CodeGen::AggValueSlot) + 168
    > 44 clang++                  0x0000000102b9cdf8 
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) + 212
    > 45 clang++                  0x0000000102b9d6cc 
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, 
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 892
    > 46 clang++                  0x0000000102bb651c 
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, 
llvm::GlobalValue*) + 460
    > 47 clang++                  0x0000000102bb073c 
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, 
llvm::GlobalValue*) + 568
    > 48 clang++                  0x0000000102ba73cc 
clang::CodeGen::CodeGenModule::EmitDeferred() + 740
    > 49 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 50 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 51 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 52 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 53 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 54 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 55 clang++                  0x0000000102ba73f4 
clang::CodeGen::CodeGenModule::EmitDeferred() + 780
    > 56 clang++                  0x0000000102ba61f4 
clang::CodeGen::CodeGenModule::Release() + 76
    > 57 clang++                  0x0000000102c2e778 (anonymous 
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) + 80
    > 58 clang++                  0x0000000102b94f60 
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 180
    > 59 clang++                  0x0000000102e6c9c8 
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) + 52
    > 60 clang++                  0x0000000103aa727c 
clang::ParseAST(clang::Sema&, bool, bool) + 524
    > 61 clang++                  0x0000000102e38404 
clang::FrontendAction::Execute() + 100
    > 62 clang++                  0x0000000102dcc1a8 
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 820
    > 63 clang++                  0x0000000102ea18d4 
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1268
    > 64 clang++                  0x0000000100acfe48 
cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2012
    > 65 clang++                  0x0000000100ace088 
ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 720
    > 66 clang++                  0x0000000102c9b104 void 
llvm::function_ref<void 
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
 >, std::__1::basic_string<char, std::__1::char_traits<char>, 
std::__1::allocator<char> >*, bool*) const::$_1>(long) + 28
    > 67 clang++                  0x0000000102628b20 
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 244
    > 68 clang++                  0x0000000102c9ab9c 
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
 >, std::__1::basic_string<char, std::__1::char_traits<char>, 
std::__1::allocator<char> >*, bool*) const + 232
    > 69 clang++                  0x0000000102c7575c 
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, 
clang::driver::Command const*&) const + 220
    > 70 clang++                  0x0000000102c75bd4 
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, 
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) 
const + 112
    > 71 clang++                  0x0000000102c87858 
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, 
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) + 
224
    > 72 clang++                  0x0000000100acd928 main + 8540
    > 73 libdyld.dylib            0x0000000185c1df34 start + 4
    > clang-13: error: clang frontend command failed with exit code 134 (use -v 
to see invocation)
    > clang version 13.0.0 (https://github.com/llvm/llvm-project.git 
5d2ffab5dfeec1cae8c79becd95c917cf7a8c0ea)
    > Target: arm64-apple-macos
    > Thread model: posix
    > InstalledDir: ~/llvm/inst/bin
    
    Change-Id: Ibe023a580e32638af30d05e5e2df383ee9aaecf6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114479
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/configure.ac b/configure.ac
index 35e80904d58d..e3fa28c32298 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7204,9 +7204,11 @@ AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
 
 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 consteval])
 dnl ...that does not suffer from 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994> "Missing code
-dnl from consteval constructor initializing const variable" or
+dnl from consteval constructor initializing const variable",
 dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98752> "wrong 'error: ‘this’ 
is not a constant
-dnl expression' with consteval constructor":
+dnl expression' with consteval constructor", or 
<https://bugs.llvm.org/show_bug.cgi?id=50063> "code
+dnl using consteval: 'clang/lib/CodeGen/Address.h:38: llvm::Value*
+dnl clang::CodeGen::Address::getPointer() const: Assertion `isValid()' 
failed.'":
 AC_LANG_PUSH([C++])
 save_CXXFLAGS=$CXXFLAGS
 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
@@ -7222,6 +7224,15 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
             S1 x;
             S2(): x(0) {}
         };
+
+        struct S3 {
+            consteval S3() {}
+            union {
+                int a;
+                unsigned b = 0;
+            };
+        };
+        void f() { S3(); }
     ], [
         return (s.i == 1) ? 0 : 1;
     ])], [
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to