Advertisement
tyler569

zig crash 1

Apr 20th, 2019
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. xps::learn_zig => cat asm.zig
  2.  
  3. const std = @import("std");
  4.  
  5. pub fn main() void {
  6. const foo: i64 = undefined;
  7.  
  8. asm volatile (
  9. \\ mov $12, %[foo]
  10. :
  11. : [foo] "=m" (foo)
  12. );
  13.  
  14. std.debug.warn("{}\n", foo);
  15. }
  16.  
  17.  
  18. (gdb) bt
  19. #0 0x00007ffff54c342c in llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) ()
  20. #1 0x00007ffff54d4b51 in llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) ()
  21. #2 0x00007ffff54dc1f9 in llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) ()
  22. #3 0x00007ffff551ede2 in llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, bool&) ()
  23. #4 0x00007ffff5525703 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ()
  24. #5 0x00007ffff5526a0e in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
  25. #6 0x00007ffff45cf3c0 in (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
  26. #7 0x00007ffff5822ee5 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) [clone .part.43] ()
  27. #8 0x00007ffff6411029 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
  28. #9 0x00007ffff6411081 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
  29. #10 0x00007ffff64103a2 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
  30. #11 0x00007ffff26cd787 in ZigLLVMTargetMachineEmitToFile ()
  31. #12 0x00007ffff25ff98c in codegen_build_and_link(CodeGen*) ()
  32. #13 0x00007ffff251c415 in main ()
  33.  
  34.  
  35. xps::learn_zig => lli asm.ll
  36. lli: asm.ll:30372:13: error: invalid type for inline asm constraint string
  37. call void asm sideeffect " mov $$12, $0", "=m"(i64 undef), !dbg !13268
  38. ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement