This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, committed] Fix simplify modulo.


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

2005-06-24  Feng Wang  <fengwang@nudt.edu.cn>

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


2005-06-24  Feng Wang  <fengwang@nudt.edu.cn>

        * 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]