aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-03-20 11:04:06 +0100
committerMartin Liska <marxin@gcc.gnu.org>2017-03-20 10:04:06 +0000
commit918112d378787a2227f61225098289a14b1ccd22 (patch)
tree8145fcf710b8e6c75af5747f0aba7fc95b991923
parente325aba2a7c44778ab5233dcb4c9bd010837f2b7 (diff)
downloadgcc-918112d378787a2227f61225098289a14b1ccd22.zip
gcc-918112d378787a2227f61225098289a14b1ccd22.tar.gz
gcc-918112d378787a2227f61225098289a14b1ccd22.tar.bz2
Fix *_CST ICEs connected to MPX.
2017-03-20 Martin Liska <mliska@suse.cz> PR target/79769 PR target/79770 * tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST, COMPLEX_CST and VECTOR_CST. 2017-03-20 Martin Liska <mliska@suse.cz> PR target/79769 PR target/79770 * g++.dg/pr79769.C: New test. * gcc.target/i386/mpx/pr79770.c: New test. From-SVN: r246275
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/pr79769.C4
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/pr79770.c19
-rw-r--r--gcc/tree-chkp.c2
5 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70c85b3..57adde8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-03-20 Martin Liska <mliska@suse.cz>
+
+ PR target/79769
+ PR target/79770
+ * tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST,
+ COMPLEX_CST and VECTOR_CST.
+
2017-03-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/78857
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ee5893d..280e5e9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2017-03-20 Martin Liska <mliska@suse.cz>
+
+ PR target/79769
+ PR target/79770
+ * g++.dg/pr79769.C: New test.
+ * gcc.target/i386/mpx/pr79770.c: New test.
+
2017-03-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/78857
diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C
new file mode 100644
index 0000000..c318687
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr79769.C
@@ -0,0 +1,4 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
+
+void a (_Complex) { a (3); }
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79770.c b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c
new file mode 100644
index 0000000..0890fcc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms -Wno-psabi" } */
+
+typedef unsigned U __attribute__ ((vector_size (64)));
+typedef unsigned __int128 V __attribute__ ((vector_size (64)));
+
+static inline V
+bar (U u, U x, V v)
+{
+ v = (V)(U) { 0, ~0 };
+ v[x[0]] <<= u[-63];
+ return v;
+}
+
+V
+foo (U u)
+{
+ return bar (u, (U) {}, (V) {});
+}
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 75caf83..c9c8c23 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3731,6 +3731,8 @@ chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter)
break;
case INTEGER_CST:
+ case COMPLEX_CST:
+ case VECTOR_CST:
if (integer_zerop (ptr_src))
bounds = chkp_get_none_bounds ();
else