This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -fsanitize=float-cast-overflow with C FE (PR sanitizer/64344)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Dodji Seketeli <dseketel at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 18 Dec 2014 21:45:06 +0000
- Subject: Re: [PATCH] Fix -fsanitize=float-cast-overflow with C FE (PR sanitizer/64344)
- Authentication-results: sourceware.org; auth=none
- References: <20141212213028 dot GE1667 at tucnak dot redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1412161858390 dot 15637 at digraph dot polyomino dot org dot uk> <20141218121122 dot GG1667 at tucnak dot redhat dot com>
On Thu, 18 Dec 2014, Jakub Jelinek wrote:
> c/
> * c-typeck.c (convert_for_assignment, c_finish_return): For
> -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
> types also set in_late_binary_op around convert call.
> * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
> to integral type casts, if not in_late_binary_op, pass c_fully_fold
> result on expr as last argument to ubsan_instrument_float_cast,
> if in_late_binary_op, don't use c_save_expr but save_expr.
The C front-end changes are OK.
--
Joseph S. Myers
joseph@codesourcery.com