On Tue, Jan 28, 2014 at 6:36 AM, Thomas Schwinge
<tho...@codesourcery.com> wrote:
> Avoid "'dc' may be uninitialized" warning.
>
>         libiberty/
>         * cp-demangle.c (d_demangle_callback): Put __builtin_unreachable
>         in place, to help the compiler.
>
> --- libiberty/cp-demangle.c
> +++ libiberty/cp-demangle.c
> @@ -5824,6 +5824,8 @@ d_demangle_callback (const char *mangled, int options,
>                           NULL);
>         d_advance (&di, strlen (d_str (&di)));
>         break;
> +      default:
> +       __builtin_unreachable ();

You can't call __builtin_unreachable in this code, because libiberty
in stage 1 will be compiled by the host compiler and
__builtin_unreachable is specific to GCC.

This patch is OK if you call abort instead of __builtin_unreachable.

Thanks.

Ian

Reply via email to