From: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: master make check fails on Solaris 10
Date: Wed, 17 Jan 2018 18:13:59 +0300
Message-ID: <20180117181359.3a6cc06c@fafnir.local.vm> (raw)
In-Reply-To: <90ab676392c8f9c84431976147097cf0@postgrespro.ru>
References: <0d3a9fa264cebe1cb9966f37b7c06e86@postgrespro.ru>
<20180111173938.jimybeayp2u5mmup@alap3.anarazel.de>
<31a342fa6a025a8bdfc5b8b19c29d56d@postgrespro.ru>
<fc3c1b52d2d4121cccfc13635005bbd0@postgrespro.ru>
<1232.1515780057@sss.pgh.pa.us>
<b946893927ccfd87146d8a7c9f3bbe29@postgrespro.ru>
<15299.1515867055@sss.pgh.pa.us>
<a5559105243efcf6fb619d86c5702115@postgrespro.ru>
<18209.1516059711@sss.pgh.pa.us>
<90ab676392c8f9c84431976147097cf0@postgrespro.ru>
On Wed, 17 Jan 2018 18:02:26 +0300
Marina Polyakova <m.polyakova@postgrespro.ru> wrote:
> > Attached is a possible test program. I can confirm it passes on a
> > machine with working __int128, but I have no idea whether it will
> > detect the problem on yours. If not, maybe you can tweak it?
>
> Thank you! Using gcc 5.5.0 it prints that everything is ok. But,
> investigating the regression diffs, we found out that the error
> occurs when we pass int128 as not the first argument to the function
> (perhaps its value is replaced by the value of some address):
I'm attaching stripped-down version of test program, which demonstrate
the problem and two assembler listings produced with this C source using
alignment 8 and 16. May be this stripped-down version can be used as
base for configure test.
As it turns out, Sparc GCC passes function arguments via register ring
which is referenced as %on in the calling code and as %in in function.
And somehow it happens that alignment attribute of typedef affects
access to arguments in the function, but doesn't affect how regiser
ring is filled before call. Looks like bug in GCC.
Unfortunately, we have only one Sparc machine and started our
investigation by upgrading GCC 5.2.0 to GCC 5.5.0, so it is hard to
downgrade and test with older GCC.
--
Attachments:align_test.c (text/x-c++src, 663B) download
#include <stddef.h>
#include <stdio.h>
# ifndef PG_ALIGN_128
#define PG_ALIGN_128 8
# endif
/* GCC, Sunpro and XLC support aligned */
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
#endif
typedef __int128 int128a
#if defined(pg_attribute_aligned)
pg_attribute_aligned(PG_ALIGN_128)
#endif
;
int128a holder;
void pass_by_val(void *buffer,int128a par) {
holder=par;
}
int
main()
{
long int i64 = 97656225L << 12;
int128a q;
pass_by_val(main,(int128a) i64);
q=(int128a) i64;
printf("pass int 64 %s\n",(q==holder)?"OK":"FAILED");
if (q!=holder)
return 1;
return 0;
}
align_test8.s (application/octet-stream, 4.9K) download
align_test16.s (application/octet-stream, 4.9K) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: vitus@wagner.pp.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: master make check fails on Solaris 10
In-Reply-To: <20180117181359.3a6cc06c@fafnir.local.vm>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox