libcrypt/md5.c: a few statics can be auto variables; strlen("const") is silly

Chris Metcalf cmetcalf at tilera.com
Mon Jun 16 20:45:04 UTC 2008


On 6/12/2008 6:14 AM, Will Newton wrote:
> > On Thu, Jun 12, 2008 at 8:08 AM, Denys Vlasenko
> > <vda.linux at googlemail.com> wrote:
>> >> This is the patch wich ONLY replaces strlen("const") with
>> >> sizeof("const")-1. Let's check assembly, do we see strlen
>> >> in original version?
> >
> > What compiler flags were used? It's possible to disable this
> > optimization in gcc.
> >
> > Maybe replace strlen with __builtin_strlen?

uClibc is normally built with -fno-builtin, which will prevent the strlen()
optimization.  Using __builtin_strlen() seems reasonable here.

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com



More information about the uClibc mailing list