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 8 backports
Date: Fri, 24 May 2019 07:42:00 -0000	[thread overview]
Message-ID: <612a3465-4795-499e-54f2-4abecedaaf88@suse.cz> (raw)
In-Reply-To: <919dd35b-f751-0481-3d67-6f7fb47d3afa@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 3a0412967ede61515ce59230580558f5531e63f6 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 bdb15a8fd14..2971293a720 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6653,6 +6653,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:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23  8:43 Martin Liška
2018-08-16 10:14 ` Martin Liška
2018-09-18  9:37   ` Martin Liška
2018-09-25  6:52     ` Martin Liška
2018-10-03 10:09       ` Martin Liška
2018-11-20 10:58         ` Martin Liška
2018-12-27 14:59           ` Martin Liška
2018-12-28 11:46             ` Sudakshina Das
2019-01-02 11:46               ` Martin Liška
2019-01-02 11:50                 ` Jan Hubicka
2019-01-03  8:46                   ` Martin Liška
2019-02-14 11:23           ` Martin Liška
2019-02-14 13:57             ` Martin Liška
2019-03-11  9:39               ` Martin Liška
2019-03-15  8:39                 ` Martin Liška
2019-03-28  8:53                   ` Martin Liška
2019-05-24  7:42                     ` Martin Liška [this message]
2019-07-04 10:17                       ` Martin Liška
2020-01-15 10:15 ` Martin Liška
2020-03-02  9:33 ` Martin Liška
2020-03-29 17:17 ` Martin Liška
2020-04-03 10:32   ` Martin Liška
2019-05-06 14:00 Martin Liška
2019-05-14  9:11 ` Martin Liška
2019-07-22  9:36   ` Martin Liška
2019-05-07 16:17 Marek Polacek

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=612a3465-4795-499e-54f2-4abecedaaf88@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).