On Sun, 2020-05-31 at 16:10 -0700, H.J. Lu via Gcc-patches wrote:
> cmpstrnsi expander may pass the actual string length directly to cmpstrnqi
> patterns. For cmpstrnsi, one of the strings must be a constant and
> expand_builtin_strncmp rewrites the length argument to be the minimum of
> the const string length and the actual string length. But it is not the
> case for cmpmemsi. Pass a copy of the string length to cmpstrnqi patterns
> to avoid changing the actual string length by cmpstrnqi patterns.
>
> gcc/
>
> PR target/95443
> * config/i386/i386.md (cmpstrnsi): Pass a copy of the string
> length to cmpstrnqi patterns.
>
> gcc/testsuite/
>
> PR target/95443
> * gcc.target/i386/pr95443-1.c: New test.
> * gcc.target/i386/pr95443-2.c: Likewise.
OK
jeff
>