https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127086

Anton Blanchard <anton at ozlabs dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #8 from Anton Blanchard <anton at ozlabs dot org> ---
Thanks Jeff, I tested trunk Bohan's fix against cpu2017 x264 but it didn't fix
the problem. Claude came up with the following test where the function call is
before the loop:

/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */

void tick (void);

void
call_then_avg (unsigned char *dst, const unsigned char *s1,
               const unsigned char *s2, int w, int h, int ds, int ss1, int ss2)
{
  tick ();
  for (int y = 0; y < h; y++)
    {
      for (int x = 0; x < w; x++)
        dst[x] = (s1[x] + s2[x] + 1) >> 1;
      dst += ds;
      s1 += ss1;
      s2 += ss2;
    }
}

/* The write must come after the call and before the first loop label.  */
/* { dg-final { scan-assembler
{call_then_avg:\n(?:[^\n]*\n)*?\tcall\ttick(?:@plt)?\n(?:(?!\.L[0-9]+:)[^\n]*\n)*?\tcsrwi\tvxrm,0\n}
} } */
/* { dg-final { scan-assembler-times {\tcsrwi\tvxrm,} 1 } } */

Reply via email to