On 11/29/2011 07:08 AM, Andrew MacLeod wrote:
> PR target/50123
> * optabs.c (maybe_optimize_fetch_op): New. Look for more optimal
> instructions for a FECTH_OP or OP_FECTH sequence.
> (expand_atomic_fetch_op): Call maybe_optimize_fetch_op.
> * testsuite/gcc.dg/atomic
The bug observes that atomic and/or operations can occasionally be
replaced with a exchange operation.
fetch_and (&x, 0) -> exchange (&x, 0)
fetch_or (&x, -1)-> exchange (&x, -1)
This is now trivial in the general expansion code. Others could easily
be added later.
This pat