[llvm-bugs] [Bug 35636] New: DefIdx 1 exceeds machine model writes for %rdi, dead %rax = MULX64rr killed %rax, implicit %rdx

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 11 20:11:03 PST 2017


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

            Bug ID: 35636
           Summary: DefIdx 1 exceeds machine model writes for %rdi, dead
                    %rax = MULX64rr killed %rax, implicit %rdx
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: octoploid at yandex.com
                CC: llvm-bugs at lists.llvm.org

% cat bin2ascii_t.c
#include <stdint.h>

char *uint64_to_ascii(uint64_t n, char *buf)
{
  uint64_t top6 = n / 100000000000000LL;
  uint64_t top13 = n / 10000000LL;
  uint64_t middle7 = top13 - top6 * 10000000LL;
  uint64_t bottom7 = n - top13 * 10000000LL;

#define SCALE_4_28(n) ((n*(65536LL*65536*65536/1000000+1)>>20)+1)

  uint32_t nb = (uint32_t) SCALE_4_28(bottom7);
  uint32_t nm = (uint32_t) SCALE_4_28(middle7);
  uint32_t nt = (uint32_t) SCALE_4_28(top6);

  uint32_t mask = (1 << 28) - 1;
  //buf[ 0] = (char)(nt >> (28)) + '0'; // Always zero, so skip!
  buf[ 6] = (char)(nm >> (28)) + '0';
  buf[13] = (char)(nb >> (28)) + '0';
  for (unsigned i = 0; i < 6; i++) {
    nt &= mask; nm &= mask; nb &= mask;
    nt *= 5; nm *= 5; nb *= 5;
    mask >>= 1;
    buf[i + 0] = (char)(nt >> (27 - i)) + '0';
    buf[i + 7] = (char)(nm >> (27 - i)) + '0';
    buf[i + 14] = (char)(nb >> (27 - i)) + '0';
  }
  buf[20] = '\0';
  return buf;
}

 % clang -march=znver1 -O2 -c bin2ascii_t.c

DefIdx 1 exceeds machine model writes for %rdi, dead %rax = MULX64rr killed
%rax, implicit %rdx
 (Try with MCSchedModel.CompleteModel set to false)incomplete machine model
UNREACHABLE executed at
/home/markus/llvm/llvm/lib/CodeGen/TargetSchedule.cpp:249!
#0 0x00007f0d336756ba llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/../lib/libLLVMSupport.so.6+0x1076ba)
#1 0x00007f0d33673526 llvm::sys::RunSignalHandlers()
(/usr/local/bin/../lib/libLLVMSupport.so.6+0x105526)
#2 0x00007f0d3367373e SignalHandler(int)
(/usr/local/bin/../lib/libLLVMSupport.so.6+0x10573e)
#3 0x00007f0d32febab0 __restore_rt (/lib/libpthread.so.0+0x12ab0)
#4 0x00007f0d31c175aa __GI_raise
/home/markus/glibc/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f0d31bff5bb __GI_abort /home/markus/glibc/stdlib/abort.c:81:7
#6 0x00007f0d33600cda (/usr/local/bin/../lib/libLLVMSupport.so.6+0x92cda)
#7 0x00007f0d347d6e8c
llvm::TargetSchedModel::computeOperandLatency(llvm::MachineInstr const*,
unsigned int, llvm::MachineInstr const*, unsigned int) const
(/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x407e8c)
#8 0x00007f0d3475eb1b llvm::ScheduleDAGInstrs::addPhysRegDataDeps(llvm::SUnit*,
unsigned int) (/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x38fb1b)
#9 0x00007f0d3475fa6c llvm::ScheduleDAGInstrs::addPhysRegDeps(llvm::SUnit*,
unsigned int) (/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x390a6c)
#10 0x00007f0d34766a5b
llvm::ScheduleDAGInstrs::buildSchedGraph(llvm::AAResults*,
llvm::RegPressureTracker*, llvm::PressureDiffs*, llvm::LiveIntervals*, bool)
(/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x397a5b)
#11 0x00007f0d346d1f6b (anonymous namespace)::SchedulePostRATDList::schedule()
(/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x302f6b)
#12 0x00007f0d34485a73 (anonymous
namespace)::PostRAScheduler::runOnMachineFunction(llvm::MachineFunction&)
[clone .part.186] [clone .cold.198]
(/usr/local/bin/../lib/libLLVMCodeGen.so.6+0xb6a73)
#13 0x00007f0d345fd673
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/bin/../lib/libLLVMCodeGen.so.6+0x22e673)
#14 0x00007f0d341b2a30 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/bin/../lib/libLLVMCore.so.6+0x18ca30)
#15 0x00007f0d341b2a99 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/bin/../lib/libLLVMCore.so.6+0x18ca99)
#16 0x00007f0d340b5969 llvm::legacy::PassManagerImpl::run(llvm::Module&) [clone
.cold.534] (/usr/local/bin/../lib/libLLVMCore.so.6+0x8f969)
#17 0x00007f0d32801e04 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, 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/bin/../lib/libclangCodeGen.so.6+0x9ae04)
#18 0x00007f0d329f9c28
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/../lib/libclangCodeGen.so.6+0x292c28)
#19 0x00007f0d3072f122 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/../lib/../lib/libclangParse.so.6+0x30122)
#20 0x00007f0d329f8b80 clang::CodeGenAction::ExecuteAction()
(/usr/local/bin/../lib/libclangCodeGen.so.6+0x291b80)
#21 0x00007f0d32513aae clang::FrontendAction::Execute()
(/usr/local/bin/../lib/libclangFrontend.so.6+0xd8aae)
#22 0x00007f0d324d69fe
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/../lib/libclangFrontend.so.6+0x9b9fe)
#23 0x00007f0d32437859
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/../lib/libclangFrontendTool.so.6+0x3859)
#24 0x000000000040f5e8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-6.0+0x40f5e8)
#25 0x000000000040bff5 main (/usr/local/bin/clang-6.0+0x40bff5)
#26 0x00007f0d31c016ee __libc_start_main
/home/markus/glibc/csu/../csu/libc-start.c:342:3
#27 0x000000000040d50a _start
/home/markus/glibc/csu/../sysdeps/x86_64/start.S:122:0
Stack dump:
0.      Program arguments: /usr/local/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name bin2ascii_t.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu znver1
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file /tmp/bin2ascii/bin2ascii_t.gcno -resource-dir
/usr/local/lib/clang/6.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/local/lib/clang/6.0.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir
/tmp/bin2ascii -ferror-limit 19 -fmessage-length 179 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o bin2ascii_t.o -x c bin2ascii_t.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'bin2ascii_t.c'.
4.      Running pass 'Post RA top-down list latency scheduler' on function
'@uint64_to_ascii'
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.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-6.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-6.0: note: diagnostic msg: /tmp/bin2ascii_t-06efbb.c
clang-6.0: note: diagnostic msg: /tmp/bin2ascii_t-06efbb.sh
clang-6.0: note: diagnostic msg: 

********************

-- 
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/20171212/78f45f80/attachment-0001.html>


More information about the llvm-bugs mailing list