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

            Bug ID: 71731
           Summary: incorrect result for vectorized char rotate with
                    -mcpu=power9
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acsawdey at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc64le-linux

Created attachment 38814
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38814&action=edit
preprocessed test case

In test case gcc/testsuite/gcc.c-torture/execute/pr56866.c

with flags -mcpu=power9 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops
-ftracer -finline-functions

The attached test case passes if compiled with -DDONTFAIL and fails otherwise.

#ifndef DONTFAIL
  for (t = 0; t < 256; ++t)
    rs[t] = (ws[t] >> 9) | (ws[t] << (sizeof (ws[0]) * __CHAR_BIT__ - 9));
#endif
  for (t = 0; t < 256; ++t)
    rc[t] = (wc[t] >> 5) | (wc[t] << (sizeof (wc[0]) * __CHAR_BIT__ - 5));  asm 

volatile ("" : : "g" (rq), "g" (ri), "g" (rs), "g" (rc) : "memory");

#ifndef DONTFAIL
  if (rs[0] != 0xb3a2 || rs[1])
    __builtin_abort ();
#endif
  if (rc[0] != 0x9b || rc[1])
    __builtin_abort ();

Reply via email to