This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52171] memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Feb 2013 15:05:01 +0000
- Subject: [Bug tree-optimization/52171] memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0
- Auto-submitted: auto-generated
- References: <bug-52171-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52171
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-19 15:05:01 UTC ---
(In reply to comment #6)
> Happens in insn-preds.c quite often:
>
> case 'Y':
> if (!strncmp (str, "Yi", 2))
> return CONSTRAINT_Yi;
> if (!strncmp (str, "Ym", 2))
> return CONSTRAINT_Ym;
> if (!strncmp (str, "Yp", 2))
> return CONSTRAINT_Yp;
> if (!strncmp (str, "Ya", 2))
> return CONSTRAINT_Ya;
Well, for insn-preds.c we could also argue that the generator should emit for
this
case 'Y':
if (str[1] == 'i') return CONSTRAINT_Yi;
if (str[1] == 'm') return CONSTRAINT_Ym;
etc.