Skip to content

Commit 86ef376

Browse files
committed
Blind try to fix portability issue in commit 8f93bd8 et al.
The S/390 members of the buildfarm are showing failures indicating that they're having trouble with the rint() calls I added yesterday. There's no good reason for that, and I wonder if it is a compiler bug similar to the one we worked around in d9476b8. Try to fix it using the same method as before, namely to store the result of rint() back into a "double" variable rather than immediately converting to int64. (This isn't entirely waving a dead chicken, since on machines with wider-than-double float registers, the extra store forces a width conversion. I don't know if S/390 is like that, but it seems worth trying.) In passing, merge duplicate ereport() calls in float8_timestamptz(). Per buildfarm.
1 parent 1888fad commit 86ef376

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/adt/timestamp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,9 +1546,10 @@ make_interval(PG_FUNCTION_ARGS)
15461546
result->day = weeks * 7 + days;
15471547

15481548
#ifdef HAVE_INT64_TIMESTAMP
1549+
secs = rint(secs * USECS_PER_SEC);
15491550
result->time = hours * ((int64) SECS_PER_HOUR * USECS_PER_SEC) +
15501551
mins * ((int64) SECS_PER_MINUTE * USECS_PER_SEC) +
1551-
(int64) rint(secs * USECS_PER_SEC);
1552+
(int64) secs;
15521553
#else
15531554
result->time = hours * (double) SECS_PER_HOUR +
15541555
mins * (double) SECS_PER_MINUTE +

0 commit comments

Comments
 (0)