Bug 145841
Summary: | g77 behavior changes when sin()/cos() used in-line vs. first assigning to variables | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Greg Earle <bugzilla.redhat.com> | ||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED WONTFIX | QA Contact: | |||||
Severity: | low | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 3.0 | ||||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
URL: | http://www-mipl.jpl.nasa.gov/mollweide_bug.f | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2005-01-25 08:53:57 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Greg Earle
2005-01-22 04:11:05 UTC
Created attachment 110087 [details]
Test case - Fortran source file
Compile via "g77 -g -o mollweide_bug mollweide_bug.f", run resultant binary.
The reason for this is mis-designed i387 FPU unit. All FPU computation are done in one selected precision (by default 80bit extended double) and rounding to other precisions happens only when storing the values into memory. Not sure about Fortran, but in C it is certainly allowed to compute expressions in excess precision (as long as downcasts result in rounding). See e.g. http://gcc.gnu.org/ml/gcc/2005-01/msg01082.html and associated thread for details. If you have SSE2 capable CPU (Pentium4+, recent AMD chips), you can fix this by using -msse2 -mfpmath=sse, otherwise simply live with the broken hardware and count with the possibility of excess precision. |