Bug ID: 81739
Summary: Replace calls to memcmp with more efficient code if
Assignee: unassigned at gcc dot gnu.org
Target Milestone: ---
In our app we had function which was comparing two uint64 values using memcmp.
As it turned out, it was taking a lot of time. After some googling we found
After fixing our code using this approach it started working much faster.
Please implement such optimization in gcc itself. I found that it already
optimizes some calls to memcpy, it could do the same with memcmp too.
int cmp1(uint64_t a, uint64_t b)
return memcmp(&a, &b, sizeof(uint64_t));
int cmp2(uint64_t a, uint64_t b)
return a < b ? -1 : (a > b);