public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: GCC 9 backports
Date: Fri, 24 May 2019 07:43:00 -0000	[thread overview]
Message-ID: <de4746dd-889f-5fe1-263d-ea760d1cad8d@suse.cz> (raw)
In-Reply-To: <39bf5f1b-373f-6a27-c4ba-0ce3791bd395@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 58 bytes --]

Hi.

I'm sending one more patch that I've tested.

Martin

[-- Attachment #2: 0001-Backport-r271548.patch --]
[-- Type: text/x-patch, Size: 1572 bytes --]

From 279c24c2af259c8f3e7668056fcb707bc3c03ad2 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 23 May 2019 10:12:01 +0000
Subject: [PATCH] Backport r271548

gcc/ChangeLog:

2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* gimplify.c (gimplify_target_expr): Skip TREE_STATIC target
	expression similarly to gimplify_decl_expr.

gcc/testsuite/ChangeLog:

2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* g++.dg/asan/pr90570.C: New test.
---
 gcc/gimplify.c                      |  1 +
 gcc/testsuite/g++.dg/asan/pr90570.C | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/asan/pr90570.C

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index e59f38261c3..72f1cc38ff7 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6662,6 +6662,7 @@ gimplify_target_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
 	    }
 	  if (asan_poisoned_variables
 	      && DECL_ALIGN (temp) <= MAX_SUPPORTED_STACK_ALIGNMENT
+	      && !TREE_STATIC (temp)
 	      && dbg_cnt (asan_use_after_scope)
 	      && !gimplify_omp_ctxp)
 	    {
diff --git a/gcc/testsuite/g++.dg/asan/pr90570.C b/gcc/testsuite/g++.dg/asan/pr90570.C
new file mode 100644
index 00000000000..c2366905516
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/pr90570.C
@@ -0,0 +1,18 @@
+/* PR sanitizer/90570 */
+/* { dg-do run } */
+
+#include <vector>
+
+struct stru
+{
+  std::vector<int> v{1,2,3,4};
+  int i{5};
+};
+
+int main()
+{
+  stru s1;
+  stru s2;
+
+  return 0;
+}
-- 
2.21.0


  reply	other threads:[~2019-05-24  7:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  8:45 Martin Liška
2019-05-14  8:47 ` Martin Liška
2019-05-24  7:43   ` Martin Liška [this message]
2019-07-04  9:23     ` Martin Liška
2019-07-22  9:36       ` Martin Liška
2019-08-23 11:56         ` Martin Liška
2019-09-02  8:56           ` Martin Liška
2019-10-23 12:12             ` Martin Liška
2020-02-28 17:51               ` Martin Liška
2020-03-10 10:09                 ` Martin Liška
2020-04-03 10:32                   ` Martin Liška
2020-04-20  9:25                     ` Martin Liška
2020-10-02 10:05                       ` Martin Liška
2020-10-02 11:15                         ` Martin Liška
2020-10-15  9:07                           ` Martin Liška
2020-10-16  8:51                           ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de4746dd-889f-5fe1-263d-ea760d1cad8d@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).