http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52171

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-02-08
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-08 
13:05:23 UTC ---
Created attachment 26610
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26610
prototype for memcmp

Patch that handles

int cmp (char *p, char *q)
{
  char *pa = __builtin_assume_aligned (p, 4);
  char *qa = __builtin_assume_aligned (q, 4);
  if (__builtin_memcmp (pa, qa, 4) != 0)
    return 1;
  return 0;
}

from forwprops simplify_builtin_call.

Possibly we could consider vector modes / compares (for greater size) and
allow misaligned accesses on !STRICT_ALIGNMENT targets.  We can also
handle non-power-of-two sizes by using (A ^ B) & mask, but we have to
think about endianess there.

Reply via email to