From owner-svn-src-all@freebsd.org Thu Mar 30 06:38:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FB3D25D13 for ; Thu, 30 Mar 2017 06:38:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CECF87B7 for ; Thu, 30 Mar 2017 06:38:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id b140so13197705iof.1 for ; Wed, 29 Mar 2017 23:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ePBQa3Ewh+uduxuLmUG0kDGjDwFBEaphYQyA3Vbgl98=; b=PZpbp+BIYcJorJRWSlo+MH5Gu89NuoZBwbek0tDCVI4cMCfnydfWJL3hCZG9HN9pDk aHe1NHMzywOv8LGNjTSpQqKtETt69RvFV6sk8gWH1spuBhFqxKxs3Imp9Md/YTL+9Qip 1WrHcoJ+Cy/Zlzrca5SP+nvLHvljxnSAjE5NpggRQzSLyt8g8XZWoHGwJtpkOG2tdVkq 8z2GJB4jZltIHOw3Px+wm+AhUbnqlcyC1X4bZP+bd/9gthXKk9QD3ol1Fg5Fg1NK8Uk9 yrivL9mo29rk11LJZ3ZtUCmPoRYDfOeGMaN2yLOfsD6y8hPAKC5IMhFaZrb2AnZ/sYTl iW8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ePBQa3Ewh+uduxuLmUG0kDGjDwFBEaphYQyA3Vbgl98=; b=dBoaozVU0sIoXD1gNQBWUro34FfnUKAvZr/sda9fTYLNVMC1YqZ5YiaWjClROsGWVu JhSWezMa7anao4f1moaCHkrxlhGrgq5qe4YZ3nkZZGzeuSB2gKaEc5liTmgo1s5cs5cq iFnc676fbi1rVd8VgEZJG1bL5lbDQbzF5T4HIa+v2dNjYeXyaZD/vnShSFoVWZrLuOUc Z5f+RYIezGQ8a/7A3fyjlBw3zhOVq6WtzD7Ooa9F+/DY1Bz2EAL6r8gaIxYJXavC2xAz rfZ5aF9/1Kg5y2KtIk3rkPzwVxAyQcIl10RFaujqEj7+OQyyvI+OPsNHqfP1mxQefIU0 u/iw== X-Gm-Message-State: AFeK/H1Ni/BYLYaL4s1HOeIC/nlb1iZcjajg2tE12LvV5Bgk3YnB37b0xT2OY1BXKUSWApJLdH/+cnv8eQOJmA== X-Received: by 10.107.174.220 with SMTP id n89mr5634095ioo.166.1490855928070; Wed, 29 Mar 2017 23:38:48 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 23:38:47 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:519c:a6cb:84ea:e021] In-Reply-To: <20170330165329.L1061@besplex.bde.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> From: Warner Losh Date: Thu, 30 Mar 2017 00:38:47 -0600 X-Google-Sender-Auth: KdVf0R50iInioMIyS8TMJESSMhY Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Bruce Evans Cc: Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:38:49 -0000 On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans wrote: > I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? Yes. boot2 doesn't use the kernel CFLAGS. > Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline > parameter magic that was more needed for gcc-3.3. The magic isn't > really right for gcc-4.2, and breaks -Os for kernels. There is different magic for boot2. >The magic might > be wronger for gcc-6.3, though it would be a compiler bug to not > just ignore it if it is nonsense. clang doesn't provide any control > over inlining AFAIK, but ignores gcc directive to limit it and does > too much. Yes. It does. Hence my glowing review of 6.3 :) But you are right. I'm likely being overly harsh without commanding enough facts to get past my preconceived notions... I don't know if this is a simple compiler bug, lack of proper options, or a need to do things differently. Latter day versions of gcc have many more knobs to turn here. I don't know yet if turning any of them will be helpful. I'm looking to automate the knob turning so that we can at least see which optimizer options have an effect on the size. I doubt more than half a dozen have any useful effect on the size, and finding the right combination likely will suffice. Or we wait for gcc 7 and hope for the best... But this is nothing new. gcc 5.4.0 has -504 bytes free. gcc 4.9.4 has the same. 4.8.5 has -472, etc. It's clear that the magic sweet spot we're in with the in-tree 4.2.1 compiler isn't the sweet spot for these compilers... Then again, clang generated bloated like this until we got boot2 into their test suit, and now we have 100 bytes to spare there. Warner