emit-rtl.c (gen_lowpart_common): Fix conversion from float to integral mode with HOST_BITS_PER_WIDE_INT 64.

* 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
This commit is contained in:
Jakub Jelinek 2000-10-05 18:53:33 +02:00 committed by Jakub Jelinek
parent ab9b1e4239
commit e389897bcd
3 changed files with 26 additions and 9 deletions

View 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

View 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;

View 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
}