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: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Zack Weinberg <zack at codesourcery 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: Tue, 2 Sep 2003 23:02:15 +0100 (BST)
- 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> <1062537266.1047.7.camel@leaf.tuliptree.org><87isoarh0m.fsf@egil.codesourcery.com>
On Tue, 2 Sep 2003, Zack Weinberg wrote:
> The objection I remember is "use __builtin_trap()", but that is
> not flexible enough to replace the above, nor is it universally
> implemented.
How about a more general __builtin_unreached(), telling the compiler to
assume (without generating any trap for safety, so potentially allowing
more optimization) that a particular point in the code (e.g., the end of a
function here) can never be reached?
--
Joseph S. Myers
jsm@polyomino.org.uk