summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-27 07:31:19 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-27 07:31:19 +0000
commitd7a0bf41601ea933d5732c9604326678a80cfd66 (patch)
tree80d6836402f6ec2f8e4a436a1532aca5a2c79b7a
parent31968b78d284fd5b27b088bad7bd5b6c8a2c8899 (diff)
downloadgcc-d7a0bf41601ea933d5732c9604326678a80cfd66.tar.gz
Backport r249728
2017-07-27 Martin Liska <mliska@suse.cz> Backport from mainline 2017-06-28 Martin Liska <mliska@suse.cz> PR sanitizer/81224 * asan.c (instrument_derefs): Bail out inner references that are hard register variables. 2017-07-27 Martin Liska <mliska@suse.cz> Backport from mainline 2017-06-28 Martin Liska <mliska@suse.cz> PR sanitizer/81224 * gcc.dg/asan/pr81224.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250603 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/asan.c3
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr81224.c11
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e5dfd8badba..f57ae1eac9a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-27 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-06-28 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/81224
+ * asan.c (instrument_derefs): Bail out inner references
+ that are hard register variables.
+
2017-07-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
Backport from mainline
diff --git a/gcc/asan.c b/gcc/asan.c
index bf564a46b28..31bc060eaf1 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -1877,6 +1877,9 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t,
|| bitsize != size_in_bytes * BITS_PER_UNIT)
return;
+ if (VAR_P (inner) && DECL_HARD_REGISTER (inner))
+ return;
+
if (VAR_P (inner)
&& offset == NULL_TREE
&& bitpos >= 0
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1ed2e14b15e..15dd9a66284 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2017-07-27 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-06-28 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/81224
+ * gcc.dg/asan/pr81224.c: New test.
+
2017-07-26 Wilco Dijkstra <wdijkstr@arm.com>
PR target/79041
diff --git a/gcc/testsuite/gcc.dg/asan/pr81224.c b/gcc/testsuite/gcc.dg/asan/pr81224.c
new file mode 100644
index 00000000000..def5cb69aec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asan/pr81224.c
@@ -0,0 +1,11 @@
+/* PR sanitizer/80659 */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-msse2" } */
+
+int a;
+int
+b ()
+{
+ register __attribute__ ((__vector_size__ (4 * sizeof (int)))) int c asm("xmm0");
+ return c[a];
+}