Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a990a1

Browse files
committed
Lobotomize test for float -Inf ^ -2, at least for now.
Per POSIX this case should produce +0, but buildfarm member fossa(with icc (ICC) 19.0.5.281 20190815) is reporting -0. icc has aboatload of unsafe floating-point optimizations, with a correspondingboatload of not-too-well-documented compiler switches, and it seems ourdefault use of "-mp1" isn't whacking it hard enough to keep it frommisoptimizing the stanza in dpow() that checks whether y is odd.There's nothing wrong with that code (seeing that no other buildfarmmember has trouble with it), so I'm content to blame this on thecompiler. But without access to the compiler I'm not going to guess atwhat switches might be needed to fix it. For now, tweak the test caseso it will accept either -0 or +0 as a correct answer.Discussion:https://postgr.es/m/E1jkyFX-0005RR-1Q@gemulon.postgresql.org
1 parenteab6e46 commit3a990a1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎src/test/regress/expected/float8.out

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,12 @@ SELECT power(float8 'inf', float8 '-inf');
501501
0
502502
(1 row)
503503

504-
SELECT power(float8 '-inf', float8 '-2');
505-
power
506-
-------
507-
0
504+
-- Intel's icc misoptimizes the code that controls the sign of this result,
505+
-- even with -mp1. Pending a fix for that, only test for "is it zero".
506+
SELECT power(float8 '-inf', float8 '-2') = '0';
507+
?column?
508+
----------
509+
t
508510
(1 row)
509511

510512
SELECT power(float8 '-inf', float8 '-3');

‎src/test/regress/sql/float8.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ SELECT power(float8 'inf', float8 '-2');
140140
SELECT power(float8'inf', float8'2');
141141
SELECT power(float8'inf', float8'inf');
142142
SELECT power(float8'inf', float8'-inf');
143-
SELECT power(float8'-inf', float8'-2');
143+
-- Intel's icc misoptimizes the code that controls the sign of this result,
144+
-- even with -mp1. Pending a fix for that, only test for "is it zero".
145+
SELECT power(float8'-inf', float8'-2')='0';
144146
SELECT power(float8'-inf', float8'-3');
145147
SELECT power(float8'-inf', float8'2');
146148
SELECT power(float8'-inf', float8'3');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp