This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: noreturn function attribute and ret asm instruction
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Kristis Makris <kristis dot makris at asu dot edu>
- Cc: Zack Weinberg <zack at codesourcery dot com>, gcc-bugs at gcc dot gnu dot org
- Date: 02 Sep 2003 14:14:26 -0700
- Subject: Re: noreturn function attribute and ret asm instruction
- References: <1061654032.13013.9.camel@syd.monet.net><3F4A71EA.40209@tuliptree.org> <1061880472.16160.134.camel@syd.monet.net> <87wud0sxtj.fsf@egil.codesourcery.com> <1062202145.1918.7.camel@syd.monet.net>
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