Fix *_CST ICEs connected to MPX.
authorMartin Liska <mliska@suse.cz>
Mon, 20 Mar 2017 10:04:06 +0000 (11:04 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 20 Mar 2017 10:04:06 +0000 (10:04 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr79769.C [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/mpx/pr79770.c [new file with mode: 0644]
gcc/tree-chkp.c

index 70c85b3d094615c99300350cdf7d024c8e602be6..57adde8f388b890d323028ec23a29958b6446f22 100644 (file)
@@ -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
index ee5893d305a6ec2b5a0319ec49fae519abab9d81..280e5e949c368fb2ab11b43719778b948470ade9 100644 (file)
@@ -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 (file)
index 0000000..c318687
--- /dev/null
@@ -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 (file)
index 0000000..0890fcc
--- /dev/null
@@ -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) {});
+}
index 75caf83a9829e23483bcc037f3a00913f223e1ce..c9c8c233eb9a02d5eb2349b8928b0e4c8ccd6b2a 100644 (file)
@@ -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