[Bug fortran/85544] [7/8/9 Regression] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.c:3385

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 22 19:56:00 GMT 2018


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

--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(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.

Let's leave that as some optimization potential (it should also
be possible to optimize (-2)**n and so on) for a later date.

Otherwise: Patches welcome (as always :-)


More information about the Gcc-bugs mailing list