[llvm-bugs] [Bug 28846] New: crash at -O1 and above on x86_64-linux-gnu i both 32-bit and64-bit modes (Assertion `!Result.isConstant()' failed)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 4 10:08:29 PDT 2016


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

            Bug ID: 28846
           Summary: crash at -O1 and above on x86_64-linux-gnu i both
                    32-bit and64-bit modes (Assertion
                    `!Result.isConstant()' failed)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            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 277605)
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/Analysis/LazyValueInfo.cpp:1519:
llvm::ConstantRange llvm::LazyValueInfo::getConstantRange(llvm::Value*,
llvm::BasicBlock*, llvm::Instruction*): Assertion `!Result.isConstant()'
failed.
#0 0x0000000001c11c45 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c11c45)
#1 0x0000000001c0fbae llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c0fbae)
#2 0x0000000001c0fd12 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c0fd12)
#3 0x00007fcba4e73330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fcba3c64c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fcba3c68028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fcba3c5dbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fcba3c5dca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x000000000148729c llvm::LazyValueInfo::getConstantRange(llvm::Value*,
llvm::BasicBlock*, llvm::Instruction*)
(/usr/local/clang-trunk/bin/clang-4.0+0x148729c)
#9 0x0000000001a888d1 runImpl(llvm::Function&, llvm::LazyValueInfo*)
(/usr/local/clang-trunk/bin/clang-4.0+0x1a888d1)
#10 0x0000000001898b13 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1898b13)
#11 0x0000000002453eb0 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2453eb0)
#12 0x00000000018991af llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x18991af)
#13 0x0000000001d69e20 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+0x1d69e20)
#14 0x0000000002353c88
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2353c88)
#15 0x00000000026a381b clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x26a381b)
#16 0x000000000235407e clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x235407e)
#17 0x000000000207b936 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x207b936)
#18 0x00000000020569fe
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20569fe)
#19 0x000000000210153c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x210153c)
#20 0x0000000000a4ae08 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa4ae08)
#21 0x00000000009f655f main (/usr/local/clang-trunk/bin/clang-4.0+0x9f655f)
#22 0x00007fcba3c4ff45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#23 0x0000000000a46cbd _start (/usr/local/clang-trunk/bin/clang-4.0+0xa46cbd)
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/ -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-1/res/20160804-clang-trunk-m64-g-O3-build-024639/delta
-ferror-limit 19 -fmessage-length 238 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-de738b.o -x c small.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.      Running pass 'Value Propagation' on function '@fn1'
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 277605)
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-1a9bd7.c
clang-4.0: note: diagnostic msg: /tmp/small-1a9bd7.sh
clang-4.0: note: diagnostic msg:

********************
$
$ cat small.c
int a;
short b;
short c[2];
char d;
static int fn1 (int p1) {
  return p1 || a < p1 ? a : a + p1;
}

int main () {
  d = fn1 (&b != &c[1]);
  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/20160804/b7b1aaca/attachment.html>


More information about the llvm-bugs mailing list