[Fortran] Use MIN/MAX_EXPR or IFN_FMIN/MAX for min/max intrinsics when possible
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 19 Jul 2018 09:49:36 +0000 (09:49 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Thu, 19 Jul 2018 09:49:36 +0000 (09:49 +0000)
commite0c27d52dd783affbc95bdb53630b35ae044e620
tree78671068a29a8ff779e7a38e755a617b3e7544ca
parentb4a3f1e98a2635bfc6ded2b84fa9cfd3b845017b
[Fortran] Use MIN/MAX_EXPR or IFN_FMIN/MAX for min/max intrinsics when possible

* trans-intrinsic.c: (gfc_conv_intrinsic_minmax): Emit MIN_MAX_EXPR
or IFN_FMIN/FMAX sequence to calculate the min/max when possible.

* gfortran.dg/max_fmax_aarch64.f90: New test.
* gfortran.dg/min_fmin_aarch64.f90: Likewise.
* gfortran.dg/minmax_integer.f90: Likewise.

From-SVN: r262876
gcc/fortran/ChangeLog
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/max_fmax_aarch64.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/min_fmin_aarch64.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/minmax_integer.f90 [new file with mode: 0644]