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: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: 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>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 29 Apr 2014 10:46:06 +0200
- 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>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 29, 2014 at 10:27:58AM +0200, Tobias Burnus wrote:
> Thus, I think Fortran users would also prefer not to have
> -fsanitize=undefined implying trapping dividing by zero.
>
> Thus, I wonder whether it wouldn't be more useful to provide a command-line option
> to make the floating-point exceptions signalling - and to remind the users to link
> libbacktrace to get the trace.
That can be done independently with a different option, but -fsanitize=...
IMNSHO definitely shouldn't do anything with floating point control
registers.
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.
Jakub