http://llvm.org/bugs/show_bug.cgi?id=17000
Bug ID: 17000
Summary: clang sanitizer regards IEC 60559 floating-point
division by zero as undefined
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Annex F of the C standard (IEC 60559 / IEEE 754 support) defines the
floating-point division by zero, but clang (3.3 and 3.4 Debian snapshot)
regards it as undefined. This is incorrect: with
#include <stdio.h>
int main(void)
{
volatile double d;
#if __STDC_IEC_559__
d = 1.0 / 0.0;
printf ("%g\n", d);
#endif
return 0;
}
I get the following error:
ypig:~> clang tst.c -o tst -fsanitize=undefined -fno-sanitize-recover
ypig:~> ./tst
tst.c:7:11: runtime error: division by zero
zsh: exit 1 ./tst
When IEC 60559 is supported, "float-divide-by-zero" shouldn't be part of
"undefined". A user would would like to check division by zero could either
check the corresponding exception or explicitly add "float-divide-by-zero" to
-fsanitize.
My Debian bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720935
--
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