This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Apr 2017 22:34:56 +0200
- Subject: [C++ PATCH] Fix ICE when dumping VEC_COND_EXPR (PR c++/80363)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D4FDF7E9D9
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D4FDF7E9D9
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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