This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [FORTRAN PATCH] Use more mathematical builtins


Roger wrote:

> The following patch is a tweak to the g77 front-end to make more 
> use of GCC's built-in mathematical functions.  Previously g77 used 
> GCC builtins for cos, sin and sqrt.  With this patch, it does the 
> same for atan2, exp, floor, fmod, log and pow.  This enables 
> FORTRAN to take advantage of the middle-end's constant folding 
> transformations and (when available) the inline intrinsic 
> implementations provided by the target's backend.

> The g77 testsuite showed up a bug in duplicate_decls when calling
> __builtin_fmod, which is always converted straight to a standard C
> library call.  The code to call COPY_DECL_ASSEMBLER_NAME is copied
> directly from the C front-end's duplicate_decls in c-decl.c.  This
> is another example of a change to duplicate_decls since the code
> was originally duplicated into the FORTRAN front-end.

Yes, sigh :-(

As far as I can see you also fixed another bug (r_atn2) - BRRR, probably
nobody ever uses that ...

> The following patch has been tested on i686-pc-linux-gnu, by a 
> full bootstrap configured with --enable-languages=c,f77 and a 
> top-level "make -k check" with no new regressions.  I've also 
> confirmed by hand that "FOO = EXP(0.0)" no longer calls the C 
> library but instead assigns 1.0 to FOO at run-time.

> Ok for mainline?

Sure, thanks very much !

--
Toon Moene, KNMI, PO Box 201, 3730 AE De Bilt, The Netherlands.
Tel. +31302206443, Fax +31302210407,  e-mail moene@knmi.nl
URL: http://www.knmi.nl/hirlam
--------------------------------------------------------------
Zie ook/see also: http://www.knmi.nl/maildisclaimer.html 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]