summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2004-04-23 16:21:34 +0000
committerJerome Guitton <guitton@adacore.com>2004-04-23 16:21:34 +0000
commit65951cd9b4d300b93ff7b7532a0a011cc0bfc495 (patch)
tree1efebe719f37bb35f07f37d22246981fc3865f94
parent2abe3c6ccd6a559f6befe403caef08500cf4e0ec (diff)
downloadppe42-binutils-65951cd9b4d300b93ff7b7532a0a011cc0bfc495.tar.gz
ppe42-binutils-65951cd9b4d300b93ff7b7532a0a011cc0bfc495.zip
* rs6000-tdep.c (rs6000_extract_return_value): When extracting a float,
use convert_typed_floating to get the appropriate format.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/rs6000-tdep.c17
2 files changed, 10 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 786b4fe914..98f5e3b054 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-23 Jerome Guitton <guitton@gnat.fr>
+
+ * rs6000-tdep.c (rs6000_extract_return_value): When extracting a float,
+ use convert_typed_floating to get the appropriate format.
+
2004-04-22 Randolph Chung <tausq@debian.org>
* hppa-tdep.h (find_unwind_entry, hppa_get_field, hppa_extract_5_load)
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index c9ab3a8b0e..721443eeea 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1412,22 +1412,15 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
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,
- &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)],
- TYPE_LENGTH (valtype));
- else
- { /* float */
- memcpy (&dd, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
- ff = (float) dd;
- memcpy (valbuf, &ff, sizeof (float));
- }
+ convert_typed_floating (&regbuf[DEPRECATED_REGISTER_BYTE
+ (FP0_REGNUM + 1)],
+ builtin_type_double,
+ valbuf,
+ valtype);
}
else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
&& TYPE_LENGTH (valtype) == 16
OpenPOWER on IntegriCloud