From 8e40a96f47019d311bbdd41abf3a2d5ffdac1b89 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 22 Mar 2017 13:31:53 +0100 Subject: [PATCH] Backport r246275 2017-03-22 Martin Liska Backport from mainline 2017-03-20 Martin Liska PR target/79769 PR target/79770 * tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST, COMPLEX_CST and VECTOR_CST. 2017-03-22 Martin Liska Backport from mainline 2017-03-20 Martin Liska PR target/79769 PR target/79770 * g++.dg/pr79769.C: New test. * gcc.target/i386/mpx/pr79770.c: New test. From-SVN: r246376 --- gcc/ChangeLog | 10 ++++++++++ gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/g++.dg/pr79769.C | 4 ++++ gcc/testsuite/gcc.target/i386/mpx/pr79770.c | 19 +++++++++++++++++++ gcc/tree-chkp.c | 2 ++ 5 files changed, 45 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr79769.C create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79770.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b87fe8a7e459..f47095e9bfa1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-03-22 Martin Liska + + Backport from mainline + 2017-03-20 Martin Liska + + PR target/79769 + PR target/79770 + * tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST, + COMPLEX_CST and VECTOR_CST. + 2017-03-22 Martin Liska Backport from mainline diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3dd132f35a85..416cddc5a575 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2017-03-22 Martin Liska + + Backport from mainline + 2017-03-20 Martin Liska + + PR target/79769 + PR target/79770 + * g++.dg/pr79769.C: New test. + * gcc.target/i386/mpx/pr79770.c: New test. + 2017-03-22 Martin Liska Backport from mainline diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C new file mode 100644 index 000000000000..c3186877f60e --- /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 000000000000..0890fcc7bf14 --- /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 049bafae4e2d..39a9f62df536 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -3618,6 +3618,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 -- 2.47.2