[llvm-bugs] [Bug 35013] New: [openmp][debug] Instructions.h: Assertion "Both operands to ICmp instruction are not of the same type!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 20 10:44:34 PDT 2017


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

            Bug ID: 35013
           Summary: [openmp][debug] Instructions.h: Assertion "Both
                    operands to ICmp instruction are not of the same
                    type!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sergey.nesterov at intel.com
                CC: llvm-bugs at lists.llvm.org

====================my.c============================
void foo (int n, int *a)
{
    int (* p)[n] = &a;

    #pragma omp parallel
    if (p == &a) {}
}
====================================================
$ clang -v
clang version 6.0.0 (trunk 316219)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...



$ clang -c -O0 -g -fopenmp my.c -w
clang-6.0: .../llvm/include/llvm/IR/Instructions.h:1113: void
llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() ==
getOperand(1)->getType() && "Both operands to ICmp instruction are not of the
same type!"' failed.
#0 0x0000000004025a7b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000004025b0c PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000004023ff8 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000004025413 SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f8863a875e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007f886267e1f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007f886267f8e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007f8862677266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007f8862677312 (/lib64/libc.so.6+0x2e312)
#9 0x0000000002403a0c llvm::ICmpInst::AssertOK()
.../llvm/include/llvm/IR/Instructions.h:1115:0
#10 0x0000000002403af5 llvm::ICmpInst::ICmpInst(llvm::CmpInst::Predicate,
llvm::Value*, llvm::Value*, llvm::Twine const&)
.../llvm/include/llvm/IR/Instructions.h:1169:0
#11 0x00000000043444ea llvm::IRBuilder<llvm::ConstantFolder,
clang::CodeGen::CGBuilderInserter>::CreateICmp(llvm::CmpInst::Predicate,
llvm::Value*, llvm::Value*, llvm::Twine const&)
.../llvm/include/llvm/IR/IRBuilder.h:1639:0
#12 0x000000000464cbb8 (anonymous
namespace)::ScalarExprEmitter::EmitCompare(clang::BinaryOperator const*,
llvm::CmpInst::Predicate, llvm::CmpInst::Predicate, llvm::CmpInst::Predicate)
.../llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:3246:0
#13 0x000000000463f982 (anonymous
namespace)::ScalarExprEmitter::VisitBinEQ(clang::BinaryOperator const*)
.../llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:729:0
#14 0x00000000046513bc clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*)
.../llvm/tools/clang/include/clang/AST/StmtVisitor.h:63:0
#15 0x000000000463dafe (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
.../llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:358:0
#16 0x000000000464fe20
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
.../llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:3840:0
#17 0x00000000045f5ac9
clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(clang::Expr const*)
.../llvm/tools/clang/lib/CodeGen/CGExpr.cpp:150:0
#18 0x00000000043a7a97
clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(clang::Expr const*,
llvm::BasicBlock*, llvm::BasicBlock*, unsigned long)
.../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1650:0
#19 0x0000000004335141
clang::CodeGen::CodeGenFunction::EmitIfStmt(clang::IfStmt const&)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:640:0
#20 0x000000000433340e clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:134:0
#21 0x0000000004356026 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:1173:0
#22 0x0000000004356026
clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const
(.../debug_build/bin/clang-6.0+0x4356026)
#23 0x000000000436afc9 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#24 0x00000000046b4b95
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:717:0
#25 0x00000000046b8b52 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1141:0
#26 0x00000000043513ff
clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:485:0
#27 0x00000000046b9e38
emitParallelOrTeamsOutlinedFunction(clang::CodeGen::CodeGenModule&,
clang::OMPExecutableDirective const&, clang::CapturedStmt const*,
clang::VarDecl const*, clang::OpenMPDirectiveKind, llvm::StringRef,
clang::CodeGen::RegionCodeGenTy const&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1298:0
#28 0x00000000046b9ee6
clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, clang::OpenMPDirectiveKind,
clang::CodeGen::RegionCodeGenTy const&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1307:0
#29 0x0000000004355b47
emitCommonOMPParallelDirective(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, clang::OpenMPDirectiveKind,
clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&,
llvm::SmallVectorImpl<llvm::Value*>&)> const&)
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:1117:0
#30 0x00000000043560ed
clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:1178:0
#31 0x00000000043336e7 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:188:0
#32 0x00000000043340e6
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:379:0
#33 0x00000000043a5a47
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1137:0
#34 0x00000000043a65b6
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
.../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1302:0
#35 0x00000000043c41af
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3258:0
#36 0x00000000043bf8f4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:2036:0
#37 0x00000000043bea75
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:1813:0
#38 0x00000000043c7d68
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:4000:0
#39 0x0000000004ddce34 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp:159:0
#40 0x0000000004dd6693
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:170:0
#41 0x0000000005a53226 clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#42 0x00000000048ed02e clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#43 0x0000000004dd4f70 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#44 0x00000000048eca6f clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#45 0x000000000488eba6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#46 0x0000000004a24242
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#47 0x000000000202484b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#48 0x000000000201a554 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#49 0x000000000201b1dd main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#50 0x00007f886266ac05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#51 0x0000000002017dd9 _start (.../debug_build/bin/clang-6.0+0x2017dd9)
Stack dump:
0.      Program arguments: .../debug_build/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
my.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /my.gcno
-resource-dir .../debug_build/lib/clang/6.0.0 -internal-isystem
/usr/local/include -internal-isystem .../debug_build/lib/clang/6.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-w -fdebug-compilation-dir  -ferror-limit 19 -fmessage-length 0 -fopenmp
-fobjc-runtime=gcc -fdiagnostics-show-option -o my.o -x c my.c 
1.      <eof> parser at end of file
2.      my.c:1:6: LLVM IR generation of declaration 'foo'
3.      my.c:1:6: Generating code for declaration 'foo'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 316219)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_debug/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/my-642b66.c
clang-6.0: note: diagnostic msg: /tmp/my-642b66.sh
clang-6.0: 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/20171020/4f0e10bb/attachment-0001.html>


More information about the llvm-bugs mailing list