This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Fix UBSAN in postreload-gcse.c (PR rtl-optimization/87868).
- From: Jeff Law <law at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Nov 2018 11:55:28 -0700
- Subject: Re: [PATCH][RFC] Fix UBSAN in postreload-gcse.c (PR rtl-optimization/87868).
- References: <c39959b0-d0ac-9887-abb5-e2fddfb5be0c@suse.cz>
On 11/6/18 7:05 AM, Martin Liška wrote:
> Hi.
>
> The patch is adding a check overflow in eliminate_partially_redundant_load.
> Question is whether the usage of conditional compilation of __builtin_mul_overflow
> is fine?
>
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2018-11-06 Martin Liska <mliska@suse.cz>
>
> PR rtl-optimization/87868
> * postreload-gcse.c (eliminate_partially_redundant_load): Set
> threshold to max_count if we would overflow.
> * profile-count.h: Make max_count a public constant.
OK. Though I do worry about how many of these things we'll have to
sprinkle over the sources over time. I suspect there's all kinds of
overflows just waiting to happen, some are obviously more important than
others.
jeff