typedef __SIZE_TYPE__ size_t;

extern int memcmp (const void *s1, const void *s2, size_t n)
  __attribute__ ((__nothrow__, __pure__));
extern __typeof (memcmp) memcmp __asm__ ("memory_compare");

int
bar (char *s, char *t, int cnt)
{
  if (__builtin_expect (cnt, 0))
    return memcmp (s, t, cnt);
  return 0;
}

emits memcmp instead of inline expansion or memory_compare call since r138835
for -Os (and a tiny bit later for -O2).  This breaks check-localplt test in
glibc and more importantly, some memcmp calls in glibc go through PLT when they
shouldn't.


-- 
           Summary: [4.4 Regression] Builtin redirection no longer working
                    for memcmp
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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

Reply via email to