Re: Code generated for a simple memory copy loop

2009-02-20 Thread Gerald Pfeifer
On Tue, 17 Feb 2009, Narasimha Datta wrote: > I'd love to check out the generated code on a later gcc, but > unfortunately we are not in a position to upgrade our gcc. We > just use the default gcc that came with FreeBSD 7.0. You can always install one of the lang/gcc ports in addition, for examp

Re: Code generated for a simple memory copy loop

2009-02-16 Thread Narasimha Datta
does. I'm probably missing something, and I'd like to understand that. Is counting up better than counting down in some way (add v/s sub)? Thanks again for any help. Regards, N Datta --- On Mon, 16/2/09, Richard Guenther wrote: > From: Richard Guenther > Subject: Re: Code generate

Re: Code generated for a simple memory copy loop

2009-02-16 Thread Richard Guenther
On Mon, Feb 16, 2009 at 11:19 AM, Narasimha Datta wrote: > Hello, > > Here's a simple memory copy macro: > > #define MYMEMCOPY(dp, sp, len) \ > do { \ >long __len = len; \ >while (--__len >= 0) \ >(dp)[__len] = (sp)[__len]; \ > } while (0) > > void foo(unsigned char