01e27f8
2000-10-04  Jakub Jelinek  <jakub@redhat.com>
01e27f8
01e27f8
	* emit-rtl.c (gen_lowpart_common) [REAL_ARITHMETICS]: Fix conversion
01e27f8
	from float to integral mode with HOST_BITS_PER_WIDE_INT 64.
01e27f8
	* dwarf2out.c (add_const_value_attribute): Divide by 4, not
01e27f8
	sizeof(long).
01e27f8
01e27f8
--- gcc/emit-rtl.c.jj	Fri Sep 15 16:46:31 2000
01e27f8
+++ gcc/emit-rtl.c	Wed Oct  4 18:03:18 2000
01e27f8
@@ -1055,10 +1055,12 @@ gen_lowpart_common (mode, x)
01e27f8
 	  break;
01e27f8
 #if LONG_DOUBLE_TYPE_SIZE == 96
01e27f8
 	case XFmode:
01e27f8
+	  REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i + endian);
01e27f8
+	  i[3-3*endian] = 0;
01e27f8
 #else
01e27f8
 	case TFmode:
01e27f8
-#endif
01e27f8
 	  REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i);
01e27f8
+#endif
01e27f8
 	  break;
01e27f8
 	default:
01e27f8
 	  abort();
01e27f8
@@ -1071,14 +1073,24 @@ gen_lowpart_common (mode, x)
01e27f8
 #else
01e27f8
       if (HOST_BITS_PER_WIDE_INT != 64)
01e27f8
 	abort();
01e27f8
+
01e27f8
       for (c = 0; c < 4; c++)
01e27f8
 	i[c] &= 0xffffffffL;
01e27f8
-      
01e27f8
-      return immed_double_const (i[endian*3] | 
01e27f8
-				 (((HOST_WIDE_INT) i[1+endian]) << 32),
01e27f8
-				 i[2-endian] |
01e27f8
-				 (((HOST_WIDE_INT) i[3-endian*3]) << 32),
01e27f8
-				 mode);
01e27f8
+
01e27f8
+      switch (GET_MODE (x))
01e27f8
+	{
01e27f8
+	case SFmode:
01e27f8
+	case DFmode:
01e27f8
+	  return immed_double_const (((unsigned long) i[endian]) |
01e27f8
+				     (((HOST_WIDE_INT) i[1-endian]) << 32),
01e27f8
+				     0, mode);
01e27f8
+	default:
01e27f8
+	  return immed_double_const (((unsigned long) i[endian*3]) | 
01e27f8
+				     (((HOST_WIDE_INT) i[1+endian]) << 32),
01e27f8
+				     ((unsigned long) i[2-endian]) |
01e27f8
+				     (((HOST_WIDE_INT) i[3-endian*3]) << 32),
01e27f8
+				     mode);
01e27f8
+	}
01e27f8
 #endif
01e27f8
     }
01e27f8
 #endif /* ifndef REAL_ARITHMETIC */
01e27f8
--- gcc/dwarf2out.c.jj	Fri Sep 15 16:46:31 2000
01e27f8
+++ gcc/dwarf2out.c	Wed Oct  4 17:51:48 2000
01e27f8
@@ -7116,7 +7116,7 @@ add_const_value_attribute (die, rtl)
01e27f8
 
01e27f8
 	if (GET_MODE_CLASS (mode) == MODE_FLOAT)
01e27f8
 	  {
01e27f8
-	    register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
01e27f8
+	    register unsigned length = GET_MODE_SIZE (mode) / 4;
01e27f8
 	    long array[4];
01e27f8
 	    REAL_VALUE_TYPE rv;
01e27f8