[llvm-bugs] [Bug 30281] New: crash on -O1 and above in both 32-bit and 64-bit modes on x86_74-linux-gnu (Assertion `*C2 != 1 && "Funny cases with INT_MIN will fail."' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 5 07:26:10 PDT 2016


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

            Bug ID: 30281
           Summary: crash on -O1 and above in both 32-bit and 64-bit modes
                    on x86_74-linux-gnu (Assertion `*C2 != 1 && "Funny
                    cases with INT_MIN 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 280627)
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 -O3 small.c
clang-4.0:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp:1981:
llvm::Instruction* llvm::InstCombiner::foldICmpDivConstant(llvm::ICmpInst&,
llvm::BinaryOperator*, const llvm::APInt*): Assertion `*C2 != 1 && "Funny cases
with INT_MIN will fail."' failed.
#0 0x0000000001c865c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c865c5)
#1 0x0000000001c8456e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c8456e)
#2 0x0000000001c846d2 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c846d2)
#3 0x00007fd798e7e330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fd797c6fc37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fd797c73028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fd797c68bf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fd797c68ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000019e841d llvm::InstCombiner::foldICmpDivConstant(llvm::ICmpInst&,
llvm::BinaryOperator*, llvm::APInt const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x19e841d)
#9 0x00000000019edae2 llvm::InstCombiner::foldICmpWithConstant(llvm::ICmpInst&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19edae2)
#10 0x00000000019f1a9a llvm::InstCombiner::visitICmpInst(llvm::ICmpInst&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19f1a9a)
#11 0x00000000019b657d llvm::InstCombiner::run()
(/usr/local/clang-trunk/bin/clang-4.0+0x19b657d)
#12 0x00000000019b7299 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::DominatorTree&, bool, llvm::LoopInfo*)
(/usr/local/clang-trunk/bin/clang-4.0+0x19b7299)
#13 0x00000000019b767e
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x19b767e)
#14 0x0000000001904dd3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1904dd3)
#15 0x0000000001904e7c llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1904e7c)
#16 0x000000000190549f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x190549f)
#17 0x0000000001de5a01 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+0x1de5a01)
#18 0x00000000023e05e8
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x23e05e8)
#19 0x0000000002757ab2 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x2757ab2)
#20 0x00000000023e09de clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x23e09de)
#21 0x00000000020f85c6 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x20f85c6)
#22 0x00000000020d2d6e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20d2d6e)
#23 0x000000000217f246
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x217f246)
#24 0x0000000000a79fe8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa79fe8)
#25 0x0000000000a230c8 main (/usr/local/clang-trunk/bin/clang-4.0+0xa230c8)
#26 0x00007fd797c5af45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#27 0x0000000000a7600e _start (/usr/local/clang-trunk/bin/clang-4.0+0xa7600e)
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 -O3
-fdebug-compilation-dir
/home/cnsun/ramdisk/hermes/run-5/res/20160904-clang-trunk-m32-g-O3-build-230212/delta
-ferror-limit 19 -fmessage-length 128 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-3bd6d9.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 280627)
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-7eaa02.c
clang-4.0: note: diagnostic msg: /tmp/small-7eaa02.sh
clang-4.0: note: diagnostic msg: 

********************
$ cat small.c
short a, c;
static char b = 2;
int d;
int main() {
  char e;
  d = ~e + (a && c / (5 && b));
  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/20160905/04fdb464/attachment-0001.html>


More information about the llvm-bugs mailing list