2004-04-23 Jerome Guitton * rs6000-tdep.c (rs6000_extract_return_value): When extracting a float, use convert_typed_floating to get the appropriate format. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.191 diff -u -p -r1.191 rs6000-tdep.c --- rs6000-tdep.c 1 Apr 2004 21:00:59 -0000 1.191 +++ rs6000-tdep.c 21 Apr 2004 10:14:03 -0000 @@ -1251,22 +1251,15 @@ rs6000_extract_return_value (struct type if (TYPE_CODE (valtype) == TYPE_CODE_FLT) { - double dd; - float ff; /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes. We need to truncate the return value into float size (4 byte) if necessary. */ - if (TYPE_LENGTH (valtype) > 4) /* this is a double */ - memcpy (valbuf, - ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], - TYPE_LENGTH (valtype)); - else - { /* float */ - memcpy (&dd, ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8); - ff = (float) dd; - memcpy (valbuf, &ff, sizeof (float)); - } + convert_typed_floating (®buf[DEPRECATED_REGISTER_BYTE + (FP0_REGNUM + 1)], + builtin_type_double, + valbuf, + valtype); } else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_LENGTH (valtype) == 16