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 tree-optimization/52171] memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0


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.


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