[Bug tree-optimization/121815] memcmp should expand inline when the len is [0,1]
kaelfandrew at gmail dot com via Gcc-bugs <[email protected]>
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121815
--- Comment #1 from Kael Franco <kaelfandrew at gmail dot com> ---
Reduced C testcase:
```
int
src (const char* str, unsigned len)
{
return __builtin_memcmp("a", str, len != 0);
}
```
Optimized function should return 0 if len == 0,
then return .SPACESHIP ('a', str[0], -1)