This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: return statement in a function with the naked attribute


On 05/02/2013 09:06 PM, Ian Lance Taylor wrote:
On Thu, May 2, 2013 at 8:59 PM, reed kotler <rkotler@mips.com> wrote:
On 05/02/2013 07:54 PM, Ian Lance Taylor wrote:
On Thu, May 2, 2013 at 3:44 PM, reed kotler <rkotler@mips.com> wrote:
Should a return statement be emitted in a function that has the naked
attribute.
I vote yes.
why would you want that? naked functions are just inline asm.
you can generate your own return statement.

I meant to end that statement with a question mark. :)

There seems to be some confusion here and apparently disagreement between
various
gcc compilers.
Which targets do not generate a return instruction for a naked function?
I don't think that any that support naked functions emit a return
instruction.
Well, if they all agree, then clearly that is what we should do.  But
you said there was some confusion.  To what were you referring?

Ian
There was some confusion on the llvm list because some tests were run on targets that did not support the naked attribute.

I think we are thinking now that the return statement should not be emitted unless explicitly requested.

It's not totally clear in the gcc manual so that is why I was asking.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]