cvs commit: src/sys/dev/ata ata-raid.c

Bruce Evans bde at zeta.org.au
Sat Jun 11 12:31:22 GMT 2005


On Sat, 11 Jun 2005, Stefan Farfeleder wrote:

> On Sat, Jun 11, 2005 at 03:21:20AM +0000, Marcel Moolenaar wrote:
>
>>   Avoid GCC optimizations from injecting a call to memset(?) in order
>>   to initialize the buffer array in ata_raid_attach() by removing the
>>   initializer. There's no memset(?) in the kernel. Instead, assign
>>   '\0' to the first element. The buffer array holds strings only, so
>>   this is functionally equivalent.
>
> Maybe GCC should be taught to generate a bzero call instead?

No.  gcc -ffreestanding shouldn't generate calls to memset(), but
generating calls to bzero() is no better, since there are no symbols
are reserved for the library in freestanding implementations.  Even
symbols with lots of leading underscores are not reserved, so gcc
shouldn't use any libcalls in freestanding environments.  The latter
seems too extreme, so I think generating calls to functions named
something like __builtout_memset() would be OK.  However, for using
libcalls for the memset family rather defeats optimizations.  gcc's
MD builtin memset is likely to be much better than an MI library
version.

Bruce


More information about the cvs-src mailing list