emit-rtl.c (gen_lowpart_common): Fix conversion from float to integral mode with...
authorJakub Jelinek <jakub@redhat.com>
Thu, 5 Oct 2000 16:53:33 +0000 (18:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 5 Oct 2000 16:53:33 +0000 (18:53 +0200)
* emit-rtl.c (gen_lowpart_common) [REAL_ARITHMETICS]: Fix conversion
from float to integral mode with HOST_BITS_PER_WIDE_INT 64.
* dwarf2out.c (add_const_value_attribute): Divide by 4, not
sizeof(long).

From-SVN: r36728

gcc/ChangeLog
gcc/dwarf2out.c
gcc/emit-rtl.c

index 540f54a330f41d3a3ba3fd0aefcf14f4a338dba9..2b010598469b865bdbfee66366fe4f66f4d87d41 100644 (file)
@@ -1,3 +1,10 @@
+2000-10-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * emit-rtl.c (gen_lowpart_common) [REAL_ARITHMETICS]: Fix conversion
+       from float to integral mode with HOST_BITS_PER_WIDE_INT 64.
+       * dwarf2out.c (add_const_value_attribute): Divide by 4, not
+       sizeof(long).
+
 Thu Oct  5 09:31:31 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform
index bc1964ae0779ab5fff2aaf084f6a5d706964888c..4e520fefc1c7f69cd657dfb89e7654fdafc44af9 100644 (file)
@@ -7692,7 +7692,7 @@ add_const_value_attribute (die, rtl)
 
        if (GET_MODE_CLASS (mode) == MODE_FLOAT)
          {
-           register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
+           register unsigned length = GET_MODE_SIZE (mode) / 4;
            long *array = (long *) xmalloc (sizeof (long) * length);
            REAL_VALUE_TYPE rv;
 
index 2a4bdb9fcdbc8df1c2f4d68bea0e4e2a1011fb0a..c5ddeb081ed9809293778bd46ab94157383cc361 100644 (file)
@@ -942,10 +942,12 @@ gen_lowpart_common (mode, x)
          break;
 #if LONG_DOUBLE_TYPE_SIZE == 96
        case XFmode:
+         REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i + endian);
+         i[3-3*endian] = 0;
 #else
        case TFmode:
-#endif
          REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i);
+#endif
          break;
        default:
          abort ();
@@ -964,13 +966,21 @@ gen_lowpart_common (mode, x)
 
        for (c = 0; c < 4; c++)
          i[c] &= ~ (0L);
-      
-       return immed_double_const (i[endian * 3]
-                                  | (((HOST_WIDE_INT) i[1 + endian]) << 32),
-                                  i[2 - endian]
-                                  | (((HOST_WIDE_INT) i[3 - endian * 3])
-                                     << 32),
-                                  mode);
+
+       switch (GET_MODE (x))
+         {
+         case SFmode:
+         case DFmode:
+           return immed_double_const (((unsigned long) i[endian]) |
+                                      (((HOST_WIDE_INT) i[1-endian]) << 32),
+                                      0, mode);
+         default:
+           return immed_double_const (((unsigned long) i[endian*3]) |
+                                      (((HOST_WIDE_INT) i[1+endian]) << 32),
+                                      ((unsigned long) i[2-endian]) |
+                                      (((HOST_WIDE_INT) i[3-endian*3]) << 32),
+                                      mode);
+         }
       }
 #endif
     }