noreturn function attribute and ret asm instruction
Jim Wilson
wilson@tuliptree.org
Tue Sep 2 21:17:00 GMT 2003
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
More information about the Gcc-bugs
mailing list