[llvm-bugs] [Bug 49170] New: Failure to optimize strcat immediately after strcpy
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Feb 13 02:10:17 PST 2021
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: unassignedbugs at nondot.org
Reporter: gabravier at gmail.com
CC: llvm-bugs at lists.llvm.org
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210213/472968d1/attachment.html>
More information about the llvm-bugs
mailing list