diff mbox

Ignore thunks in ThreadSanitizer pass (issue5492055)

Message ID 20111216145428.D7511C2FB0@1024cores.msk.corp.google.com
State New
Headers show

Commit Message

Dmitry Vyukov Dec. 16, 2011, 2:54 p.m. UTC
This is for google-main branch.
Ignore thunks in ThreadSanitizer pass.


--
This patch is available for review at http://codereview.appspot.com/5492055

Comments

Diego Novillo Dec. 16, 2011, 4 p.m. UTC | #1
On 11-12-16 09:54 , Dmitriy Vyukov wrote:
> This is for google-main branch.
> Ignore thunks in ThreadSanitizer pass.
>
> Index: gcc/tree-tsan.c
> ===================================================================
> --- gcc/tree-tsan.c	(revision 182401)
> +++ gcc/tree-tsan.c	(working copy)
> @@ -426,6 +426,11 @@
>         ignore_init = 1;
>       }
>
> +  /* Must be some artificial thunk function.  */
> +  if (cfun->is_thunk
> +      || (DECL_ARTIFICIAL (cfun->decl)&&  DECL_IGNORED_P (cfun->decl)))
> +    return tsan_ignore_func;

Aren't thunks already DECL_ARTIFICIAL && DECL_IGNORED_P?

> +
>     src_name = expand_location (cfun->function_start_locus).file;
>     if (src_name == NULL)
>       src_name = "";
> Index: gcc/ChangeLog.google-main
> ===================================================================
> --- gcc/ChangeLog.google-main	(revision 182401)
> +++ gcc/ChangeLog.google-main	(working copy)
> @@ -1,3 +1,8 @@
> +2011-12-16   Dmitriy Vyukov<dvyukov@google.com>
> +
> +        Ignore thunks in ThreadSanitizer pass.

Not needed.  Just the description of the change to tree-tsan.c is enough.

> +        * gcc/tree-tsan.c (tsan_ignore): Add check for thunks.

File name should be relative to the directory where the ChangeLog file 
is located.  So, 'gcc/' is not needed.


Diego.
diff mbox

Patch

Index: gcc/tree-tsan.c
===================================================================
--- gcc/tree-tsan.c	(revision 182401)
+++ gcc/tree-tsan.c	(working copy)
@@ -426,6 +426,11 @@ 
       ignore_init = 1;
     }
 
+  /* Must be some artificial thunk function.  */
+  if (cfun->is_thunk
+      || (DECL_ARTIFICIAL (cfun->decl) && DECL_IGNORED_P (cfun->decl)))
+    return tsan_ignore_func;
+
   src_name = expand_location (cfun->function_start_locus).file;
   if (src_name == NULL)
     src_name = "";
Index: gcc/ChangeLog.google-main
===================================================================
--- gcc/ChangeLog.google-main	(revision 182401)
+++ gcc/ChangeLog.google-main	(working copy)
@@ -1,3 +1,8 @@ 
+2011-12-16   Dmitriy Vyukov  <dvyukov@google.com>
+
+        Ignore thunks in ThreadSanitizer pass.
+        * gcc/tree-tsan.c (tsan_ignore): Add check for thunks.
+
 2011-12-16  Dehao Chen  <dehao@google.com>
 
 	* ipa-inline-transform.c (dump_inline_decision): New function.