[Patch, Fortran] Simplify Bessel_* functions
Janne Blomqvist
blomqvist.janne@gmail.com
Tue May 6 19:04:00 GMT 2008
Tobias Burnus wrote:
> Hello all,
>
> This add calls to mpfr_j* and mpfr_y* for the Fortran 2008 Bessel
> functions. This is a rejects-valid patch as one can construct a Fortran
> program, which fails to compile without this simplification. (Though I
> think it only fails for very specially crafted programs.)
>
> It might be also a performance optimization, but I'm not sure. Currenly,
> "real, parameter = bessel_j0(3.3)" is optimized to the numeric value
> when generating the middle-end tree (i.e. it is simplified in the
> original dump) thus in most of the cases the Bessel functions are
> already properly const folded.
>
> Build and regression tested on x86-64.
> OK for the trunk?
FWIW this causes bootstrap problems at least for the automatic tester. From
http://glutton.geoffk.org/HEAD/native-lastbuild.txt.gzip
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_j0':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:640: error: unused
parameter 'x'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_j1':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:660: error: unused
parameter 'x'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_jn':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:680: error: unused
parameter 'order'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:680: error: unused
parameter 'x'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_y0':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:702: error: unused
parameter 'x'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_y1':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:722: error: unused
parameter 'x'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c: In function
'gfc_simplify_bessel_yn':
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:742: error: unused
parameter 'order'
/home/regress/tbox/svn-gcc/gcc/fortran/simplify.c:742: error: unused
parameter 'x'
make[3]: *** [fortran/simplify.o] Error 1
I think the problem might be that the regression tester doesn't have
MPFR >= 2.3.0, which is mentioned as a required dependency in install.texi.
As an aside, since MPFR >= 2.3 is required anyway, there's no need to
put ifdefs around the code, right?
--
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080506/683ca3c1/attachment.sig>
More information about the Fortran
mailing list