Skip to content

Commit f08877b

Browse files
author
Joel Brobecker
committed
Wrong return convention for arrays (mips-irix).
* mips-tdep.c (mips_n32n64_return_value): Arrays whose size is 128 bits or smaller are returned the same way as structs and unions of the the same size.
1 parent e4b97d4 commit f08877b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

gdb/ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2010-01-09 Joel Brobecker <[email protected]>
2+
3+
Wrong return convention for arrays (mips-irix).
4+
* mips-tdep.c (mips_n32n64_return_value): Arrays whose size is
5+
128 bits or smaller are returned the same way as structs
6+
and unions of the the same size.
7+
18
2010-01-09 Joel Brobecker <[email protected]>
29

310
Cannot set the PC on mips-irix.

gdb/mips-tdep.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type,
33793379
(and $f2 if necessary). This is a generalization of the Fortran COMPLEX
33803380
case.
33813381
3382-
* Any other struct or union results of at most 128 bits are returned in
3382+
* Any other composite results of at most 128 bits are returned in
33833383
$2 (first 64 bits) and $3 (remainder, if necessary).
33843384
33853385
* Larger composite results are handled by converting the function to a
@@ -3390,8 +3390,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type,
33903390
specific exception to return COMPLEX results in the floating point
33913391
registers.] */
33923392

3393-
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
3394-
|| TYPE_LENGTH (type) > 2 * MIPS64_REGSIZE)
3393+
if (TYPE_LENGTH (type) > 2 * MIPS64_REGSIZE)
33953394
return RETURN_VALUE_STRUCT_CONVENTION;
33963395
else if (TYPE_CODE (type) == TYPE_CODE_FLT
33973396
&& TYPE_LENGTH (type) == 16
@@ -3481,9 +3480,10 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type,
34813480
return RETURN_VALUE_REGISTER_CONVENTION;
34823481
}
34833482
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
3484-
|| TYPE_CODE (type) == TYPE_CODE_UNION)
3483+
|| TYPE_CODE (type) == TYPE_CODE_UNION
3484+
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
34853485
{
3486-
/* A structure or union. Extract the left justified value,
3486+
/* A composite type. Extract the left justified value,
34873487
regardless of the byte order. I.e. DO NOT USE
34883488
mips_xfer_lower. */
34893489
int offset;

0 commit comments

Comments
 (0)