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: "Zack Weinberg" <zack at codesourcery dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: Jim Wilson <wilson at tuliptree dot org>, Kristis Makris <kristis dot makris at asu dot edu>, <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 01 Oct 2003 00:00:22 -0700
- Subject: Re: noreturn function attribute and ret asm instruction
- References: <Pine.BSF.4.44.0309100659540.10663-100000@dair.pair.com>
Hans-Peter Nilsson <hp@bitrange.com> writes:
> On 2 Sep 2003, Jim Wilson wrote:
>> 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.
>
> Though an attribute on the asm would be simpler syntax-wise,
I dunno. Attribute handling is one of the hairiest parts of the
syntax.
> Using an asm to terminate a function is common in kernel-like
> code so the request seems reasonable. (But still not trivial to
> implement, flow-wise.)
It really is trivial at the RTL level - I know, I implemented it.
(You just emit a BARRIER insn right after the ASM_OPERANDS insn.)
It might be harder at the tree level; I'm not sure how noreturn is
being represented in tree-ssa.
zw