This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] powerpc - extract a float return value


Hello GDB folks,

The way GDB extracts float return values in rs6000-tdep.c
(rs6000_extract_return_value) seems dubious to me:

[...]
memcpy (&dd, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
ff = (float) dd;
memcpy (valbuf, &ff, sizeof (float));
[...]

The cast will not work properly if the target and the host have not a similar
float representation.

I propose to fix that by a call to convert_typed_floating. See patch in
attachment.

I have not yet tested it against the testsuite, I will do that
tomorrow. In the meantime, if you have comments I would be happy to
address them!

--
Jerome

Attachment: diff.2
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]