https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77718
--- Comment #3 from acsawdey at gcc dot gnu.org --- Bernd, I identified the problem on powerpc64le. I think it may not show up on x86_64 because of differences in how builtin memcmp gets expanded. Normally this is hidden because if both strings are constant, this gets handled by folding. It only shows up in the test case because the length given is longer than the string length, which prevents folding (undefined behavior). It seems clear to me that it is only legitimate to swap the args in the result_eq case because otherwise you are changing the sign of the result.