simplify.c (gfc_simplify_floor): Set precision of temporary to that of arg.
2015-07-14 Steven G. Kargl <kargl@gcc.gnu.org> * simplify.c (gfc_simplify_floor): Set precision of temporary to that of arg. 2015-07-14 Steven G. Kargl <kargl@gcc.gnu.org> gfortran.dg/pr66864.f90: New test. From-SVN: r225790
This commit is contained in:
parent
6e5ad0f92c
commit
ff7097f21e
@ -1,3 +1,8 @@
|
||||
2015-07-14 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
* simplify.c (gfc_simplify_floor): Set precision of temporary to
|
||||
that of arg.
|
||||
|
||||
2015-07-13 Andre Vehreschild <vehre@gcc.gnu.org>
|
||||
|
||||
PR fortran/64589
|
||||
|
@ -2351,9 +2351,7 @@ gfc_simplify_floor (gfc_expr *e, gfc_expr *k)
|
||||
if (e->expr_type != EXPR_CONSTANT)
|
||||
return NULL;
|
||||
|
||||
gfc_set_model_kind (kind);
|
||||
|
||||
mpfr_init (floor);
|
||||
mpfr_init2 (floor, mpfr_get_prec (e->value.real));
|
||||
mpfr_floor (floor, e->value.real);
|
||||
|
||||
result = gfc_get_constant_expr (BT_INTEGER, kind, &e->where);
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-07-14 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
gfortran.dg/pr66864.f90: New test.
|
||||
|
||||
2015-07-14 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/66626
|
||||
|
16
gcc/testsuite/gfortran.dg/pr66864.f90
Normal file
16
gcc/testsuite/gfortran.dg/pr66864.f90
Normal file
@ -0,0 +1,16 @@
|
||||
! { dg-do run }
|
||||
! PR fortran/66864
|
||||
!
|
||||
program t
|
||||
implicit none
|
||||
real(8) x
|
||||
x = 2.0d0**26.5d0
|
||||
if (floor(x) /= 94906265) call abort
|
||||
if (floor(2.0d0**26.5d0)/= 94906265) call abort
|
||||
x = 777666555.6d0
|
||||
if (floor(x) /= 777666555) call abort
|
||||
if (floor(777666555.6d0) /= 777666555) call abort
|
||||
x = 2000111222.6d0
|
||||
if (floor(x) /= 2000111222) call abort
|
||||
if (floor(2000111222.6d0) /= 2000111222) call abort
|
||||
end program t
|
Loading…
Reference in New Issue
Block a user