[Bug middle-end/84029] New: Partially inline strcmp
wilco at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 24 19:06:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84029
Bug ID: 84029
Summary: Partially inline strcmp
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: wilco at gcc dot gnu.org
Target Milestone: ---
Initial performance results for PR78809 suggest that partial inlining of strcmp
may be beneficial. We could inline the first character comparison before
calling strcmp:
if ((res = s[0] - t[0]) == 0)
res = strcmp (s, t);
Such a check would have low overhead and improve performance if the first
character often mismatches. Checking for more characters is possible, but would
have a higher overhead. strncmp and memcmp could do something similar.
More information about the Gcc-bugs
mailing list