[llvm-bugs] [Bug 27809] LLVMTargetMachineEmit aborts process instead of reporting error via return value

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 10 23:38:52 PDT 2016


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

Andrew Kelley <superjoe30 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
            Summary|i386: error: ran out of     |LLVMTargetMachineEmit
                   |registers during register   |aborts process instead of
                   |allocation                  |reporting error via return
                   |                            |value

--- Comment #8 from Andrew Kelley <superjoe30 at gmail.com> ---
Backtrace follows. Note that according to the API of LLVMTargetMachineEmit it
is supposed to return and report errors via one of its parameters. Instead LLVM
is writing its own error messages to stderr and then calling exit.


#0  0x00007ffff3c5adb0 in exit ()
   from /nix/store/yxkk1j7h8kyglippv2df0gcx8yknhirb-glibc-2.23/lib/libc.so.6
#1  0x00007ffff5a2bb74 in llvm::LLVMContext::diagnose(llvm::DiagnosticInfo
const&) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#2  0x00007ffff5a2bcdd in llvm::LLVMContext::emitError(unsigned int,
llvm::Twine const&) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#3  0x00007ffff5b8b29b in llvm::MachineInstr::emitError(llvm::StringRef) const
()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#4  0x00007ffff5c12710 in (anonymous
namespace)::RAFast::allocVirtReg(llvm::MachineInstr*, (anonymous
namespace)::RAFast::LiveReg*, unsigned int) [clone .constprop.190] ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#5  0x00007ffff5c13158 in (anonymous
namespace)::RAFast::reloadVirtReg(llvm::MachineInstr*, unsigned int, unsigned
int, unsigned int) [clone .constprop.186] ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#6  0x00007ffff5c13de4 in (anonymous namespace)::RAFast::AllocateBasicBlock()
[clone .constprop.184] ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#7  0x00007ffff5c1607f in (anonymous
namespace)::RAFast::runOnMachineFunction(llvm::MachineFunction&) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#8  0x00007ffff5a410fa in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#9  0x00007ffff5a4146b in llvm::FPPassManager::runOnModule(llvm::Module&) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#10 0x00007ffff5a40ca4 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#11 0x00007ffff6591b37 in LLVMTargetMachineEmit(LLVMOpaqueTargetMachine*,
LLVMOpaqueModule*, llvm::raw_pwrite_stream&, LLVMCodeGenFileType, char**) ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#12 0x00007ffff6591d94 in LLVMTargetMachineEmitToFile ()
   from
/nix/store/np7pjnhj0qp4n87ynik8sbw75gi9gsni-llvm-3.8.0/lib/libLLVM-3.8.so
#13 0x000000000057c5c4 in codegen_link (g=0x1456280, out_file=0x0)
    at /home/andy/dev/zig/src/link.cpp:789
#14 0x00000000005c08fe in main (argc=12, argv=0x7fffffffc0f8) at
/home/andy/dev/zig/src/main.cpp:400

-- 
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/20160611/2b9b153f/attachment.html>


More information about the llvm-bugs mailing list