This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, committed] Fix simplify modulo.
- From: Feng Wang <wf_cs at yahoo dot com>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Jun 2005 11:23:56 +0800 (CST)
- Subject: [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