This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
It would be nice if memcmp is inlined for small n's It would be nice if these two functions are the same: int g(int *j,int *l) { return memcmp(j,l,4); } int h(int *j, int *l) { return *j - *l; } This save space (not in this function on PPC because of sibcall but it could because gcc does not have to spill to much more to go over the function call) and time (because no function overhead on targets where memcmp is not inlined like PPC).
*** Bug 12087 has been marked as a duplicate of this bug. ***
I have got my own bug. Add the attribute may_alias to the (const unsigned int *) when creating the type will make sure there is no aliasing problems. The 2 (short case) instead of 4 should be able to be done the same way and also the 8 case (long long). I have to check on the size of the types but that is the only thing different than the 1 size case that is already there besides the extra attribute, I should be able to do this tonight.
Posted patch <http://gcc.gnu.org/ml/gcc-patches/2003-08/msg01826.html>.
Cannot be done as there are cases where it would return the wrong result.
Why do you think it would give wrong results? On big endian, it should work IMHO, on little endian, you might also be able to do something on some platforms (see http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01723.html)
Reopening based on new thoughts but this will not go in for 3.4 at least by me because I am too busy.
*** Bug 3508 has been marked as a duplicate of this bug. ***
I don't have time to work on this any more.
I am going to fix up my patch for 4.3.0.
I am no longer working on this.