2000-10-04 Jakub Jelinek * 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). --- gcc/emit-rtl.c.jj Fri Sep 15 16:46:31 2000 +++ gcc/emit-rtl.c Wed Oct 4 18:03:18 2000 @@ -1055,10 +1055,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(); @@ -1071,14 +1073,24 @@ gen_lowpart_common (mode, x) #else if (HOST_BITS_PER_WIDE_INT != 64) abort(); + for (c = 0; c < 4; c++) i[c] &= 0xffffffffL; - - 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 } #endif /* ifndef REAL_ARITHMETIC */ --- gcc/dwarf2out.c.jj Fri Sep 15 16:46:31 2000 +++ gcc/dwarf2out.c Wed Oct 4 17:51:48 2000 @@ -7116,7 +7116,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[4]; REAL_VALUE_TYPE rv;