From owner-freebsd-current@FreeBSD.ORG Wed Oct 31 10:03:43 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3661B16A417 for ; Wed, 31 Oct 2007 10:03:43 +0000 (UTC) (envelope-from yaraghchi@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by mx1.freebsd.org (Postfix) with ESMTP id E34C313C481 for ; Wed, 31 Oct 2007 10:03:42 +0000 (UTC) (envelope-from yaraghchi@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so63675nzf for ; Wed, 31 Oct 2007 03:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=bGfR3s2LmijirLuL8uPC5cbjby/VikFbtMnhaHBkiyw=; b=U9cwvOw9jsoqse97YRTZx/o6dyXi/SBu2Eg6uN397hCm4y0r27D3GjDSU6WVDnC7aX7OEHFeIZl11RMWEY2oWRlZtqcZJnkWdQQKu+MylAz3iQQS3ty5P9YXdKGh1XHhSMYAjefE18fnYOTog7zEVUB9w3NWEDE1ThXQ6n/K0K4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=UWNOu375kXt+wyroLBu+2GRNLI39Sp730Vugs02lj+/VIuOuc90KKQKs0yS6ktXlygH/yLPP8HtxTHMmfpjw1YsGngLC6Va6zQvGpDt0R6G4WgmB2q7W4rcE4ojwXycOYdC4zkIpGrbbkocExZbuYdcXagUgGKLT1hhmPFxAYs0= Received: by 10.142.86.7 with SMTP id j7mr1957622wfb.1193825000882; Wed, 31 Oct 2007 03:03:20 -0700 (PDT) Received: by 10.143.158.18 with HTTP; Wed, 31 Oct 2007 03:03:20 -0700 (PDT) Message-ID: <25f52a3d0710310303w7138bf5ds92698f1b6af2f655@mail.gmail.com> Date: Wed, 31 Oct 2007 11:03:20 +0100 From: "Stephan F. Yaraghchi" Sender: yaraghchi@gmail.com To: "Kris Kennaway" In-Reply-To: <47284E4F.5030008@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <25f52a3d0710300732x425f0c45vde1a29361096c018@mail.gmail.com> <47284E4F.5030008@FreeBSD.org> X-Google-Sender-Auth: a102d93bbcb9cc32 Cc: freebsd-current@freebsd.org Subject: Re: loader breaks with -O2 optimizations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2007 10:03:43 -0000 On 10/31/07, Kris Kennaway wrote: > Stephan F. Yaraghchi wrote: > > After making world on a freshly installed 7.0-BETA1 > > the system does not boot anymore due to a broken loader: > > > > > > FreeBSD/i386 bootstrap loader, Revision 1.1 > > (root@bigblue, Tue Oct 30 11:26:32 CET 2007) > > Can't work out which disk we are booting from. > > Guessed BIOS device 0xffffffff not found by probes defaulting to disk0: > > > > panic: free: guard1 fail@ 0x6ded4 from > > /usr/src/sys/boot/i386/loader/../../common/module.c:959 > > > > --> Press a key on the console to reboot <-- > > > > > > I found out that the following line in my make.conf causes > > the problem: > > > > CFLAGS= -O2 -funroll-loops -pipe > > > > > > After changing down to -O1 and making /usr/src/sys/boot again > > the systems behaves properly at boot. > > > > Is this behavior intended? > > Maybe, what happens if you use just -O2 -pipe? -funroll-loops is not an > appropriate thing to be using globally anyway, unless your intention is > to randomly make some code slower. > > Kris > Hi Kris, I tried all possible combinations of these switches -- only -O2 led to the described behaviour. Anyway, it's very interesting to hear that adding these optimizations to make.conf is not recommended, even that -funroll-loops is possibly slowing down certain code. I'm sure many people use it since it's a common tuning tip found on the web. I read about it in Dru Lavigne's "BSD Hacks" (O'Reilly)... -- Stephan www.deine-stimme-gegen-armut.de