[Sparc] Undefined temporary symbol


I’m trying to work out what to do to eliminate an “Undefined temporary symbol”, which has appeared after I had thought I’d cleared up the last problems trying to implement __builtin_setjmp.

I know that the symbol it’s referring to is “sinkMBB” in the two BuildMI instructions in the code fragment below, as the problem goes away if I remove these lines temporarily (although the algorithm doesn’t work then).

What must I do to eliminate the Undefined Temporary Symbol error, later in the compilation process (raised at ElfObjectWriter.cpp:803)?

Chris Dewhurst, Lero, University of Limerick

  • const BasicBlock *BB = MBB->getBasicBlock();
  • MachineFunction::iterator It = ++MBB->getIterator();
  • MachineBasicBlock *thisMBB = MBB;
  • const BasicBlock* mainBB = BasicBlock::Create(BB->getContext(), “setjmp.main”);
  • MachineBasicBlock *mainMBB = MF->CreateMachineBasicBlock(mainBB);
  • mainMBB->setHasAddressTaken();
  • const BasicBlock* sinkBB = BasicBlock::Create(BB->getContext(), “setjmp.sink”);
  • MachineBasicBlock *sinkMBB = MF->CreateMachineBasicBlock(sinkBB);
  • sinkMBB->setHasAddressTaken();

Sounds like you haven’t updated the machine CFG to keep the basic block containing the label alive. See how addSuccessor is used in the X86 lowering.