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 middle-end/77718] [7 Regression] expand_builtin_memcmp swaps args


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.

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