From 48d3af1259c6365615027708f259f04c8ac292fc Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 14 Oct 2014 15:40:36 +0200 Subject: [PATCH] typeck.c (cp_build_unary_op): Accept float vectors. 2014-10-14 Marc Glisse gcc/cp/ * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors. gcc/testsuite/ * g++.dg/ext/vector9.C: Test ! with float vectors. From-SVN: r216201 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/typeck.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/ext/vector9.C | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c94916c89f5..50132ff1acb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2014-10-14 Marc Glisse + + * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors. + 2014-10-13 H.J. Lu * mangle.c (mangle_conv_op_name_for_type): Cast elements to diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index b4e6824796b..5b4f5332a34 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5723,7 +5723,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, break; case TRUTH_NOT_EXPR: - if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg))) + if (VECTOR_TYPE_P (TREE_TYPE (arg))) return cp_build_binary_op (input_location, EQ_EXPR, arg, build_zero_cst (TREE_TYPE (arg)), complain); arg = perform_implicit_conversion (boolean_type_node, arg, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59aca0d68c1..2f08ffe1c11 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-10-14 Marc Glisse + + * g++.dg/ext/vector9.C: Test ! with float vectors. + 2014-10-14 Richard Biener PR tree-optimization/63512 diff --git a/gcc/testsuite/g++.dg/ext/vector9.C b/gcc/testsuite/g++.dg/ext/vector9.C index 42d150dd345..b1216c2b37d 100644 --- a/gcc/testsuite/g++.dg/ext/vector9.C +++ b/gcc/testsuite/g++.dg/ext/vector9.C @@ -7,4 +7,5 @@ void foo() { v4f v; !(v4i)v; + !v; } -- 2.30.2