This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/78117] gcc on tilegx builds faulty strstr() function (from glibc)


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

Chris Metcalf <cmetcalf at mellanox dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cmetcalf at mellanox dot com

--- Comment #6 from Chris Metcalf <cmetcalf at mellanox dot com> ---
This is believed to be due to a bug in the architecture-independent code that
optimizes vector (SIMD) ops.  A smaller test case:

unsigned long test(unsigned long a, unsigned long b)
{
  unsigned long result = __insn_v1cmpeq(a, 0);
  result >>= 8;
  return result;
} 

This will correctly emit the v1cmpeq and a right shift at -O0, but at higher
levels the v1cmpeq is optimized away and replaced with a zero, thus also
causing the right shift to be optimized away, and the function just returns
zero.  Without the right shift, the v1cmpeq is preserved at all optimization
levels.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]