Commit 6cedf922 by Ilya Enkovich Committed by Ilya Enkovich

re PR target/70290 (-mavx512vl breaks parsing of C++ vector condition)

gcc/cp/

	PR target/70290
	* call.c (build_conditional_expr_1): Always use original
	condition type for vector type checks and build.

gcc/testsuite/

	PR target/70290
	* g++.dg/ext/pr70290.C: New test.

From-SVN: r234399
parent 7d36fe98
2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
* call.c (build_conditional_expr_1): Always use original
condition type for vector type checks and build.
2016-03-22 Patrick Palka <ppalka@gcc.gnu.org> 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70096 PR c++/70096
......
...@@ -4634,6 +4634,8 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, ...@@ -4634,6 +4634,8 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1))) if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1)))
{ {
tree arg1_type = TREE_TYPE (arg1);
/* If arg1 is another cond_expr choosing between -1 and 0, /* If arg1 is another cond_expr choosing between -1 and 0,
then we can use its comparison. It may help to avoid then we can use its comparison. It may help to avoid
additional comparison, produce more accurate diagnostics additional comparison, produce more accurate diagnostics
...@@ -4653,7 +4655,6 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, ...@@ -4653,7 +4655,6 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
|| error_operand_p (arg3)) || error_operand_p (arg3))
return error_mark_node; return error_mark_node;
tree arg1_type = TREE_TYPE (arg1);
arg2_type = TREE_TYPE (arg2); arg2_type = TREE_TYPE (arg2);
arg3_type = TREE_TYPE (arg3); arg3_type = TREE_TYPE (arg3);
......
2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
* g++.dg/ext/pr70290.C: New test.
2016-03-22 Kirill Yukhin <kirill.yukhin@intel.com> 2016-03-22 Kirill Yukhin <kirill.yukhin@intel.com>
PR target/70325 PR target/70325
......
/* { dg-do compile } */
/* { dg-additional-options "-mavx512vl" { target { i?86-*-* x86_64-*-* } } } */
typedef int vec __attribute__((vector_size(32)));
vec
test1 (vec x,vec y)
{
return (x < y) ? 1 : 0;
}
vec
test2 (vec x,vec y)
{
vec zero = { };
vec one = zero + 1;
return (x < y) ? one : zero;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment