On Tue, Feb 06, 2018 at 10:43:21AM -0500, Aldy Hernandez wrote:
> In this PR we are ICEing here:
> 
> bool
> operation_no_trapping_overflow (tree type, enum tree_code code)
> {
>   gcc_checking_assert (ANY_INTEGRAL_TYPE_P (type));
> 
> ...because we are being passed a pointer type from find_trapping_overflow.
> 
> Fixed by avoiding passing non-integrals from find_trapping_overflow.
> 
> Pre-approved by Jakub.  Committed.
> 
> Tested on x86-64 Linux.

> gcc/
> 
>       PR tree-optimization/84225
>       * tree-eh.c (find_trapping_overflow): Only call
>       operation_no_trapping_overflow when ANY_INTEGRAL_TYPE_P.

Can you please add a testcase too?
While the reported ICE was on an existing testcase, it was with
non-standard options on it.
So e.g.
gcc.dg/pr84225.c
that would contain:

/* PR tree-optimization/84225 */
/* { dg-do compile { target int32plus } } */
/* { dg-options "-Ofast -ftrapv" } */

#include "torture/pr69714.c"

or so should hopefully do the job, just test with cc1 before and after this
change to verify it ICEd and doesn't ICE anymore.

        Jakub

Reply via email to