This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/10339: [sparc] Invalid optimization: replacing strncmp by memcmp


On Mon, Apr 07, 2003 at 06:42:47PM -0000, bangerth at dealii dot org wrote:
> Old Synopsis: strncmp generates imPure code
> New Synopsis: [sparc] Invalid optimization: replacing strncmp by memcmp

Also happens on powerpc-linux and powerpc64-linux.  Incidentally,
I think Andreas' suggestion that memcmp is allowed to compare from
the upper end of the arrays is not very likely to happen given
memcmp's return value.  A more reasonable objection to the
strncmp -> memcmp transformation is that a memcmp implementation
might load multiple words into registers (say a cache-line worth),
before comparing.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]