noreturn function attribute and ret asm instruction

Hans-Peter Nilsson hp@bitrange.com
Wed Oct 1 07:26:00 GMT 2003


On Wed, 1 Oct 2003, Zack Weinberg wrote:
> Hans-Peter Nilsson <hp@bitrange.com> writes:
> > Though an attribute on the asm would be simpler syntax-wise,
>
> I dunno.  Attribute handling is one of the hairiest parts of the
> syntax.

For variables and functions, but surely not for statement asms?
For the "stmt" rule, there's nothing between ')' and ';', so we
can't intrude on previous 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.)

Ah, right you are.  Cool.  Good news.  Maybe this would be a
nice beginner's project?  Perhaps I can volunteer someone to
actually do it.

> It might be harder at the tree level; I'm not sure how noreturn is
> being represented in tree-ssa.

Bah! :-)

(Seriously, this will have to be considered before such a change.)

brgds, H-P



More information about the Gcc-bugs mailing list