Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jun 2005 22:31:18 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Stefan Farfeleder <stefanf@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, Marcel Moolenaar <marcel@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/ata ata-raid.c
Message-ID:  <20050611221306.G28805@delplex.bde.org>
In-Reply-To: <20050611072537.GB39090@wombat.fafoe.narf.at>
References:  <200506110321.j5B3LKi2025443@repoman.freebsd.org> <20050611072537.GB39090@wombat.fafoe.narf.at>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050611221306.G28805>