[llvm-bugs] [Bug 17000] clang sanitizer regards IEC 60559 floating-point division by zero as undefined

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 9 19:08:41 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=17000

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray.me
         Resolution|MOVED                       |FIXED

--- Comment #4 from Fangrui Song <i at maskray.me> ---
See https://bugs.llvm.org/show_bug.cgi?id=19535

float-divide-by-zero was removed from the -fsanitize=undefined by
https://reviews.llvm.org/D63793

% cat a.c
int main() { float x = 1.f; float y = x/0.f; y = x/0.f; }
% clang -fsanitize=undefined a.c -o a && ./a
% clang++ -xc++ -fsanitize=undefined a.c -o a && ./a
% gcc -fsanitize=undefined a.c -o a && ./a
% gcc -xc++ -fsanitize=undefined a.c -o a && ./a
# no complaint

The fallout should be fixed by D64317.

% clang -fsanitize=float-divide-by-zero a.c -o a && ./a
a.c:1:40: runtime error: division by zero
a.c:1:51: runtime error: division by zero
% gcc -fsanitize=float-divide-by-zero a.c -o a && ./a
a.c:1:40: runtime error: division by zero
a.c:1:51: runtime error: division by zero

The changes shall be included by clang 9.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190710/394f3a8e/attachment.html>


More information about the llvm-bugs mailing list