Re: [TRIVIAL] strlen("literal string") -> (sizeof("literal string")-1)

From: Denis Zaitsev (zzz@cd-club.ru)
Date: Thu Aug 29 2002 - 15:38:08 EST


On Thu, Aug 29, 2002 at 09:56:44AM -0700, Linus Torvalds wrote:
>
> On Thu, 29 Aug 2002, Jakub Jelinek wrote:
> >
> > Well, IMHO at least for the more recent GCC versions kernel
> > should leave the job to GCC (ie. either just prototype str* functions,
> > or define them to __builtin_str* variants).
>
> I agree. That x86 strlen() inline is from 1991 with fixes ever after, and
> pre-dates gcc having any support for inline at all. We're much more likely
> to be better off just removing it these days. Is somebody willing to
> compare code quality? I wouldn't be in the least surprised if gcc did a
> better job these days..
>

GCC-3.2 doesn't do any inlining for __builtin_strlen at all, if -mcpu > i386.
It just does call/jump outline strlen... Isn't very good?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Aug 31 2002 - 22:00:27 EST