This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12087] New: memcmp(i,j,4) should use word (SI) subtraction
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Aug 2003 03:04:44 -0000
- Subject: [Bug optimization/12087] New: memcmp(i,j,4) should use word (SI) subtraction
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12087
Summary: memcmp(i,j,4) should use word (SI) subtraction
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
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).