> The patch is ok to commit. I think I made a typo as other analogous > code contains '|='. > > Thanks for fixing this, Robert.
The LRA part of this is committed as r215119. Eric: Is the test OK to commit for MIPS? I suggest removing the dg-skip-if as the test is for successful compilation, not inspecting the generated code. Thanks, Matthew > > > > > 2014-09-09 Robert Suchanek <robert.sucha...@imgtec.com> > > > > gcc/testsuite/ > > * gcc.target/mips/20140909.c: New test. > > diff --git a/gcc/testsuite/gcc.target/mips/20140909.c > b/gcc/testsuite/gcc.target/mips/20140909.c > > new file mode 100644 > > index 0000000..dbdfb30 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/mips/20140909.c > > @@ -0,0 +1,20 @@ > > +/* { dg-do compile } */ > > +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ > > + > > +NOMIPS16 int NoBarrier_AtomicIncrement(volatile int* ptr, int > increment) { > > + int temp, temp2; > > + __asm__ __volatile__(".set push\n" > > + ".set noreorder\n" > > + "1:\n" > > + "ll %0, 0(%3)\n" > > + "addu %1, %0, %2\n" > > + "sc %1, 0(%3)\n" > > + "beqz %1, 1b\n" > > + "addu %1, %0, %2\n" > > + ".set pop\n" > > + : "=&r" (temp), "=&r" (temp2) > > + : "Ir" (increment), "r" (ptr) > > + : "memory"); > > + > > + return temp2; > > +} > >