This is the mail archive of the
mailing list for the GCC project.
Re: Patch to add new target macro: TARGET_WARN_RETURN_TYPE
- To: Nick Clifton <nickc at cygnus dot com>
- Subject: Re: Patch to add new target macro: TARGET_WARN_RETURN_TYPE
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 22 Mar 1999 21:19:27 -0700
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199903222226.OAA26548@elmo.cygnus.com>you write:
> Hi Craig, Hi Jeff,
> I think I may have to abandon this patch. I have been trying to
> think of an alternative way of solving the problem, other than
> creating the NAKED_FUNCTION_P macro. The attribute idea:
> asm (<return from function call>) __attribute__((return));
> or the type qualifier idea:
> asm return (<return from function call>);
> both require modifications to GCC's parser and will probably be
> rejected as even worse forms of creeping featurism. (Besides asms are
> not supposed to alter the flow of control, so adding support for asms
> that do this is probably not going to be acceptable).
> It looks like I will have to go back to my horrible hack that solves
> the problem in the back end. Oh well.
If an asm sets the return value for a function, then it must be
using a register class with a size of one register (how else can you
guarantee what register you get).
Since you know what register it will get, you can determine if that
register is a function return value via FUNCTION_VALUE_REGNO_P.
Seems to me we don't need an attribute to do this stuff.