I've just found out the hard way that Postgres doesn't even build on
recent gcc releases for 64-bit HPPA.  The reason is that the compiler
now notices and complains about alignment errors that will lead to
core dump at runtime, and GIST has got some.  The particular code that
fails to compile is in gist.c:
                gistentryinit(((GISTENTRY *) VARDATA(evec))[1],
                    ((GISTENTRY *) VARDATA(evec))[0].key, r, NULL,
                              (OffsetNumber) 0, ((GISTENTRY *) 
VARDATA(evec))[0].bytes, FALSE);

Since VARDATA() is at a 4-byte offset from the start of the datum, this
is trying to overlay a GISTENTRY struct at a 4-byte boundary.  When
compiling in 64-bit mode, Datum is 8 bytes, and so the GISTENTRY struct
is not sufficiently well aligned.  Unlike Intel machines, the HP chips
*require* 8-byte loads and stores to be 8-byte-aligned.

I suppose that a correct fix involves doing MAXALIGN(VARDATA(evec)),
but I do not know what places need to change to support this.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to