diff options
Diffstat (limited to 'gcc-4.4.3/gcc/fold-const.c')
-rw-r--r-- | gcc-4.4.3/gcc/fold-const.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/gcc-4.4.3/gcc/fold-const.c b/gcc-4.4.3/gcc/fold-const.c index fd4debd36..e1931e66b 100644 --- a/gcc-4.4.3/gcc/fold-const.c +++ b/gcc-4.4.3/gcc/fold-const.c @@ -7901,46 +7901,11 @@ native_interpret_int (tree type, const unsigned char *ptr, int len) static tree native_interpret_real (tree type, const unsigned char *ptr, int len) { - enum machine_mode mode = TYPE_MODE (type); - int total_bytes = GET_MODE_SIZE (mode); - int byte, offset, word, words, bitpos; - unsigned char value; - /* There are always 32 bits in each long, no matter the size of - the hosts long. We handle floating point representations with - up to 192 bits. */ REAL_VALUE_TYPE r; - long tmp[6]; - - total_bytes = GET_MODE_SIZE (TYPE_MODE (type)); - if (total_bytes > len || total_bytes > 24) + if (!real_from_native (type, ptr, len, &r)) return NULL_TREE; - words = (32 / BITS_PER_UNIT) / UNITS_PER_WORD; - - memset (tmp, 0, sizeof (tmp)); - for (bitpos = 0; bitpos < total_bytes * BITS_PER_UNIT; - bitpos += BITS_PER_UNIT) - { - byte = (bitpos / BITS_PER_UNIT) & 3; - if (UNITS_PER_WORD < 4) - { - word = byte / UNITS_PER_WORD; - if (WORDS_BIG_ENDIAN) - word = (words - 1) - word; - offset = word * UNITS_PER_WORD; - if (BYTES_BIG_ENDIAN) - offset += (UNITS_PER_WORD - 1) - (byte % UNITS_PER_WORD); - else - offset += byte % UNITS_PER_WORD; - } - else - offset = BYTES_BIG_ENDIAN ? 3 - byte : byte; - value = ptr[offset + ((bitpos / BITS_PER_UNIT) & ~3)]; - - tmp[bitpos / 32] |= (unsigned long)value << (bitpos & 31); - } - - real_from_target (&r, tmp, mode); - return build_real (type, r); + else + return build_real (type, r); } |