This is the mail archive of the gcc-patches@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]

Re: Patch to add new target macro: TARGET_WARN_RETURN_TYPE



  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


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