[patch, committed] Fix simplify modulo.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[patch, committed] Fix simplify modulo.

Feng Wang
This patch fixed gfc_simplify_modulo. We should not clear mpfr before get
result. Committed as obvious.

2005-06-24  Feng Wang  <[hidden email]>

        * simplify.c (gfc_simplify_modulo): Don't clear before get result.


2005-06-24  Feng Wang  <[hidden email]>

        * gfortran.dg/simplify_modulo.f90: New.

Index: fortran/simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/simplify.c,v
retrieving revision 1.26
diff -u -r1.26 simplify.c
--- fortran/simplify.c  1 Jun 2005 19:17:32 -0000       1.26
+++ fortran/simplify.c  24 Jun 2005 03:20:23 -0000
@@ -2231,12 +2231,11 @@
       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:



Best Regards,
Feng Wang

--
Creative Compiler Research Group,
National University of Defense Technology, China.


       

       
               
___________________________________________________________
??????G?????????????,???????????????
http://cn.mail.yahoo.com/?id=77071