Summary: | incorrect -ffast-math division simplification | ||
---|---|---|---|
Product: | gcc | Reporter: | Laurent GUERBY <laurent> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | gcc-bugs, laurent |
Priority: | P2 | ||
Version: | 4.0.0 | ||
Target Milestone: | --- | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: |
Description
Laurent GUERBY
2004-04-25 16:42:12 UTC
Simple C testcase: float x = 30.0; int main() { if ( 90.0/x != 3.0) abort(); return 0; } It works on PPC but not on i686 so this is a dup of bug 323 and invalid. *** This bug has been marked as a duplicate of 323 *** Note what -ffast-math does is converts: 90.0/x into 1/x *90.0, so there is a precision loss which causes 1./0f/30.0 * 90.0 != 3.0. So this is still invalid. Ok I see, but then it's not really a dup of 323 which has an incorrect program, here the program is correct and just broken when we allow unsafe math optimizations :) Laurent |