[Bug fortran/85544] [7/8/9 Regression] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.c:3385
anlauf at gmx dot de
gcc-bugzilla@gcc.gnu.org
Sat Dec 22 20:09:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85544
--- Comment #13 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Thomas Koenig from comment #12)
> (In reply to Harald Anlauf from comment #10)
>
> > Handling positive powers of 2 should be straightforward:
> >
> > The condition is sth. like
> >
> > if (v > 1 && (v & (v-1) == 0))
> >
> > and the exponent is derived by bit-counting the number of ones in (v-1)...
>
> ... which is something I (currently) do not know to do in the
> front end.
Since you already have
HOST_WIDE_INT v;
you could use wi::popcount (v-1).
> Otherwise: Patches welcome (as always :-)
I'm afraid removing some of your code would cross the magic 10 lines mark...
More information about the Gcc-bugs
mailing list