[trans-mem] handle memset (PR/47492)

Aldy Hernandez aldyh@redhat.com
Wed Feb 2 15:42:00 GMT 2011


On 01/31/11 16:17, Patrick Marlier wrote:
> In function expand_call_tm(), the _ITM_memsetW must indicate that the
> transaction is a not a read only transaction (not optional).
...
> This transaction must not be read only.
>
> The part of my draft patch about this:
> + fn_decl = gimple_call_fndecl (stmt);
> + /* ??? Do the same for ITM memcpy/memmove */
> + if (is_tm_memset (fn_decl))
> + transaction_subcode_ior (region, GTMA_HAVE_STORE);

Actually, if you look a few lines down, you will notice that we always 
set GTMA_HAVE_{STORE,LOAD} for non TM pure calls:

   /* Note that something may happen.  */
   *state |= GTMA_HAVE_LOAD | GTMA_HAVE_STORE;

So the transaction will never be marked as read-only incorrectly.

Richard, is the patch OK?



More information about the Gcc-patches mailing list