[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] ia64 long double alignment test

From: Brett Cundal
Subject: [Help-smalltalk] ia64 long double alignment test
Date: Thu, 3 Jun 2004 09:00:29 -0700
User-agent: Mutt/


I've received some assistance in trying to track down the cause for
the build failures on most 64-bit archs, and I think I may have
tracked it down at least for ia64.

There's a test in aclocal.m4 (included from config/align.m4) which
attempts to determine the alignment of double and long double
types. This test gives the following result on ia64:

checking for double... yes
checking size of double... 8
checking for double alignment... 8
checking for long double... yes
checking size of long double... 16
checking for long double alignment... 8

However, according to this:,1701,180,00.html

The correct alignment for long double on Itanium is 16 bytes.

So the test appears to be bad. I found the following test:

struct foo {
    union align {
        double d;
        long l;
        void *p;
    } u;
    char c;

int main() {
    struct foo f[2];

    printf("sizeof(foo)=%ld\n", (long) sizeof(struct foo));
    printf("sizeof(align)=%ld\n", (long) sizeof(union align));
    printf("sizeof(f2)=%ld\n", (long) sizeof(f));

    if( 2*sizeof(union align) != sizeof(f) ) {
        printf("union may be aligned on %ld byte boundaries.\n",
            (long)(sizeof(struct foo) - sizeof(union align)));
        return 1;

    printf("union must be aligned on %ld byte boundaries.\n",
        (long)sizeof(union align));
    return 0;

Does this test work? I don't have access to any 64-bit archs to test

How would I turn this into a replacement test in config/align.m4?

Thanks for any assistance.

-- Brett

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]