[Bug tree-optimization/84117] [8 Regression] ICE in gimplify_modify_expr, at gimplify.c:5798

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Jan 31 11:31:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84117

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 31 Jan 2018, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84117
> 
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |ASSIGNED
>            Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
> 
> --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Created attachment 43305
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43305&action=edit
> gcc8-pr84117.patch
> 
> Untested fix.  Richard, or do you want to put it into another source
> file/header?

The file works for me.  Note instead of the switch () you probably
want to use

 if (! operation_no_trapping_overflow (TREE_TYPE (*tp), TREE_CODE (*tp)))
   return *tp;

so we keep a single place to specify which tree codes will end up
trapping for which type.

Otherwise looks ok but I'd do the rewrite in
number_of_iterations_exit instead?  Which also means another option
would be to say chrec_dont_know there if find_trapping_overflow ().
That might be even safer given I'm sure we'll run into similar
issues with SCEV ... (but maybe I've fixed enough of the undefined
overflow cases there to also catch traps...)


More information about the Gcc-bugs mailing list