[LLVMdev] Turning on exception handling codegen

Duncan Sands baldrick at free.fr
Mon Aug 27 01:51:57 PDT 2007


Hi Bill,

> > PS: 32 bit or 64 bit?
> >
> It's 64-bit, which Anton says doesn't work. But I'm not sure if this
> is a 64-bit specific bug.

there are a couple of 32 bit assumptions in EmitExceptionTable.
A quick scan gives:

(a)
      SizeSites += M*(sizeof(int32_t) +               // Site start.
                      sizeof(int32_t) +               // Site length.
                      sizeof(int32_t) +               // Landing pad.

This might be correct for 64 bit targets - not sure.

(b)
    unsigned SizeAlign = (4 - TotalSize) & 3;
This is used to align the typeinfos.  Since these have size
TAI->getAddressSize(), presumably 4 -> 8 and 3 -> 7 on 64 bit
targets.

(c)
    O << "GCC_except_table" << SubprogramCount << ":\n";
    Asm->EmitAlignment(2);
This is also part of the logic to align the typeinfos.  I don't
know what "2" means here, but this needs to result in an alignment
that is OK for a typeinfo (which has size TAI->getAddressSize()).

(d)
    Asm->EmitAlignment(2);
This is the last line of the function.  I don't know what it is for.

If you send me the assembler produced by gcc for your machine, it
should be easy to work out what the right values are here.

Ciao,

Duncan.



More information about the llvm-dev mailing list