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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
int &&a = 1 / ~-1;
is enough.

When we have
int &&b = 1 / 0;
this doesn't ICE.  When creating TRUNC_DIV_EXPR for the latter, we don't set
the constant bit on it, because the last argument is integer_zerop.  That is
not the case with the former testcase, but both arguments are TREE_CONSTANT and
so we set TREE_CONSTANT on the TRUNC_DIV_EXPR as well.

I'm surprised we never cp_fold this initializer.

Reply via email to