https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114801
--- Comment #36 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
I've been looking at this. I think the real problem is that trunc_int_for mode
is doing something incompatible with what the later code expects. We have
/* Canonicalize BImode to 0 and STORE_FLAG_VALUE. */
if (smode == BImode)
return c & 1 ? STORE_FLAG_VALUE : 0;
But this doesn't handle other boolen modes, such as B2I or B4I. This then
causes the assertion later on because we expect a bool value to be in a fixed
form.