diff mbox

Backport to GCC7

Message ID 8beaae55-ccb7-27de-42ff-84816d32d061@suse.cz
State New
Headers show

Commit Message

Martin Liška July 26, 2017, 1:52 p.m. UTC
Hi.

I'm going to install following 3 revision in order to fix GCC.x branch:

0001-Backport-r249728.patch
0002-Backport-r249833.patch
0003-Backport-r250561.patch

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Martin
diff mbox

Patch

From dd9a8255aefdc139f688110c8dc021e198b33ddb Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 28 Jun 2017 07:59:23 +0000
Subject: [PATCH 1/3] Backport r249728

gcc/ChangeLog:

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

	PR sanitizer/81224
	* asan.c (instrument_derefs): Bail out inner references
	that are hard register variables.

gcc/testsuite/ChangeLog:

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

	PR sanitizer/81224
	* gcc.dg/asan/pr81224.c: New test.
---
 gcc/asan.c                          |  3 +++
 gcc/testsuite/gcc.dg/asan/pr81224.c | 11 +++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/asan/pr81224.c

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/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];
+}
-- 
2.13.3