This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] genmodes: remove misleading use of strncpy
On Thu, Apr 19, 2012 at 02:38:11PM +0200, Richard Guenther wrote:
> On Thu, Apr 19, 2012 at 2:34 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Thu, Apr 19, 2012 at 02:31:37PM +0200, Richard Guenther wrote:
> >> That's better. ?Or even cache the strlen result and use memcpy here
> >> as Jakub suggested.
> >
> > tree-ssa-strlen.c will do that for you when optimizing in this case ;)
>
> Does it? But only if you used strcpy, no?
Yes. I don't think it would handle the strncpy, it is in that case not
about caching the value, but also additional comparison and knowing it is
sufficiently large.
Jakub