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


Thanks for the reply Zack.

> It is currently impossible to do what you want.  (I once proposed that
> clobbering "pc" in an asm() should indicate that control did not pass
> beyond that asm(), but it got shot down.)

Interesting.

> Because attribute noreturn has no effect on code generation of the
> function it is applied to.  Its effect is to allow better optimization
> of the places where that function is called, and that's all it does.

> It begins to sound like you should be writing raw assembly language in
> an .s file.

That's what I ended up doing. Still, conceptually one shouldn't have to
do that. I should be able to generate "a chunk of code" by writing that
in C, with no "ret" at the end as if it where a function. 

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) ? How do gcc developers feel about that ? Is this
something I should add in bugzilla as a feature request or should I
forward it to a different list ?

Thanks,
Kristis



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