[LLVMdev] PrologEpilogInserter question

Vladimir Prus ghost at cs.msu.su
Fri Aug 27 02:48:46 PDT 2004


Hello,
after some time I'm trying to build my code with the current CVS of LLVM, and 
have a problem. The mentioned file, around line 184, contains:

    if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
      // Nope, just spill it anywhere convenient.
      FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg)/8,
                                        RegInfo->getSpillAlignment(Reg)/8);
    } else {
      // Spill it to the stack where we must.
      FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg)/8,
                                        FixedSlot->second);
    }

What's the division by 8 for? Neither 'CreateStackObject' nor 
'getSpillAlignment' documentation say what units the size is, but everywhere 
it's in bytes. In my specific case, 'getSplillAlignment' returns 4, which 
becomes 0 after division.

Later on, PEI::calculateFrameObjectOffsets gets this zero alignment and 
crashes with division by zero. I don't this zero alignment is reasonable at 
all.

And ideas?

Thanks,
Volodya




More information about the llvm-dev mailing list