From owner-cvs-src@FreeBSD.ORG Sat Jun 11 17:45:27 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E11C16A41C; Sat, 11 Jun 2005 17:45:27 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 245DA43D1F; Sat, 11 Jun 2005 17:45:27 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from [192.168.4.250] (dhcp50.pn.xcllnt.net [192.168.4.250]) by ns1.xcllnt.net (8.13.3/8.13.3) with ESMTP id j5BHjQ9j001222; Sat, 11 Jun 2005 10:45:27 -0700 (PDT) (envelope-from marcel@xcllnt.net) In-Reply-To: <20050611072537.GB39090@wombat.fafoe.narf.at> References: <200506110321.j5B3LKi2025443@repoman.freebsd.org> <20050611072537.GB39090@wombat.fafoe.narf.at> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Sat, 11 Jun 2005 10:45:24 -0700 To: Stefan Farfeleder X-Mailer: Apple Mail (2.622) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/ata ata-raid.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2005 17:45:27 -0000 On Jun 11, 2005, at 12:25 AM, 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? I tend to agree with des@: the compiler should always initialize with inline code. If a call to some initialization function (like memset(3)) is better for the circumstances, the programmer can always remove the initializer on the declaration and call that function explicitly. This leaves the programmer in control, removes questionable dependencies and assumptions and may actually yield better code due to the possibility of exploiting alignment and size knowledge. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net