[C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363)

Richard Biener richard.guenther@gmail.com
Tue Apr 11 07:25:00 GMT 2017


On Mon, Apr 10, 2017 at 10:34 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> The following testcase emits vec_cond_expr not supported by dump_expr
> inside of error message.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

Ok.

Richard.

> 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
>
>         PR c++/80363
>         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
>
>         * g++.dg/ext/pr80363.C: New test.
>
> --- gcc/cp/error.c.jj   2017-02-09 23:01:49.000000000 +0100
> +++ gcc/cp/error.c      2017-04-08 09:30:54.417681285 +0200
> @@ -2080,6 +2080,7 @@ dump_expr (cxx_pretty_printer *pp, tree
>        break;
>
>      case COND_EXPR:
> +    case VEC_COND_EXPR:
>        pp_cxx_left_paren (pp);
>        dump_expr (pp, TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
>        pp_string (pp, " ? ");
> --- gcc/testsuite/g++.dg/ext/pr80363.C.jj       2017-04-08 09:33:59.134213656 +0200
> +++ gcc/testsuite/g++.dg/ext/pr80363.C  2017-04-08 09:33:20.000000000 +0200
> @@ -0,0 +1,12 @@
> +// PR c++/80363
> +// { dg-do compile }
> +
> +typedef int V __attribute__((vector_size (16)));
> +
> +int
> +foo (V *a, V *b)
> +{
> +  if (*a < *b) // { dg-error "could not convert\[^#]*from" }
> +    return 1;
> +  return 0;
> +}
>
>         Jakub



More information about the Gcc-patches mailing list