diff mbox

Add pretty printer for ASAN_MARK and add a helper fn

Message ID 57f73f35-0e77-de7f-8936-88429f72a7b2@suse.cz
State New
Headers show

Commit Message

Martin Liška Dec. 13, 2016, 12:14 p.m. UTC
On 12/13/2016 10:05 AM, Jakub Jelinek wrote:
> Ok.  But the builtins should be renamed too (incrementally),

> BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory",

> should really be BUILT_IN_ASAN_POISON_STACK_MEMORY etc.

> 

> 	Jakub


This is follow-up that I've just tested and reg-bootstrapped.

Ready for trunk?
Thanks,
Martin

Comments

Jakub Jelinek Dec. 13, 2016, 12:29 p.m. UTC | #1
On Tue, Dec 13, 2016 at 01:14:00PM +0100, Martin Liška wrote:
> On 12/13/2016 10:05 AM, Jakub Jelinek wrote:

> > Ok.  But the builtins should be renamed too (incrementally),

> > BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory",

> > should really be BUILT_IN_ASAN_POISON_STACK_MEMORY etc.

> > 

> > 	Jakub

> 

> This is follow-up that I've just tested and reg-bootstrapped.

> 

> Ready for trunk?

> Thanks,

> Martin


> >From 8fd18d8fde8f2e3a10812698c37d601c2a52aee7 Mon Sep 17 00:00:00 2001

> From: marxin <mliska@suse.cz>

> Date: Tue, 13 Dec 2016 10:19:48 +0100

> Subject: [PATCH 1/2] Rename BUILT_IN_ASAN_CLOBBER_N to

>  BUILT_IN_ASAN_POISON_STACK_MEMORY.

> 

> gcc/ChangeLog:

> 

> 2016-12-13  Martin Liska  <mliska@suse.cz>

> 

> 	* asan.c (asan_expand_mark_ifn): Use renamed

> 	BUILT_IN_ASAN_{UN}CLOBBER_N to BUILT_IN_ASAN_{UN}POISON_STACK_MEMORY.

> 	* sanitizer.def: Likewise.


Ok, thanks.

	Jakub
diff mbox

Patch

From 8fd18d8fde8f2e3a10812698c37d601c2a52aee7 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 13 Dec 2016 10:19:48 +0100
Subject: [PATCH 1/2] Rename BUILT_IN_ASAN_CLOBBER_N to
 BUILT_IN_ASAN_POISON_STACK_MEMORY.

gcc/ChangeLog:

2016-12-13  Martin Liska  <mliska@suse.cz>

	* asan.c (asan_expand_mark_ifn): Use renamed
	BUILT_IN_ASAN_{UN}CLOBBER_N to BUILT_IN_ASAN_{UN}POISON_STACK_MEMORY.
	* sanitizer.def: Likewise.
---
 gcc/asan.c        | 5 +++--
 gcc/sanitizer.def | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/asan.c b/gcc/asan.c
index e297784270d..53acff0a2fb 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2838,8 +2838,9 @@  asan_expand_mark_ifn (gimple_stmt_iterator *iter)
       gsi_insert_before (iter, g, GSI_SAME_STMT);
       tree sz_arg = gimple_assign_lhs (g);
 
-      tree fun = builtin_decl_implicit (is_poison ? BUILT_IN_ASAN_CLOBBER_N
-					: BUILT_IN_ASAN_UNCLOBBER_N);
+      tree fun
+	= builtin_decl_implicit (is_poison ? BUILT_IN_ASAN_POISON_STACK_MEMORY
+				 : BUILT_IN_ASAN_UNPOISON_STACK_MEMORY);
       g = gimple_build_call (fun, 2, base_addr, sz_arg);
       gimple_set_location (g, loc);
       gsi_insert_after (iter, g, GSI_NEW_STMT);
diff --git a/gcc/sanitizer.def b/gcc/sanitizer.def
index 3db08a7b702..43e46f90e9c 100644
--- a/gcc/sanitizer.def
+++ b/gcc/sanitizer.def
@@ -165,9 +165,11 @@  DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT,
 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT,
 		      "__asan_after_dynamic_init",
 		      BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
-DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory",
+DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_POISON_STACK_MEMORY,
+		      "__asan_poison_stack_memory",
 		      BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
-DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNCLOBBER_N, "__asan_unpoison_stack_memory",
+DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNPOISON_STACK_MEMORY,
+		      "__asan_unpoison_stack_memory",
 		      BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
 
 /* Thread Sanitizer */
-- 
2.11.0