aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-02-09 15:49:58 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-02-09 15:49:58 -0500
commit86ef376bbe1b9568fa71e76ecfd3091d522368bb (patch)
treeed6eba183bb108d1e06840aed455e21129eb28ca /src
parent1888fad440036195c7e7a933fc17410fad8dcc3d (diff)
downloadpostgresql-86ef376bbe1b9568fa71e76ecfd3091d522368bb.tar.gz
postgresql-86ef376bbe1b9568fa71e76ecfd3091d522368bb.zip
Blind try to fix portability issue in commit 8f93bd851 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 d9476b838. 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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/timestamp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index dcef7175f38..05aabd1cd07 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -1546,9 +1546,10 @@ make_interval(PG_FUNCTION_ARGS)
result->day = weeks * 7 + days;
#ifdef HAVE_INT64_TIMESTAMP
+ secs = rint(secs * USECS_PER_SEC);
result->time = hours * ((int64) SECS_PER_HOUR * USECS_PER_SEC) +
mins * ((int64) SECS_PER_MINUTE * USECS_PER_SEC) +
- (int64) rint(secs * USECS_PER_SEC);
+ (int64) secs;
#else
result->time = hours * (double) SECS_PER_HOUR +
mins * (double) SECS_PER_MINUTE +