postgresql/config
Tom Lane 7518049980 Prevent int128 from requiring more than MAXALIGN alignment.
Our initial work with int128 neglected alignment considerations, an
oversight that came back to bite us in bug #14897 from Vincent Lachenal.
It is unsurprising that int128 might have a 16-byte alignment requirement;
what's slightly more surprising is that even notoriously lax Intel chips
sometimes enforce that.

Raising MAXALIGN seems out of the question: the costs in wasted disk and
memory space would be significant, and there would also be an on-disk
compatibility break.  Nor does it seem very practical to try to allow some
data structures to have more-than-MAXALIGN alignment requirement, as we'd
have to push knowledge of that throughout various code that copies data
structures around.

The only way out of the box is to make type int128 conform to the system's
alignment assumptions.  Fortunately, gcc supports that via its
__attribute__(aligned()) pragma; and since we don't currently support
int128 on non-gcc-workalike compilers, we shouldn't be losing any platform
support this way.

Although we could have just done pg_attribute_aligned(MAXIMUM_ALIGNOF) and
called it a day, I did a little bit of extra work to make the code more
portable than that: it will also support int128 on compilers without
__attribute__(aligned()), if the native alignment of their 128-bit-int
type is no more than that of int64.

Add a regression test case that exercises the one known instance of the
problem, in parallel aggregation over a bigint column.

This will need to be back-patched, along with the preparatory commit
91aec93e6.  But let's see what the buildfarm makes of it first.

Discussion: https://postgr.es/m/20171110185747.31519.28038@wrigleys.postgresql.org
2017-11-14 15:03:55 -05:00
..
Makefile Install our "missing" script where PGXS builds can find it. 2015-12-11 16:15:05 -05:00
ac_func_accept_argtypes.m4 Remove some configure header-file checks that we weren't really using. 2017-02-25 18:10:09 -05:00
ax_prog_perl_modules.m4 Make configure check for IPC::Run when --enable-tap-tests is specified. 2017-06-15 15:56:12 -04:00
ax_pthread.m4 Update ax_pthread.m4 to an experimental draft version from upstream. 2015-07-30 14:14:50 +03:00
c-compiler.m4 Prevent int128 from requiring more than MAXALIGN alignment. 2017-11-14 15:03:55 -05:00
c-library.m4 Remove some configure header-file checks that we weren't really using. 2017-02-25 18:10:09 -05:00
config.guess Update config.guess and config.sub 2017-05-14 11:09:34 -04:00
config.sub Update config.guess and config.sub 2017-05-14 11:09:34 -04:00
docbook.m4 Further improve consistency of configure's program searching. 2017-08-01 11:40:08 -04:00
general.m4 Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
install-sh Fix install-strip on Mac OS X 2012-08-21 23:42:43 -04:00
libtool.m4 Rename AC_PROG_LD* macros to PGAC_PROG_LD*. This avoids clashes with the 2004-07-17 18:53:56 +00:00
missing Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
perl.m4 Absorb -D_USE_32BIT_TIME_T switch from Perl, if relevant. 2017-08-14 11:48:59 -04:00
pkg.m4 ICU support 2017-03-23 15:28:48 -04:00
prep_buildtree find -path is not portable, so use grep -v instead. 2010-10-25 10:04:00 -03:00
programs.m4 Further improve consistency of configure's program searching. 2017-08-01 11:40:08 -04:00
python.m4 Further improve consistency of configure's program searching. 2017-08-01 11:40:08 -04:00
tcl.m4 Further improve consistency of configure's program searching. 2017-08-01 11:40:08 -04:00