Returning structs in registers - ARM ABI in GCC
Posted
by jbcreix
on Stack Overflow
See other posts from Stack Overflow
or by jbcreix
Published on 2010-05-25T01:46:27Z
Indexed on
2010/05/25
1:51 UTC
Read the original article
Hit count: 351
Hi,
In the ARM ABI documentation I come across functions defined like:
__value_in_regs struct bar foo(int a, int b) {
...
}
but GCC(4.3.3) doesn't allow it and all I could find are references to some RealView compiler. Is there any way of doing this from GCC?
I have tried -freg-struct-return but it doesn't make a difference. As it is an ABI I can't change the original programs, and returning a regular struct mangles the stack.
I would rather not using assembly for this if avoidable as it isn't otherwise necessary.
Thanks!
© Stack Overflow or respective owner