This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] Fix PR 17568: Shortcomings in ISHFT constant folder
Paul Brook wrote:
> Better would be to avoid using the buffer at all.
> Why can't you just use gmp arithmetic?
Because I thought I knew that GMP doesn't have any logical shift functions,
and didn't think of mpz_mul_2exp. This function will not only allow
simplifying twos_complement, but also gfc_simplify_ishft and gfc_simplify_ishftc.
I will prepare a patch to this effect, after I have got another change, which
I will post shortly, out of my tree.
>
> mpz_set_ui(mask, 1)
> mpz_mul_2exp(mask, mask, bitsize);
> mpz_sub_ui(mask, mask, 1);
>
Thanks,
- Tobi