This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: Gcc builtin review: strcpy, stpcpy, strcat, stpcat?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Wilco Dijkstra <wdijkstr at arm dot com>
- Cc: 'Ondřej Bílka' <neleai at seznam dot cz>, 'Richard Earnshaw' <Richard dot Earnshaw at foss dot arm dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 10 Jun 2015 11:02:30 +0000
- Subject: RE: Gcc builtin review: strcpy, stpcpy, strcat, stpcat?
- Authentication-results: sourceware.org; auth=none
- References: <A610E03AD50BFC4D95529A36D37FA55E769B14FEFF at GEORGE dot Emea dot Arm dot com> <000901d09ecd$5dc2b4b0$19481e10$ at com> <20150609085323 dot GB26925 at domone> <000c01d0a369$2caec850$860c58f0$ at com>
On Wed, 10 Jun 2015, Wilco Dijkstra wrote:
> Yes, I think the optimization to convert strcpy into stpcpy would need
> to be done in a target specific way in GLIBC headers for targets where it
> makes sense. It's not something you could easily do in GCC as stpcpy is
> not a standard function. In general it is best to optimize to use simpler,
stpcpy is a POSIX function (and GCC of course can know about the semantics
of glibc functions, and generate calls if the conditions I described in
<https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00409.html> are satisfied -
and for that matter can know about the glibc exports of __stpcpy and use
that).
--
Joseph S. Myers
joseph@codesourcery.com