diff mbox

[1/5] Fix *_CST ICEs connected to MPX.

Message ID b457466dd9276b8cb5f1980160b7e3d519a9d240.1488881229.git.mliska@suse.cz
State New
Headers show

Commit Message

Martin Liška March 2, 2017, 4:59 p.m. UTC
gcc/ChangeLog:

2017-03-06  Martin Liska  <mliska@suse.cz>

	PR target/79763
	PR target/79769
	PR target/79770
	* tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST,
	COMPLEX_CST and VECTOR_CST.

gcc/testsuite/ChangeLog:

2017-03-06  Martin Liska  <mliska@suse.cz>

	PR target/79763
	PR target/79769
	PR target/79770
	* g++.dg/pr79769.C: New test.
	* gcc.target/i386/mpx/pr79763.c: New test.
	* gcc.target/i386/mpx/pr79770.c: New test.
---
 gcc/testsuite/g++.dg/pr79769.C              |  4 ++++
 gcc/testsuite/gcc.target/i386/mpx/pr79763.c |  6 ++++++
 gcc/testsuite/gcc.target/i386/mpx/pr79770.c | 20 ++++++++++++++++++++
 gcc/tree-chkp.c                             |  3 +++
 4 files changed, 33 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/pr79769.C
 create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79763.c
 create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79770.c

Comments

Rainer Orth March 7, 2017, 10:17 a.m. UTC | #1
marxin <mliska@suse.cz> writes:

> diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C
> new file mode 100644
> index 00000000000..f9223db1b2d
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/pr79769.C
> @@ -0,0 +1,4 @@
> +/* { dg-do compile { target { ! x32 } } } */
> +/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */

... and again: make this x86-only.

	Rainer
diff mbox

Patch

diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C
new file mode 100644
index 00000000000..f9223db1b2d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr79769.C
@@ -0,0 +1,4 @@ 
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
+
+void a (_Complex) { a (3); }
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79763.c b/gcc/testsuite/gcc.target/i386/mpx/pr79763.c
new file mode 100644
index 00000000000..59c2dececc2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79763.c
@@ -0,0 +1,6 @@ 
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
+
+int q_sk_num(void *a);
+typedef int (*fptr)(double);
+void a() { ((fptr)q_sk_num)(0); } /* { dg-warning "function called through a non-compatible type" } */
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 00000000000..ede9abbbb8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c
@@ -0,0 +1,20 @@ 
+/* { dg-do compile { target lp64 } } */
+/* { dg-do compile { target { ! x32 } } } */
+/* { 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 02ae2d2d2c7..3d497f51ed8 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3665,6 +3665,9 @@  chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter)
       break;
 
     case INTEGER_CST:
+    case REAL_CST:
+    case COMPLEX_CST:
+    case VECTOR_CST:
       if (integer_zerop (ptr_src))
 	bounds = chkp_get_none_bounds ();
       else