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 :-)

Reply via email to