This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Implement -fsanitize=float-divide-by-zero
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>, Marc Glisse <marc dot glisse at inria dot fr>, Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 2 May 2014 15:51:13 +0000
- Subject: Re: [PATCH] Implement -fsanitize=float-divide-by-zero
- Authentication-results: sourceware.org; auth=none
- References: <20140429082758 dot GA9773 at physik dot fu-berlin dot de> <20140429084606 dot GO1817 at tucnak dot redhat dot com>
On Tue, 29 Apr 2014, Jakub Jelinek wrote:
> To my surprise, the wording in C99 or C++11 make even floating point
> division by zero undefined behavior, but I think generally at least for IEEE
> floating point semantics it is well defined, thus I think we shouldn't
> include it in -fsanitize=undefined.
Making Annex F explicitly take precedence over the generic text is DR#442.
(This precedence issue applies to out-of-range conversions from floating
point to integer as well as such things as floating-point division by
zero: the generic text makes such out-of-range conversions undefined, but
Annex F says they raise "invalid" and return an unspecified value.)
--
Joseph S. Myers
joseph@codesourcery.com