Re-ping. Steve Ellcey sell...@cavium.com
On Mon, 2017-09-25 at 10:36 -0700, Steve Ellcey wrote: > Ping. > > Steve Ellcey > sell...@cavium.com > > > On Fri, 2017-09-15 at 11:22 -0700, Steve Ellcey wrote: > > > > PR 81356 points out that doing a __builtin_strcpy of an empty string on > > aarch64 does a copy from memory instead of just writing out a zero byte. > > In looking at this I found that it was because of > > aarch64_use_by_pieces_infrastructure_p, which returns false for > > STORE_BY_PIECES. The comment says: > > > > /* STORE_BY_PIECES can be used when copying a constant string, but > > in that case each 64-bit chunk takes 5 insns instead of 2 (LDR/STR). > > For now we always fail this and let the move_by_pieces code copy > > the string from read-only memory. */ > > > > But this doesn't seem to be the case anymore. When I remove this function > > and the TARGET_USE_BY_PIECES_INFRASTRUCTURE_P macro that uses it the code > > for __builtin_strcpy of a constant string seems to be either better or the > > same. The only time I got more instructions after removing this function > > was on an 8 byte __builtin_strcpy where we now generate a mov and 3 movk > > instructions to create the source followed by a store instead of doing a > > load/store of 8 bytes. The comment may have been applicable for > > -mstrict-align at one time but it doesn't seem to be the case now. I still > > get better code without this routine under that option as well. > > > > Bootstrapped and tested without regressions, OK to checkin? > > > > Steve Ellcey > > sell...@cavium.com > > > > > > > > 2017-09-15 Steve Ellcey <sell...@cavium.com> > > > > PR target/81356 > > * config/aarch64/aarch64.c > > (aarch64_use_by_pieces_infrastructure_p): > > Remove. > > (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): Remove define. > > > > > > 2017-09-15 Steve Ellcey <sell...@cavium.com> > > > > * gcc.target/aarch64/pr81356.c: New test.