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 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,
and without optimization impediments when it's not used, no?

 __asm__ ("xyzzy") __attribute__ ((__noreturn__));

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.)

brgds, H-P


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