[llvm-commits] [PATCH]: wrong PPC32 targetdata in llvm

Roman Divacky rdivacky at freebsd.org
Thu Jun 30 08:32:20 PDT 2011


Hi,

The definition of targetdata in llvm differs to the one in clang.
Specifically the ABI alignment of 64bit types on PPC32 is 32 in
llvm and 64 in llvm. The clang one seems to be the correct one.
As it is, the following test fails:

typedef struct
{
    char        v_type;     /* see below: VAR_NUMBER, VAR_STRING, etc. */
    union
    {   
        double          v_float;        /* floating number value */
    }           vval;
} typval_T;

typval_T vimvars[16];

int main(void) {
        printf("Difference: %ld (should be: %zd)\n", (long)&vimvars[1] - (long)&vimvars[0], sizeof(vimvars[0]));
        return 0;
}

where it prints:

Difference: 12 (should be: 16)

OK to commit the attached patch that increases the ABI alignment to 64? With
this patch I am able to build a working vim (the editor) on ppc32 at both -O0
and -O2. Without it, it fails because the test above fails.

roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc-targetdata.patch
Type: text/x-diff
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110630/82b03afe/attachment.patch>


More information about the llvm-commits mailing list