[LLVMbugs] [Bug 19226] New: Assertion `NumPendingSTs > SrcST && "Cannot copy from dead ST register"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 21 22:07:42 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19226

            Bug ID: 19226
           Summary: Assertion `NumPendingSTs > SrcST && "Cannot copy from
                    dead ST register"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: solo-llvm at goeswhere.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The "aranym" Debian package causes Clang to segfault:
http://clang.debian.net/logs/2014-01-14/aranym_0.9.15-1_unstable_clang.log

Minimised testcase:
# 1 "<built-in>" 1
# 1 "clangcrash.cpp" 1
int toint(int a, long double x) {
  if (a) {
    return (int)x;
  }
  volatile unsigned int cw;
  long double value;
  __asm__ __volatile__("frndint" : "=t"(value) : "0"(x));
  __asm__ __volatile__("fldcw %0" : : "m"(cw));
  return (int)value;
}

I'm pretty sure that's minimised, e.g. the if (a) { .. is definitely needed.

The original code names the series of asm instructions "fp_round_to_zero" and
has initialised cw appropriately, but still segfaults.

http://sourceforge.net/p/aranym/code/ci/master/tree/src/uae_cpu/fpu/mathlib.h


$ clang++ clangcrash.cpp -O1
clang: /home/faux/code/llvm/lib/Target/X86/X86FloatingPoint.cpp:1364: void
<anonymous namespace>::FPS::handleSpecialFP(MachineBasicBlock::iterator &):
Assertion `NumPendingSTs > SrcST && "Cannot copy from dead ST register"'
failed.
0  clang           0x000000000397414e llvm::sys::PrintStackTrace(_IO_FILE*) +
46
1  clang           0x000000000397442b
2  clang           0x00000000039757ee
3  libpthread.so.0 0x00007fcde6be6030
4  libc.so.6       0x00007fcde5882475 gsignal + 53
5  libc.so.6       0x00007fcde58856f0 abort + 384
6  libc.so.6       0x00007fcde587b621 __assert_fail + 241
7  clang           0x0000000002c94ec8
8  clang           0x0000000002c91c1d
9  clang           0x0000000002c9134b
10 clang           0x0000000003134bae
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 110
11 clang           0x00000000038d83bb
llvm::FPPassManager::runOnFunction(llvm::Function&) + 427
12 clang           0x00000000038d86c8
llvm::FPPassManager::runOnModule(llvm::Module&) + 104
13 clang           0x00000000038d8d8a
14 clang           0x00000000038d897e
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 302
15 clang           0x00000000038d9351
llvm::legacy::PassManager::run(llvm::Module&) + 33
16 clang           0x0000000000c720ac
17 clang           0x0000000000c719d2
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 114
18 clang           0x0000000000c6e690
19 clang           0x0000000000ef1c7c clang::ParseAST(clang::Sema&, bool, bool)
+ 796
20 clang           0x000000000096f379 clang::ASTFrontendAction::ExecuteAction()
+ 345
21 clang           0x0000000000c6da42 clang::CodeGenAction::ExecuteAction() +
1474
22 clang           0x000000000096eb3f clang::FrontendAction::Execute() + 191
23 clang           0x0000000000936dfd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
24 clang           0x00000000008f5fa4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1044
25 clang           0x00000000008e2bda cc1_main(char const**, char const**, char
const*, void*) + 698
26 clang           0x00000000008f0254 main + 772
27 libc.so.6       0x00007fcde586eead __libc_start_main + 253
28 clang           0x00000000008e2089
Stack dump:
0.      Program arguments: /home/faux/code/build/Debug+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
clangcrash.cpp -mrelocation-model static -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.22 -momit-leaf-frame-pointer -resource-dir
/home/faux/code/build/Debug+Asserts/bin/../lib/clang/3.5.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7
-internal-isystem /usr/local/include -internal-isystem
/home/faux/code/build/Debug+Asserts/bin/../lib/clang/3.5.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdeprecated-macro -fdebug-compilation-dir /home/faux -ferror-limit 19
-fmessage-length 254 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/clangcrash-20245c.o -x c++ clangcrash.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'clangcrash.cpp'.
4.      Running pass 'X86 FP Stackifier' on function '@_Z5tointie'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (trunk 204538)
Target: x86_64-unknown-linux-gnu
Thread model: posix


 "/home/faux/code/build/Debug+Asserts/bin/clang" -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name clangcrash.cpp
-mrelocation-model static -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.22
-momit-leaf-frame-pointer -O1 -fdeprecated-macro -ferror-limit 19
-fmessage-length 254 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -x
c++ clangcrash-526bcb.cpp

-- 
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/20140322/92a84cfe/attachment.html>


More information about the llvm-bugs mailing list