This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [Annotalysis] Bugfix for spurious thread safety warnings with shared mutexes
- From: Ollie Wild <aaw at google dot com>
- To: Delesley Hutchins <delesley at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 11 Oct 2011 16:34:16 -0500
- Subject: Re: [PATCH] [Annotalysis] Bugfix for spurious thread safety warnings with shared mutexes
- References: <CAF6KqwV2EFpbFZ8STUJK7AW0xXj=myg74EsUdxTCPX+f69a_kw@mail.gmail.com>
On Mon, Oct 10, 2011 at 3:37 PM, Delesley Hutchins <delesley@google.com> wrote:
>
> --- gcc/tree-threadsafe-analyze.c ? ? ? (revision 179771)
> +++ gcc/tree-threadsafe-analyze.c ? ? ? (working copy)
> @@ -1830,14 +1830,27 @@ remove_lock_from_lockset (tree lockable, struct po
This feels like a bug in lock_set_contains(), not
remove_lock_from_lockset(). I'd modify lock_set_contains() as
follows:
1) During the universal lock conditional, remove the return statement.
Instead, set default_lock = lock (where default_lock is a new
variable initialized to NULL_TREE).
2) Anywhere NULL_TREE is returned later, replace it with default_lock.
Ollie