This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-mem-model] use alignment when available to determine lock-free ness
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 02 Nov 2011 09:28:14 -0700
- Subject: Re: [cxx-mem-model] use alignment when available to determine lock-free ness
- References: <4EB15AE5.7060202@redhat.com>
On 11/02/2011 07:59 AM, Andrew MacLeod wrote:
> + /* Parameters at this point are usually cast to void *, so check for that
> + and look past the cast. */
> + if (TREE_CODE (arg1) == NOP_EXPR && POINTER_TYPE_P (ttype)
> + && VOID_TYPE_P (TREE_TYPE (ttype)))
> + arg1 = TREE_OPERAND (arg1, 0);
> +
> + ttype = TREE_TYPE (arg1);
> + gcc_assert (POINTER_TYPE_P (ttype));
> +
> + /* Get the underlying type of the object. */
> + ttype = TREE_TYPE (ttype);
> + type_align = TYPE_ALIGN (ttype);
I take that back. Does this really work? It certainly doesn't seem like
it would work in SSA mode. You'd need to look back to the def.
r~