rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y conversion for prec 3 and...
authorJakub Jelinek <jakub@redhat.com>
Mon, 1 Aug 2011 08:55:33 +0000 (10:55 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 1 Aug 2011 08:55:33 +0000 (10:55 +0200)
* math/rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y
conversion for prec 3 and __FLT_EVAL_METHOD__ != 0.

From-SVN: r176999

libquadmath/ChangeLog
libquadmath/math/rem_pio2q.c

index 522d68385a98f743b7a7e4d23081c3922a5b0274..7b35cc985d71088ebe0b06452468e47672ec4bb2 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * math/rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y
+       conversion for prec 3 and __FLT_EVAL_METHOD__ != 0.
+
 2011-04-03  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/48311
index a1c0b831ddbd9bef788e9d8efedc82dc32b61fc0..47ee8ef2051a74bfbb27300e60087d28d359744b 100644 (file)
@@ -282,14 +282,20 @@ recompute:
                break;
            case 3:     /* painful */
                for (i=jz;i>0;i--) {
-                   fw      = fq[i-1]+fq[i];
-                   fq[i]  += fq[i-1]-fw;
-                   fq[i-1] = fw;
+#if __FLT_EVAL_METHOD__ != 0
+                   volatile
+#endif
+                   double fv = (double)(fq[i-1]+fq[i]);
+                   fq[i]  += fq[i-1]-fv;
+                   fq[i-1] = fv;
                }
                for (i=jz;i>1;i--) {
-                   fw      = fq[i-1]+fq[i];
-                   fq[i]  += fq[i-1]-fw;
-                   fq[i-1] = fw;
+#if __FLT_EVAL_METHOD__ != 0
+                   volatile
+#endif
+                   double fv = (double)(fq[i-1]+fq[i]);
+                   fq[i]  += fq[i-1]-fv;
+                   fq[i-1] = fv;
                }
                for (fw=0.0,i=jz;i>=2;i--) fw += fq[i];
                if(ih==0) {