Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect floating point results #18362

Open
llvmbot opened this issue Nov 19, 2013 · 1 comment
Open

incorrect floating point results #18362

llvmbot opened this issue Nov 19, 2013 · 1 comment
Labels
bugzilla Issues migrated from bugzilla c++ floating-point Floating-point math

Comments

@llvmbot
Copy link
Member

llvmbot commented Nov 19, 2013

Bugzilla Link 17988
Version unspecified
OS MacOS X
Attachments Extract and type ./compile to compile the code ... Creates executable testBug
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@sunfishcode

Extended Description

Attaching a piece of C++ code which gives wrong floating point result with clang++. But gives correct results in the following compilers (tested)

  1. g++ >= 4.2 and 2) icpc > 11.0

Expected output

Flux = 0.57735 0.989578 0.412228 0.412228 1.73147

Actual output from clang

Flux = 0.508632 0.797979 0.383204 0.383204 1.20769

This bug is reproducible in clang shipped with Xcode 5.0 on OSX Maverics and clang 3.1-svn. valgrind shows no errors and using -O0 does not help either.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 19, 2013

Sorry just now confirmed this bug is visible only with the -O2 flag. So it has to do something with FP optimization.

Created attachment 11566 [details]
Extract and type ./compile to compile the code ... Creates executable testBug

Attaching a piece of C++ code which gives wrong floating point result with
clang++. But gives correct results in the following compilers (tested)

  1. g++ >= 4.2 and 2) icpc > 11.0

Expected output

Flux = 0.57735 0.989578 0.412228 0.412228 1.73147

Actual output from clang

Flux = 0.508632 0.797979 0.383204 0.383204 1.20769

This bug is reproducible in clang shipped with Xcode 5.0 on OSX Maverics and
clang 3.1-svn. valgrind shows no errors and using -O0 does not help either.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
@arsenm arsenm added the floating-point Floating-point math label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ floating-point Floating-point math
Projects
None yet
Development

No branches or pull requests

2 participants