Patch to add new target macro: TARGET_WARN_RETURN_TYPE
Jeffrey A Law
law@cygnus.com
Wed Mar 31 18:59:00 GMT 1999
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.
jeff
More information about the Gcc-patches
mailing list