Re: Regression fails on Alpha True64 V5.0 for

From: "Tegge, Bernd" <tegge(at)repas-aeg(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Regression fails on Alpha True64 V5.0 for
Date: 2001-11-19 18:56:46
Message-ID: 5.1.0.14.0.20011119183933.029620a0@dragon.dr.repas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Am 11:38 19.11.01 -0500 schrieb Tom Lane:
> > Hmm. The "memcpy" at that line is intended specifically to get around
> > any possible misaligned-pointer problem. I have a nasty feeling that
> > Compaq's compiler is misoptimizing the memcpy into a
> > load-and-store-double kind of instruction sequence.

I wouldn't be surprised. Memcpy et al. are being inlined at even O-level 1.
The optimizer might notice a data size of 8 and reduce the code to a single
load/store operation. However, this is usually only a performance problem.
You get an alignment exception and the exception handler corrects the
fetches/writes the missing part ( besides writing the address to stdout).

BTW. : The Linux version of the Compaq Compiler is available for download
from http://www.unix.digital.com/linux/compaq_c/index.html. You can even
sign up for a test account on an True64 or Linux/Alpha system.

>If it is doing that, perhaps it could be convinced not to with
>explicit casts, say
>
>memcpy((void *) &sumX, (void *) DatumGetIntervalP(transdatums[0]),
>sizeof(Interval));
>memcpy((void *) &N, (void *) DatumGetIntervalP(transdatums[1]),
>sizeof(Interval));

Nope, this does not fix it. Compiling timestamp.c with the additional
options "-noinline -nointrinsic" does, but I would still hesitate to
use this on the whole project.

>(note similar code in interval_avg would also need to be fixed). If
>that works it'd be nicer than making a global reduction in optimization
>level...

I've got a rather ugly but usable workaround. See attached timestamp.c
If you can think of anything better, I'm open to suggestions.

Attachment Content-Type Size
unknown_filename text/plain 66.9 KB

In response to

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Tom Lane 2001-11-19 19:27:36 Re: Regression fails on Alpha True64 V5.0 for yesterdays cvs
Previous Message Tom Lane 2001-11-19 16:31:42 Re: Regression fails on Alpha True64 V5.0 for yesterdays cvs