From: | Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> |
---|---|
To: | "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | AW: AW: Could turn on -O2 in AIX |
Date: | 2000-11-10 21:07:20 |
Message-ID: | 11C1E6749A55D411A9670001FA687963368109@sdexcsrv1.f000.d0188.sd.spardat.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> There is a special case in nabstime.h for AIX, which imho
> got swapped. The normal case for me would be INT_MIN
> and not the 0x80000001.
> There is a comment that I don't understand at all given the below
> source code:
>
> /*
> * AIX considers 2147483648 == -2147483648 (since they have
> the same bit
> * representation) but uses a different sign sense in a comparison to
> * these integer constants depending on whether the constant is signed
> * or not!
> */
> #if defined (_AIX)
> #define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN)
> #else
> #define NOSTART_ABSTIME ((AbsoluteTime) 0x80000001)
> /* -2147483647 (- 2^31) */
> #endif
>
> But that is unfortunately not the problem. Looks like yet
> another broken compiler to me :-(
Ok, the comparison ((int) time) > ((int) 0x80000001) is the problem.
Reading the comment again and again, I have come to the conclusion,
that the intent was originally to avoid INT_MIN on AIX.
My solution would be to use INT_MIN for all ports, which has the advantage
that the above problematic comparison can be converted to !=,
since no integer will be smaller than INT_MIN.
Please apply the patch and all works well.
Thanks
Andreas
Attachment | Content-Type | Size |
---|---|---|
aix_O2.patch | application/octet-stream | 3.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Martin A. Marques | 2000-11-10 21:08:12 | Postgres article |
Previous Message | Tom Lane | 2000-11-10 20:26:55 | Re: Coping with 'C' vs 'newC' function language names |