diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-07-18 19:44:48 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-07-18 19:44:48 +0200 |
commit | f2111a364039343a3314736d376990dfa549e650 (patch) | |
tree | 7be3bd72b926527173c5c6ac314506e670a63112 | |
parent | 0b96552628efa86e6e41a279bf7abfd7018d8a93 (diff) | |
download | gcc-f2111a364039343a3314736d376990dfa549e650.zip gcc-f2111a364039343a3314736d376990dfa549e650.tar.gz gcc-f2111a364039343a3314736d376990dfa549e650.tar.bz2 |
re PR c++/71871 (ICE on mixing templates and vector extensions ternary operator)
PR c++/71871
* typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
* g++.dg/ext/vector31.C: New test.
From-SVN: r238439
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/vector31.C | 29 |
4 files changed, 40 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2dfc808..888d4aa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-07-18 Jakub Jelinek <jakub@redhat.com> + + PR c++/71871 + * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change. + 2016-07-15 Jason Merrill <jason@redhat.com> PR c++/71495 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 2f2beea..f9e45ee 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6288,8 +6288,7 @@ build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2, } expr = build_conditional_expr (loc, ifexp, op1, op2, complain); - if (processing_template_decl && expr != error_mark_node - && TREE_CODE (expr) != VEC_COND_EXPR) + if (processing_template_decl && expr != error_mark_node) { tree min = build_min_non_dep (COND_EXPR, expr, orig_ifexp, orig_op1, orig_op2); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3012f8..aa35fb2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-18 Jakub Jelinek <jakub@redhat.com> + + PR c++/71871 + * g++.dg/ext/vector31.C: New test. + 2016-07-18 Uros Bizjak <ubizjak@gmail.com> * gcc.dg/pr70017.c: Do not check for warning on alpha*-*-*. diff --git a/gcc/testsuite/g++.dg/ext/vector31.C b/gcc/testsuite/g++.dg/ext/vector31.C new file mode 100644 index 0000000..a056839 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector31.C @@ -0,0 +1,29 @@ +// PR c++/71871 +// { dg-do compile } + +typedef unsigned int V __attribute__ ((__vector_size__ (32))); + +template <int N> +void +foo (V *x) +{ + V a = *x; + a = a ? a : -1; + *x = a; +} + +template <typename T> +void +bar (T *x) +{ + T a = *x; + a = a ? a : -1; + *x = a; +} + +void +test (V *x, V *y) +{ + foo<0> (x); + bar<V> (y); +} |