Closed 5d21713e-153b-4ee3-b86b-e7e1f9a492f9 closed 2 years ago
mentioned in issue llvm/llvm-bugzilla-archive#13893
confirmed, fs/ext4/super.c compiles fine now, thank you!
Fixed the assertion failure in r164377.
Reduced testcase :
int a; unsigned long b;
void func(void) { unsigned c = 2 << a; b /= c; }
yes, this does fail for me the same way as well:
clang: /llvm.svn/lib/VMCore/Instructions.cpp:1825: static llvm::BinaryOperator llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value , llvm::Value , const llvm::Twine &, llvm::Instruction ): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed. 0 libLLVM-3.2svn.so 0x0000033749f0799f 1 libLLVM-3.2svn.so 0x0000033749f07e64 2 libpthread.so.0 0x00000337499221c0 3 libc.so.6 0x000003374898cad5 gsignal + 53 4 libc.so.6 0x000003374898df4b abort + 379 5 libc.so.6 0x0000033748985bbe 6 libc.so.6 0x0000033748985c62 7 libLLVM-3.2svn.so 0x000003374a118de2 8 libLLVM-3.2svn.so 0x000003374a2510d4 9 libLLVM-3.2svn.so 0x000003374a280877 10 libLLVM-3.2svn.so 0x000003374a2a4987 11 libLLVM-3.2svn.so 0x000003374a2a52df 12 libLLVM-3.2svn.so 0x000003374a1354ab llvm::FPPassManager::runOnFunction(llvm::Function&) + 443 13 libLLVM-3.2svn.so 0x000003374a13570b llvm::FPPassManager::runOnModule(llvm::Module&) + 155 14 libLLVM-3.2svn.so 0x000003374a135983 llvm::MPPassManager::runOnModule(llvm::Module&) + 419 15 libLLVM-3.2svn.so 0x000003374a135f08 llvm::PassManagerImpl::run(llvm::Module&) + 408 16 libLLVM-3.2svn.so 0x000003374a13606a llvm::PassManager::run(llvm::Module&) + 10 17 clang 0x000000000067ae50 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module, clang::BackendAction, llvm::raw_ostream) + 5008 18 clang 0x0000000000678cfa 19 clang 0x00000000007a1634 clang::ParseAST(clang::Sema&, bool, bool) + 516 20 clang 0x0000000000677d88 clang::CodeGenAction::ExecuteAction() + 184 21 clang 0x000000000055b015 clang::FrontendAction::Execute() + 101 22 clang 0x000000000053e3ad clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973 23 clang 0x00000000005267d4 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 3316 24 clang 0x000000000051ba6b cc1_main(char const, char const, char const, void*) + 731 25 clang 0x0000000000522e7a main + 3482 26 libc.so.6 0x00000337489795cd __libc_start_main + 237 27 clang 0x000000000051b6cd Stack dump:
updated testcase sorry for the non-working testcase, i just blindly submitted what clang asked me to without verifying that it'd actually compile ;). the new testcase does properly demonstrate the problem with clang r159515:
clang: /llvm.svn/lib/VMCore/Instructions.cpp:1825: static llvm::BinaryOperator llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value , llvm::Value , const llvm::Twine &, llvm::Instruction ): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed. 0 libLLVM-3.2svn.so 0x000002e78dacd99f 1 libLLVM-3.2svn.so 0x000002e78dacde64 2 libpthread.so.0 0x000002e78d4e81c0 3 libc.so.6 0x000002e78c552ad5 gsignal + 53 4 libc.so.6 0x000002e78c553f4b abort + 379 5 libc.so.6 0x000002e78c54bbbe 6 libc.so.6 0x000002e78c54bc62 7 libLLVM-3.2svn.so 0x000002e78dcdede2 8 libLLVM-3.2svn.so 0x000002e78de170d4 9 libLLVM-3.2svn.so 0x000002e78de46877 10 libLLVM-3.2svn.so 0x000002e78de6a987 11 libLLVM-3.2svn.so 0x000002e78de6b2df 12 libLLVM-3.2svn.so 0x000002e78dcfb4ab llvm::FPPassManager::runOnFunction(llvm::Function&) + 443 13 libLLVM-3.2svn.so 0x000002e78dcfb70b llvm::FPPassManager::runOnModule(llvm::Module&) + 155 14 libLLVM-3.2svn.so 0x000002e78dcfb983 llvm::MPPassManager::runOnModule(llvm::Module&) + 419 15 libLLVM-3.2svn.so 0x000002e78dcfbf08 llvm::PassManagerImpl::run(llvm::Module&) + 408 16 libLLVM-3.2svn.so 0x000002e78dcfc06a llvm::PassManager::run(llvm::Module&) + 10 17 clang 0x000000000067ae50 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module, clang::BackendAction, llvm::raw_ostream) + 5008 18 clang 0x0000000000678cfa 19 clang 0x00000000007a1634 clang::ParseAST(clang::Sema&, bool, bool) + 516 20 clang 0x0000000000677d88 clang::CodeGenAction::ExecuteAction() + 184 21 clang 0x000000000055b015 clang::FrontendAction::Execute() + 101 22 clang 0x000000000053e3ad clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973 23 clang 0x00000000005267d4 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 3316 24 clang 0x000000000051ba6b cc1_main(char const, char const, char const, void*) + 731 25 clang 0x0000000000522e7a main + 3482 26 libc.so.6 0x000002e78c53f5cd __libc_start_main + 237 27 clang 0x000000000051b6cd Stack dump:
I can't seem to reproduce this, either with the original attached tarball nor with the reduced testcase. The preprocessed sources issue lots of errors like this:
include/linux/list.h:24:42: warning: declaration of 'struct list_head' will not be visible outside of this function [-Wvisibility] static inline void INIT_LIST_HEAD(struct list_head *list) ^ include/linux/list.h:26:6: error: incomplete definition of type 'struct list_head' list->next = list;
The reduced testcase simply doesn't error, even if I remember to pass -fwrap -fcatch-undefined-behavior.
Can you please reconfirm that this occurs? I'm testing with an unpatched r159509.
Reduced testcase :
int a; unsigned long b;
void func(void) { unsigned c = 2 << a; b /= c; }
Extended Description
while compiling linux with clang r159506 i get the following assert for a week or two now:
CC fs/ext4/super.o clang: /llvm.svn/lib/VMCore/Instructions.cpp:1825: static llvm::BinaryOperator llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value , llvm::Value , const llvm::Twine &, llvm::Instruction ): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed. 0 libLLVM-3.2svn.so 0x00000389fc39d0ef 1 libLLVM-3.2svn.so 0x00000389fc39d5b4 2 libpthread.so.0 0x00000389fbdb81c0 3 libc.so.6 0x00000389fae22ad5 gsignal + 53 4 libc.so.6 0x00000389fae23f4b abort + 379 5 libc.so.6 0x00000389fae1bbbe 6 libc.so.6 0x00000389fae1bc62 7 libLLVM-3.2svn.so 0x00000389fc5ae532 8 libLLVM-3.2svn.so 0x00000389fc6e6824 9 libLLVM-3.2svn.so 0x00000389fc715fc7 10 libLLVM-3.2svn.so 0x00000389fc73a0d7 11 libLLVM-3.2svn.so 0x00000389fc73aa2f 12 libLLVM-3.2svn.so 0x00000389fc5cabfb llvm::FPPassManager::runOnFunction(llvm::Function&) + 443 13 libLLVM-3.2svn.so 0x00000389fc5cae5b llvm::FPPassManager::runOnModule(llvm::Module&) + 155 14 libLLVM-3.2svn.so 0x00000389fc5cb0d3 llvm::MPPassManager::runOnModule(llvm::Module&) + 419 15 libLLVM-3.2svn.so 0x00000389fc5cb658 llvm::PassManagerImpl::run(llvm::Module&) + 408 16 libLLVM-3.2svn.so 0x00000389fc5cb7ba llvm::PassManager::run(llvm::Module&) + 10 17 clang 0x000000000067adc0 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module, clang::BackendAction, llvm::raw_ostream) + 5008 18 clang 0x0000000000678c6a 19 clang 0x00000000007a15a4 clang::ParseAST(clang::Sema&, bool, bool) + 516 20 clang 0x0000000000677cf8 clang::CodeGenAction::ExecuteAction() + 184 21 clang 0x000000000055afd5 clang::FrontendAction::Execute() + 101 22 clang 0x000000000053e36d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973 23 clang 0x0000000000526794 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 3316 24 clang 0x000000000051ba2b cc1_main(char const, char const, char const, void*) + 731 25 clang 0x0000000000522e3a main + 3482 26 libc.so.6 0x00000389fae0f5cd __libc_start_main + 237 27 clang 0x000000000051b68d Stack dump:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/super-X405Zr.c clang: note: diagnostic msg: /tmp/super-X405Zr.sh clang: note: diagnostic msg: