https://bugs.llvm.org/show_bug.cgi?id=49170

            Bug ID: 49170
           Summary: Failure to optimize strcat immediately after strcpy
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

void f(char *s)
{
    strcpy(s, "a");
    strcat(s, "a");
}

This can be optimized to `memcpy(s, "aa", 3);`. This transformation is done by
GCC, but not by LLVM.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to