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

Fix overlaps.sql test fail on 32 bit Debian due to gcc bug 323#62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vitcpp merged 2 commits intopostgrespro:masterfromvitcpp:gcc-bug-323
Sep 8, 2023

Conversation

vitcpp
Copy link
Contributor

On some 32 bit platforms, there is a gcc bug that makes floating point calculations and comparisons unstable (see the link below). The problem originates in FPU 80 bits registers where double values are not truncated to 64 bit values. When gcc compiles some code with enabled optimizations, the intermediate results may be kept in the FPU registers without truncation to 64 bit values. Extra bits may produce unstable results when comparing the numbers.

The generic solution is to save the intermediate results in the memory where the values are truncated to 64 bit values. It affects the performance but makes the tests stable on all platforms.

PGSPHERE_FLOAT_STORE macro enables storing of intermediate results for FPxx operations in the memory. It is enabled by default for 32 bit platforms. It can be explicitly enabled or disabled in CFLAGS. To enable it for all code the gcc option -ffloat-store may be used as well.

Link to gcc bug:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

df7cb and esabol reacted with thumbs up emoji
On some 32 bit platforms, there is a gcc bug that makes floating pointcalculations and comparisons unstable (see the link below). The problemoriginates in FPU 80 bits registers where double values are not truncatedto 64 bit values. When gcc compiles some code with enabled optimizations,the intermediate results may be kept in the FPU registers without truncationto 64 bit values. Extra bits may produce unstable results when comparingthe numbers.The generic solution is to save the intermediate results in the memory wherethe values are truncated to 64 bit values. It affects the performance butmakes the tests stable on all platforms.PGSPHERE_FLOAT_STORE macro enables storing of intermediate results for FPxxoperations in the memory. It is enabled by default for 32 bit platforms.It can be explicitly enabled or disabled in CFLAGS. To enable it for allcode the gcc option -ffloat-store may be used as well.Link to gcc bug:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
@vitcppvitcpp linked an issueSep 7, 2023 that may beclosed by this pull request
Copy link
Contributor

@esabolesabol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good to me!

@vitcppvitcpp merged commitfb93eb4 intopostgrespro:masterSep 8, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@esabolesabolesabol approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

sellipse/scircle overlaps regression tests
2 participants
@vitcpp@esabol

[8]ページ先頭

©2009-2025 Movatter.jp