PING! Re: [PATCH, Fortran] Extension: COTAN and degree-valued trig intrinsics with -fdec-math
Markus Trippelsdorf
markus@trippelsdorf.de
Tue Oct 11 14:37:00 GMT 2016
On 2016.10.11 at 07:26 -0400, Fritz Reese wrote:
> On Mon, Oct 10, 2016 at 3:56 PM, Steve Kargl
> <sgk@troutmask.apl.washington.edu> wrote:
> ...
> > There are a few small clean-up that can be
> > done. For example,
> >
> > +static gfc_expr *
> > +get_radians (gfc_expr *deg)
> > +{
> > + mpfr_t tmp;
> ...
> > the tmp variable is unneeded in the above. Converting the double
> > precision 180.0 to mpfr_t and then dividing is probably slower
> > than just dividing by 180.
> >
> > + /* Set factor = pi / 180. */
> > + factor = gfc_get_constant_expr (deg->ts.type, deg->ts.kind, °->where);
> > + mpfr_const_pi (factor->value.real, GFC_RND_MODE);
> > + mpfr_div_ui (factor->value.real, factor->value.real, 180, GFC_RND_MODE);
> >
> ...
>
> Good catch, fixed and committed r240989. Many thanks to you and Jerry.
This patch breaks bootstrap:
../../gcc/gcc/fortran/iresolve.c: In function âgfc_expr* get_degrees(gfc_expr*)â:
../../gcc/gcc/fortran/iresolve.c:2728:14: error: âtmpâ was not declared in this scope mpfr_init (tmp);
Even declaring the variable doesn't help:
../../gcc/gcc/fortran/simplify.c: In function âvoid radians_f(__mpfr_struct*, mpfr_rnd_t)â:
../../gcc/gcc/fortran/simplify.c:1775:5: error: âmpfr_fmod_dâ was not declared in this scope
mpfr_fmod_d (tmp, x, 360.0, rnd_mode);
^~~~~~~~~~~
--
Markus
More information about the Fortran
mailing list