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