[Bug target/81356] New: __builtin_strcpy is not good for copying an empty string on aarch64
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jul 8 05:14:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81356
Bug ID: 81356
Summary: __builtin_strcpy is not good for copying an empty
string on aarch64
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: aarch64-linux-gnu
Take:
void f(char *a)
{
__builtin_strcpy (a, "");
}
---- CUT ---
This produces:
f:
adrp x1, .LC0
ldrb w1, [x1, #:lo12:.LC0]
strb w1, [x0]
ret
But why can't it be just:
f:
strb wzr, [x0]
ret
More information about the Gcc-bugs
mailing list