Compile with -O2. Note the length of the memory to be compared via memcmp is fixed and just 2 bytes. It'd be more efficient and possibly smaller to just inline the necessary comparisons. Seems to me this ought to be addressed in our tree optimizers. int foo(const char* x) { return memcmp(x,"xx",2) != 0; }
Confirmed.
Related also to PR 12086.
This is a dup of 52171. RTL/expand parts are tracked in PR12086. *** This bug has been marked as a duplicate of bug 52171 ***