This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [1/4] [patch, middle-end] Make mpz_set/get_double_int functions non-static.
Hello,
> >I have looked at the other use of get_type_bounds, and it seems that
> >returning TYPE_MIN_VALUE and TYPE_MAX_VALUE would be the correct
> >behavior there as well. Could you please change get_type_bounds
> >that way, when you are at it?
>
> The attached patch does this (except in cases where it can't, which
> turned out to be more common than I thought they'd be!). Tested with a
> bootstrap and "make check-gcc" on i686-pc-linux-gnu. Ok for trunk?
> + if (!wrap)
> + gcc_assert (count <= 2);
gcc_assert (wrap || count <= 2)
More importantly,
> + {
> + if (TYPE_UNSIGNED (type))
> + mpz_set_ui (min, 0);
> + else
> + {
> + double_int mn;
> + mn = double_int_sext (double_int_add (mn, double_int_one),
> + TYPE_PRECISION (type));
> + mpz_set_double_int (min, mn, false);
> + }
> + }
mn is used uninitialized here (inside double_int_add).
Zdenek