[llvm-bugs] [Bug 30289] New: crash at -O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes (Assertion `!(DivIsSigned && C2->isAllOnesValue()) && "The overflow computation will fail."' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 5 22:33:16 PDT 2016


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

            Bug ID: 30289
           Summary: crash at -O1 and above on x86_64-linux-gnu in both
                    32-bit and 64-bit modes (Assertion `!(DivIsSigned &&
                    C2->isAllOnesValue()) && "The overflow computation
                    will fail."' failed.)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ clang-trunk -v
clang version 4.0.0 (trunk 280666)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ clang-trunk -O1 small.c
clang-4.0:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp:1975:
llvm::Instruction* llvm::InstCombiner::foldICmpDivConstant(llvm::ICmpInst&,
llvm::BinaryOperator*, const llvm::APInt*): Assertion `!(DivIsSigned &&
C2->isAllOnesValue()) && "The overflow computation will fail."' failed.
#0 0x0000000001c88f95 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c88f95)
#1 0x0000000001c86f3e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c86f3e)
#2 0x0000000001c870a2 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c870a2)
#3 0x00007fd317392330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fd316183c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fd316187028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fd31617cbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fd31617cca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000019ea95c llvm::InstCombiner::foldICmpDivConstant(llvm::ICmpInst&,
llvm::BinaryOperator*, llvm::APInt const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x19ea95c)
#9 0x00000000019f0492 llvm::InstCombiner::foldICmpWithConstant(llvm::ICmpInst&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19f0492)
#10 0x00000000019f4438 llvm::InstCombiner::visitICmpInst(llvm::ICmpInst&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19f4438)
#11 0x00000000019b8f4d llvm::InstCombiner::run()
(/usr/local/clang-trunk/bin/clang-4.0+0x19b8f4d)
#12 0x00000000019b9c69 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::DominatorTree&, bool, llvm::LoopInfo*)
(/usr/local/clang-trunk/bin/clang-4.0+0x19b9c69)
#13 0x00000000019ba04e
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19ba04e)
#14 0x00000000019077a3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19077a3)
#15 0x000000000190784c llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x190784c)
#16 0x0000000001907e6f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1907e6f)
#17 0x0000000001de8411 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/local/clang-trunk/bin/clang-4.0+0x1de8411)
#18 0x00000000023e3648
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x23e3648)
#19 0x000000000275ab12 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x275ab12)
#20 0x00000000023e3a3e clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x23e3a3e)
#21 0x00000000020fafd6 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x20fafd6)
#22 0x00000000020d577e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20d577e)
#23 0x0000000002181c56
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2181c56)
#24 0x0000000000a7b6a8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa7b6a8)
#25 0x0000000000a24798 main (/usr/local/clang-trunk/bin/clang-4.0+0xa24798)
#26 0x00007fd31616ef45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#27 0x0000000000a776ce _start (/usr/local/clang-trunk/bin/clang-4.0+0xa776ce)
Stack dump:
0.    Program arguments: /usr/local/clang-trunk/bin/clang-4.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/4.0.0 -c-isystem . -c-isystem
/usr/local/include/csmith-2.2.0/ -internal-isystem /usr/local/include
-internal-isystem /usr/local/clang-trunk/bin/../lib/clang/4.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir
/home/cnsun/temp/20160905-clang-trunk-m32-g-O3-build-100222/delta -ferror-limit
19 -fmessage-length 132 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/small-60b6bb.o -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Function Pass Manager' on module 'small.c'.
4.    Running pass 'Combine redundant instructions' on function '@main'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 280666)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-4.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-4.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-4.0: note: diagnostic msg: /tmp/small-9fb05c.c
clang-4.0: note: diagnostic msg: /tmp/small-9fb05c.sh
clang-4.0: note: diagnostic msg: 

********************
$ cat small.c
short a;
int main() {
  int b, c = 1;
  if (a) {
    b = ~c;
    b = a / -~b;
  }
  if (b)
   return c;
  return 0;
}
$

-- 
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/20160906/a25bedc0/attachment.html>


More information about the llvm-bugs mailing list