public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363)
@ 2017-04-10 20:35 Jakub Jelinek
  2017-04-11  7:25 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2017-04-10 20:35 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc-patches

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?

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363)
  2017-04-10 20:35 [C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363) Jakub Jelinek
@ 2017-04-11  7:25 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-04-11  7:25 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Jason Merrill, GCC Patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-11  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 20:35 [C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363) Jakub Jelinek
2017-04-11  7:25 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).