This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/83194] Possibly missed simplification with strcmp(s, t) == strcmp(t, s)
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Nov 2017 16:37:29 +0000
- Subject: [Bug tree-optimization/83194] Possibly missed simplification with strcmp(s, t) == strcmp(t, s)
- Auto-submitted: auto-generated
- References: <bug-83194-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83194
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
You definitely cannot assume strcmp (s, t) == -strcmp (t, s), only that
the result has the correct sign in each case.
There should be no need to preserve the exact return value (of the correct
sign) chosen by the implementation in a particular case.