[LLVMbugs] [Bug 15964] New: Missing conditional optimization compared to gcc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 10 11:17:22 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15964

            Bug ID: 15964
           Summary: Missing conditional optimization compared to gcc
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: jmuizelaar at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following two programs give the same result with gcc but B produces worse
code with clang.

A:
int
PL_strcasecmp(const char *a, const char *b)
{

    while( (*a == *b) && ('\0' != *a))
    {
        a++;
        b++;
    }

    return *a - *b;
}

B:
int
PL_strcasecmp(const char *a, const char *b)
{

    while( (*a == *b) && ('\0' != *a) && ('\0' != *b))
    {
        a++;
        b++;
    }

    return *a - *b;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130510/85e88dcb/attachment.html>


More information about the llvm-bugs mailing list