The issue is that GDB doesn't support invocation of functions that return structure. According to ABI, in this case caller should allocate space for the structure and pass its address in R0 register, shifting the rest of arguments in registers. Currently GDB simply doesn't handle this case.
I don't have a test case, but I see this in GDB code.
This is similar to GDB gets invalid return value when calling function that returns "double complex".
The issue is that GDB doesn't support invocation of functions that return structure. According to ABI, in this case caller should allocate space for the structure and pass its address in R0 register, shifting the rest of arguments in registers. Currently GDB simply doesn't handle this case.
I don't have a test case, but I see this in GDB code.
kolesov