[llvm-bugs] [Bug 44166] New: [REGRESSION] Crash in EmitScalarPrePostIncDec

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 27 10:45:05 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44166

            Bug ID: 44166
           Summary: [REGRESSION] Crash in EmitScalarPrePostIncDec
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 22873
  --> https://bugs.llvm.org/attachment.cgi?id=22873&action=edit
Testcase showing the crash

This looks like a recent regression on trunk, which happens when building SDL2
using very latest clang (we noticed this on Emscripten CI).

STR:

$ clang b.c -c -w

clang-10:
/b/s/w/ir/cache/builder/emscripten-releases/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:2428:
llvm::Value *(anonymous
namespace)::ScalarExprEmitter::EmitScalarPrePostIncDec(const
clang::UnaryOperator *, clang::CodeGen::LValue, bool, bool): Assertion
`(!type->isPromotableIntegerType() || (type->isSignedIntegerOrEnumerationType()
|| CGF.getContext() .getPromotedIntegerType(type)
->isSignedIntegerOrEnumerationType())) && "The following check expects that if
we do promotion, at least one " "of the types (either base or promoted) will be
signed."' failed.
Stack dump:
0.      Program arguments: /home/azakai/Dev/sdk/upstream/bin/clang-10 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name b.c -mrelocation-model static -mthread-model posix
-mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/home/azakai/Dev/sdk/upstream/lib/clang/10.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/azakai/Dev/sdk/upstream/lib/clang/10.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -w
-fdebug-compilation-dir /home/azakai/Dev/emscripten -ferror-limit 19
-fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o b.o -x c b.c 
1.      b.c:6181:1: current parser token 'void'
2.      b.c:6166:1: LLVM IR generation of declaration 'SDL_ResetKeyboard'
3.      b.c:6166:1: Generating code for declaration 'SDL_ResetKeyboard'
 #0 0x00007f9b2fc0e354 PrintStackTraceSignalHandler(void*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libLLVM-10git.so+0x71c354)
 #1 0x00007f9b2fc0bffe llvm::sys::RunSignalHandlers()
(/home/azakai/Dev/sdk/upstream/bin/../lib/libLLVM-10git.so+0x719ffe)
 #2 0x00007f9b2fc0e616 SignalHandler(int)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libLLVM-10git.so+0x71c616)
 #3 0x00007f9b2f2e53a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #4 0x00007f9b2b819cfb raise (/lib/x86_64-linux-gnu/libc.so.6+0x36cfb)
 #5 0x00007f9b2b8048ad abort (/lib/x86_64-linux-gnu/libc.so.6+0x218ad)
 #6 0x00007f9b2b80477f (/lib/x86_64-linux-gnu/libc.so.6+0x2177f)
 #7 0x00007f9b2b812542 (/lib/x86_64-linux-gnu/libc.so.6+0x2f542)
 #8 0x00007f9b2d67270d (anonymous
namespace)::ScalarExprEmitter::EmitScalarPrePostIncDec(clang::UnaryOperator
const*, clang::CodeGen::LValue, bool, bool)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x175070d)
 #9 0x00007f9b2d676812 clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x1754812)
#10 0x00007f9b2d66d625
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x174b625)
#11 0x00007f9b2d61e3a0 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x16fc3a0)
#12 0x00007f9b2d61e349
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x16fc349)
#13 0x00007f9b2d77d1dc clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x185b1dc)
#14 0x00007f9b2d780412
clang::CodeGen::CodeGenFunction::EmitForStmt(clang::ForStmt const&,
llvm::ArrayRef<clang::Attr const*>)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x185e412)
#15 0x00007f9b2d77d68f clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x185b68f)
#16 0x00007f9b2d7884e0
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18664e0)
#17 0x00007f9b2d7d5242
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18b3242)
#18 0x00007f9b2d7f2187
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18d0187)
#19 0x00007f9b2d7ea446
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18c8446)
#20 0x00007f9b2d7f61d1
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18d41d1)
#21 0x00007f9b2d880b40 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x195eb40)
#22 0x00007f9b2d7cb18b
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x18a918b)
#23 0x00007f9b2c6a5154 clang::ParseAST(clang::Sema&, bool, bool)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x783154)
#24 0x00007f9b2dff3670 clang::FrontendAction::Execute()
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x20d1670)
#25 0x00007f9b2df92962
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x2070962)
#26 0x00007f9b2e066150
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/azakai/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.10git+0x2144150)
#27 0x00000000004103b6 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/azakai/Dev/sdk/upstream/bin/clang-10+0x4103b6)
#28 0x000000000040e8e5 main
(/home/azakai/Dev/sdk/upstream/bin/clang-10+0x40e8e5)
#29 0x00007f9b2b80652b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2352b)
#30 0x000000000040b8e9 _start
(/home/azakai/Dev/sdk/upstream/bin/clang-10+0x40b8e9)
clang-10: error: unable to execute command: Aborted
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0
(/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project
9f15fcc2718f95f1dac9e6e57aa93d84e9709930)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/azakai/Dev/sdk/upstream/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-10: note: diagnostic msg:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191127/fbe12b51/attachment.html>


More information about the llvm-bugs mailing list