On Fri, Aug 3, 2012 at 9:24 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > On Fri, Aug 3, 2012 at 8:40 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > >> We can implement atomic_fetch_sub with atomic_fetch_add and inverted >> operand 2. However, we have to prevent overflows with negation, so >> only const_int operand 2 is allowed in the expander.
Why do you need to prevent overflows? Richard. >> 2012-08-02 Uros Bizjak <ubiz...@gmail.com> >> >> PR target/54087 >> * config/i386/sync.md (atomic_fetch_sub<mode>): New expander. >> >> Tested on x86_64-pc-linux-gnu {,-m32}. >> >> I will wait for a day for possible comments. > > Patch attached again, this time with a testcase. > > 2012-08-02 Uros Bizjak <ubiz...@gmail.com> > > PR target/54087 > * gcc.target/i386/pr54087.c: New test. > > Uros.