[PATCH] Add new built-in: __builtin_unreachable()

Ralf Wildenhues Ralf.Wildenhues@gmx.de
Mon Jun 8 19:51:00 GMT 2009


* David Daney wrote on Mon, Jun 08, 2009 at 08:34:31PM CEST:
> --- gcc/doc/extend.texi	(revision 147888)
> +++ gcc/doc/extend.texi	(working copy)
> @@ -6813,6 +6813,43 @@ intentionally executing an illegal instr
>  you should not rely on any particular implementation.
>  @end deftypefn
>  
> +@deftypefn {Built-in Function} void __builtin_unreachable (void)
> +If control flow reaches the point of the @code{__builtin_unreachable ();},
> +the program is undefined.  It is useful in situations where the
> +compiler cannot deduce the unreachability of the code.  One such case
> +is immediately following an @code{asm} statement that either never
> +exits or transfers control elsewhere never returning.

FWIW, I keep misreading this sentence in a way that the asm statement
never calls exit(3), and then this would only make sense to me if the
asm statement always exits, not never.

Cheers,
Ralf



More information about the Gcc-patches mailing list