This is the mail archive of the gcc-bugs@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: noreturn function attribute and ret asm instruction


On Fri, 2003-08-29 at 17:09, Kristis Makris wrote:
> Would it be acceptable if an extra function attribute was added that
> allowed generation of code without assuming that it is a function (hence
> no "ret" at the end) ?

I don't see any point to this.  The compiler optimizes away the ret if
control flow does not reach the end of the function.  There is no need
for a function attribute for this.

The real problem here is that we have no support for asms that change
flow of control.  Adding a function attribute to suppress the ret does
not fix this.  Letting asms change flow of control would require syntax
and semantic changes.  This would be a major change, and it isn't clear
if it is a good idea.  It might impede optimization so much that it
hurts more than it helps.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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