This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PING! Re: [PATCH, Fortran] Extension: COTAN and degree-valued trig intrinsics with -fdec-math
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: Fritz Reese <fritzoreese at gmail dot com>, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, Jerry DeLisle <jvdelisle at charter dot net>, fortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Oct 2016 07:37:35 -0700
- Subject: Re: PING! Re: [PATCH, Fortran] Extension: COTAN and degree-valued trig intrinsics with -fdec-math
- Authentication-results: sourceware.org; auth=none
- References: <CAE4aFA=CHwyvTuxAz_ZYB_qNxCKn_PuirobFJy6Xn-+sUd4vyA@mail.gmail.com> <7b44bb75-0d58-b51e-9248-c717cd7383ec@charter.net> <20161010195631.GA8204@troutmask.apl.washington.edu> <CAE4aFAnt9tOG85+D=ZOoSZbsAhWRS6X4L1XJbZ_Qaocsnkm3jQ@mail.gmail.com> <20161011124353.GA311@x4>
On Tue, Oct 11, 2016 at 5:43 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> 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);
> ^~~~~~~~~~~
Looks like it was only broken for some mpfr's. That is ones which is
compiled with gcc it worked but one which comes with Ubuntu 1604 it
does not. they are exactly the same version too.
Thanks,
Andrew
> --
> Markus