From: Richard Kenner Date: Sat, 16 Nov 1996 22:40:22 +0000 (-0500) Subject: (operand_subword): Avoid confusion if sizeof (float) is less than a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e01a2cecba12c077b614d2369bf67dddafe54bc7;p=gcc.git (operand_subword): Avoid confusion if sizeof (float) is less than a full word. From-SVN: r13194 --- diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index f328d7a741b..2036ca727c9 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1254,6 +1254,7 @@ operand_subword (op, i, validate_address, mode) if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) + && sizeof (float) * 8 == HOST_BITS_PER_WIDE_INT && GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_SIZE (mode) == UNITS_PER_WORD && GET_CODE (op) == CONST_DOUBLE) @@ -1266,6 +1267,22 @@ operand_subword (op, i, validate_address, mode) u.f = d; return GEN_INT (u.i); } + if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) + || flag_pretend_float) + && sizeof (double) * 8 == HOST_BITS_PER_WIDE_INT + && GET_MODE_CLASS (mode) == MODE_FLOAT + && GET_MODE_SIZE (mode) == UNITS_PER_WORD + && GET_CODE (op) == CONST_DOUBLE) + { + double d; + union {double d; HOST_WIDE_INT i; } u; + + REAL_VALUE_FROM_CONST_DOUBLE (d, op); + + u.d = d; + return GEN_INT (u.i); + } #endif /* no REAL_ARITHMETIC */ /* The only remaining cases that we can handle are integers.