From: Jakub Jelinek Date: Mon, 18 Jul 2016 17:44:48 +0000 (+0200) Subject: re PR c++/71871 (ICE on mixing templates and vector extensions ternary operator) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2111a364039343a3314736d376990dfa549e650;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2dfc8080be8..888d4aa894c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-07-18 Jakub Jelinek + + PR c++/71871 + * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change. + 2016-07-15 Jason Merrill PR c++/71495 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 2f2beead74c..f9e45ee125f 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 d3012f8e827..aa35fb2033b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-18 Jakub Jelinek + + PR c++/71871 + * g++.dg/ext/vector31.C: New test. + 2016-07-18 Uros Bizjak * 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 00000000000..a0568394315 --- /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 +void +foo (V *x) +{ + V a = *x; + a = a ? a : -1; + *x = a; +} + +template +void +bar (T *x) +{ + T a = *x; + a = a ? a : -1; + *x = a; +} + +void +test (V *x, V *y) +{ + foo<0> (x); + bar (y); +}