diff options
author | Ilya Enkovich <enkovich.gnu@gmail.com> | 2016-03-22 12:31:12 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2016-03-22 12:31:12 +0000 |
commit | 6cedf92249d5a183471723129c3d436fde95b0a0 (patch) | |
tree | 25ecd0ecfaf535603f0e23b2a375dbf54294138c /gcc | |
parent | 7d36fe985ca74f7f0d26be60d0bd1bf9d3b2c35a (diff) | |
download | gcc-6cedf92249d5a183471723129c3d436fde95b0a0.zip gcc-6cedf92249d5a183471723129c3d436fde95b0a0.tar.gz gcc-6cedf92249d5a183471723129c3d436fde95b0a0.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/pr70290.C | 18 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index adf0dda..6557f90 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> PR c++/70096 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 65739e4..ed23490 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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))) { + tree arg1_type = TREE_TYPE (arg1); + /* If arg1 is another cond_expr choosing between -1 and 0, then we can use its comparison. It may help to avoid additional comparison, produce more accurate diagnostics @@ -4653,7 +4655,6 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, || error_operand_p (arg3)) return error_mark_node; - tree arg1_type = TREE_TYPE (arg1); arg2_type = TREE_TYPE (arg2); arg3_type = TREE_TYPE (arg3); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ecfbd0..49f9e08 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +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> PR target/70325 diff --git a/gcc/testsuite/g++.dg/ext/pr70290.C b/gcc/testsuite/g++.dg/ext/pr70290.C new file mode 100644 index 0000000..6de13ce --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr70290.C @@ -0,0 +1,18 @@ +/* { 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; +} |