On Thu, Oct 25, 2012 at 11:32:58PM +0200, Dodji Seketeli wrote:
> +  tree source0 = NULL_TREE, source1 = NULL_TREE,
> +    dest = NULL_TREE, len = NULL_TREE;
> +  bool is_store = true;
...
nothing sets is_store here.
...
> +
> +     instrument_derefs (iter, dest, location, is_store);

BUILTIN_ATOMIC_LOAD* are just loads and so should clear is_store.

> +  if (len != NULL_TREE)
> +    {
> +      is_store = (dest != NULL_TREE);
> +
> +      if (source0 != NULL_TREE)
> +     instrument_mem_region_access (source0, len, iter,
> +                                   location, is_store);
> +      if (source1 != NULL_TREE)
> +     instrument_mem_region_access (source1, len, iter,
> +                                   location, is_store);
> +      else if (dest != NULL_TREE)
> +     instrument_mem_region_access (dest, len, iter,
> +                                   location, is_store);

This looks wrong, source0/source1 are always reads, aren't they?
So you should pass false for the first two instrument_mem_region_access
calls and true to the last one.

        Jakub

Reply via email to