On 11-12-16 12:35 , dvyu...@google.com wrote:
On 2011/12/16 16:00:06, Diego Novillo wrote:
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?
I am not sure. On one path assemble_thunk () sets is_thunk and on
another artificial and ignored, but never both. However, when it sets
is_thunk, it calls targetm.asm_out.output_mi_thunk (), so as far as I
understand my pass won't be executed for the function (backend directly
generates specialized asm for it, right?):
Yes, but your pass may still see it.
http://gcc.gnu.org/viewcvs/trunk/gcc/cgraphunit.c?view=markup
So I am removing the is_thunk check.
OK, if you don't need the check, that's fine. You can always add it
back, if needed.
Diego.