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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to