[llvm-bugs] [Bug 29132] New: crash at -Os and above on x86_64-linux-gnu only in 64-bit mode (Instruction is reading nonexistent value)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 24 19:48:40 PDT 2016


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

            Bug ID: 29132
           Summary: crash at -Os and above on x86_64-linux-gnu only in
                    64-bit mode (Instruction is reading nonexistent value)
           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 279635)
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 -Os small.c
clang-4.0:
/tmp/llvm-builder/llvm-source-trunk/lib/CodeGen/RegisterCoalescer.cpp:2051:
{anonymous}::JoinVals::ConflictResolution
{anonymous}::JoinVals::analyzeValue(unsigned int, {anonymous}::JoinVals&):
Assertion `(TrackSubRegLiveness || V.RedefVNI) && "Instruction is reading
nonexistent value"' failed.
#0 0x0000000001c7ea05 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c7ea05)
#1 0x0000000001c7c9ae llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c7c9ae)
#2 0x0000000001c7cb12 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c7cb12)
#3 0x00007f14a0825330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f149f616c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f149f61a028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f149f60fbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f149f60fca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000017080b3 (anonymous
namespace)::JoinVals::computeAssignment(unsigned int, (anonymous
namespace)::JoinVals&) (/usr/local/clang-trunk/bin/clang-4.0+0x17080b3)
#9 0x00000000017081da (anonymous namespace)::JoinVals::mapValues((anonymous
namespace)::JoinVals&) (/usr/local/clang-trunk/bin/clang-4.0+0x17081da)
#10 0x000000000170ed25 (anonymous
namespace)::RegisterCoalescer::joinCopy(llvm::MachineInstr*, bool&)
(/usr/local/clang-trunk/bin/clang-4.0+0x170ed25)
#11 0x0000000001710e52 (anonymous
namespace)::RegisterCoalescer::copyCoalesceWorkList(llvm::MutableArrayRef<llvm::MachineInstr*>)
(/usr/local/clang-trunk/bin/clang-4.0+0x1710e52)
#12 0x0000000001710ebb (anonymous
namespace)::RegisterCoalescer::coalesceLocals()
(/usr/local/clang-trunk/bin/clang-4.0+0x1710ebb)
#13 0x000000000171207f (anonymous
namespace)::RegisterCoalescer::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x171207f)
#14 0x0000000001661ca3
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1661ca3)
#15 0x00000000018ff533 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x18ff533)
#16 0x00000000018ff5dc llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x18ff5dc)
#17 0x00000000018ffbff llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x18ffbff)
#18 0x0000000001ddbb38 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+0x1ddbb38)
#19 0x00000000023d8a38
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x23d8a38)
#20 0x00000000027512a3 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x27512a3)
#21 0x00000000023d8e2e clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x23d8e2e)
#22 0x00000000020f2436 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x20f2436)
#23 0x00000000020ccf1e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20ccf1e)
#24 0x00000000021781a6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x21781a6)
#25 0x0000000000a72408 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa72408)
#26 0x0000000000a1bb3f main (/usr/local/clang-trunk/bin/clang-4.0+0xa1bb3f)
#27 0x00007f149f601f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#28 0x0000000000a6e3fe _start (/usr/local/clang-trunk/bin/clang-4.0+0xa6e3fe)
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 -Os
-fdebug-compilation-dir
/home/cnsun/ramdisk/hermes/run-1/res/20160824-clang-trunk-m64-g-O3-build-113546/delta
-ferror-limit 19 -fmessage-length 128 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-534f00.o -x c small.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'small.c'.
4.    Running pass 'Simple Register Coalescing' 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 279635)
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-b99a6d.c
clang-4.0: note: diagnostic msg: /tmp/small-b99a6d.sh
clang-4.0: note: diagnostic msg: 

********************
$ 
$ cat small.c
short a;
volatile int b, c;
char d;
int main() {
  short *e = &a;
  c || (*e)++;
  --*e;
  d = -d | (a && 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/20160825/da576c37/attachment-0001.html>


More information about the llvm-bugs mailing list