From a3504e64abf8db7b538c95d5a10890c21c22b28f Mon Sep 17 00:00:00 2001 From: Feng Wang Date: Fri, 24 Jun 2005 03:23:04 +0000 Subject: simplify.c (gfc_simplify_modulo): Don't clear before get result. 2005-06-24 Feng Wang * simplify.c (gfc_simplify_modulo): Don't clear before get result. 2005-06-24 Feng Wang * gfortran.dg/simplify_modulo.f90: New. From-SVN: r101288 --- gcc/fortran/ChangeLog | 6 +++++- gcc/fortran/simplify.c | 3 +-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gfortran.dg/simplify_modulo.f90 | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/simplify_modulo.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4badf66..99a232e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,8 @@ -2005-06-22 Paul Brook +2005-06-24 Feng Wang + + * simplify.c (gfc_simplify_modulo): Don't clear before get result. + +2005-06-22 Paul Brook PR fortran/21034 * symbol.c (gfc_is_var_automatic): New function. diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 6797bca..fc3a9cb 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2231,12 +2231,11 @@ gfc_simplify_modulo (gfc_expr * a, gfc_expr * p) mpfr_div (quot, a->value.real, p->value.real, GFC_RND_MODE); mpfr_floor (iquot, quot); mpfr_mul (term, iquot, p->value.real, GFC_RND_MODE); + mpfr_sub (result->value.real, a->value.real, term, GFC_RND_MODE); mpfr_clear (quot); mpfr_clear (iquot); mpfr_clear (term); - - mpfr_sub (result->value.real, a->value.real, term, GFC_RND_MODE); break; default: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b96fc11..413f381 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-06-24 Feng Wang + + * gfortran.dg/simplify_modulo.f90: New. + 2005-06-24 Jan Hubicka * gcc.dg/tree-ssa/20040210-1.c: Fix for unit-at-a-time diff --git a/gcc/testsuite/gfortran.dg/simplify_modulo.f90 b/gcc/testsuite/gfortran.dg/simplify_modulo.f90 new file mode 100644 index 0000000..550a3ad --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simplify_modulo.f90 @@ -0,0 +1,5 @@ +! { dg-do run } + +if (modulo (-8., -5.) .ne. -3.) call abort () + +end -- cgit v1.1