This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Fix ubsan -fsanitize=float-cast-overflow ICE (PR sanitizer/88426)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Dec 2018 08:08:01 -0500
- Subject: Re: [C PATCH] Fix ubsan -fsanitize=float-cast-overflow ICE (PR sanitizer/88426)
- References: <20181211072150.GJ12380@tucnak>
On Tue, Dec 11, 2018 at 08:21:50AM +0100, Jakub Jelinek wrote:
> Hi!
>
> The following testcase ICEs since the c_save_expr removal. Unlike other
> spots where we use save_expr and potentially pass that to function ubsan
> calls, in this case we weren't calling c_fully_fold and
> c_fully_fold_internal unfortunately doesn't recurse into CALL_EXPRs, so
> the gimplifier then sees C_MAYBE_CONST_EXPRs and ICEs on them. E.g.
> for shift sanitization etc. we call c_fully_fold like this.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2018-12-11 Jakub Jelinek <jakub@redhat.com>
>
> PR sanitizer/88426
> * c-convert.c (convert): Call c_fully_fold before calling
> ubsan_instrument_float_cast.
>
> * c-c++-common/ubsan/float-cast-overflow-11.c: New test.
Ok, thanks.
Marek