This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]