On 05/03/2013 01:06 AM, Chung-Ju Wu wrote:
2013/5/3 Chung-Ju Wu <jasonw...@gmail.com>:
Or do you think 'naked' is still useful for some other cases in mips porting?
You can implement it and submit the patch to gcc-patc...@gcc.gnu.org
and I believe the mips maintainers are willing to have review with you. :)
Oops~ I just noticed that the mips maintainer Richard Sandiford
already had some thought about 'naked' attribute.
Refer to:
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00660.html
Best regards,
jasonwucj
I think are many valid uses for the naked attribute.
Here is a simple example:
void foo() __attribute__((naked));
void foo() {
#ifdef DEBUG
C code
#else
Production code in assembly
#endif
}
You may have a very different implementation of several or many
functions when the production mode is present but for purely debugging
logic, some C code could be there.
The main idea is that "naked" is there for someone that needs it.
The caller/callee saved register issue is there. In the absence of
additional function attributes, one would presume that normal abi rules
apply. But this issue is there even if you use assembly code instead of
functions with the naked attribute.