http://llvm.org/bugs/show_bug.cgi?id=8100
Summary: No way to prevent excessive constant propagation
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Hello,
consider this code:
#include <fenv.h>
#include <assert.h>
int main(){
double a=1.1;
double b=10.1;
fesetround(FE_UPWARD);
assert(-((-a)*b)!=a*b);
}
Excessive optimization will remove the double negation. gcc has option
-frounding-math to help with this. Intel's -fp-model strict is not quite as
good (it fails for this example) but it helps (for instance it lets the code
work if I write 1.1 and 10.1 instead of a and b in the assertion). With
llvm-gcc or clang, this always fails at -O1.
A similar option for llvm would be very welcome, there are applications where
rounding in the appropriate direction is crucial (precision and speed come far
behind).
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs