noreturn function attribute and ret asm instruction

Joseph S. Myers jsm@polyomino.org.uk
Tue Sep 2 22:02:00 GMT 2003


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



More information about the Gcc-bugs mailing list