===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.354
@@ -9061,6 +9061,12 @@ arm_return_value (struct gdbarch *gdbarc
return RETURN_VALUE_STRUCT_CONVENTION;
}
+ /* AAPCS returns complex types longer than a register in memory. */
+ if (tdep->arm_abi != ARM_ABI_APCS
+ && TYPE_CODE (valtype) == TYPE_CODE_COMPLEX
+ && TYPE_LENGTH (valtype) > INT_REGISTER_SIZE)
+ return RETURN_VALUE_STRUCT_CONVENTION;
+
if (writebuf)
arm_store_return_value (valtype, regcache, writebuf);
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
retrieving revision 1.46
@@ -248,19 +248,16 @@ proc do_function_calls {} {
if [support_complex_tests] {
setup_kfail_for_target gdb/12796 "x86_64-*-*"
- setup_kfail_for_target gdb/12797 "arm*-*-*"
gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3 \\* I" \
"call inferior func with struct - returns float _Complex"
setup_kfail_for_target gdb/12783 "i?86-*-*"
setup_kfail_for_target gdb/12796 "x86_64-*-*"
- setup_kfail_for_target gdb/12797 "arm*-*-*"
gdb_test "p t_structs_dc(struct_val1)" ".*= 4 \\+ 4 \\* I" \
"call inferior func with struct - returns double _Complex"
setup_kfail_for_target gdb/12783 "i?86-*-*"
setup_kfail_for_target gdb/12796 "x86_64-*-*"
- setup_kfail_for_target gdb/12797 "arm*-*-*"
gdb_test "p t_structs_ldc(struct_val1)" "= 5 \\+ 5 \\* I" \
"call inferior func with struct - returns long double _Complex"
}