Gcc builtin review: strstr, strcasestr, memmem

Ondřej Bílka neleai@seznam.cz
Tue May 26 08:00:00 GMT 2015


A gcc does little optimizations, just constant arguments.

And why gcc doesnt optimize memmem as arguments are constant and with
size 1 needle it could use memchr?

#include <string.h>
int foo(char *x)
{
  return memmem ("tauhtatu", 4, "f", 1);
}



More information about the Libc-alpha mailing list