From owner-svn-src-all@freebsd.org Thu Mar 30 06:47:52 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 849F2D25117 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 47F7C167 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id f84so2054911ioj.0 for ; Wed, 29 Mar 2017 23:47:52 -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:content-transfer-encoding; bh=A6iCsqt0TvG5TvMoLlvkijAFRd3Lor8tjYVmEvDuXtE=; b=W7XUN8AdMpRKd3EtuNhuEe+8M+EQsG02JNLTkHQYlb/+2dL5EhzAo71IxEx5fXVWb9 pW3n1k4WBnm0dze3lo1+uPuDr3/p4aX6/n7CEQ/SOotnsm0A32a8L7ymsfUmrEt1XmR8 em6y61tx3MRzAyae3I0sLLR5iJPPAgtkMmLZc23Irr1NY6t2zIC7F6NL+SWuYawLK545 QsZpmFJ1oi4T+G3u5BebpYqvZCrYmyL7ZhiLPTX2BvTdBuNKFn1Uks8i9qQsxuco+7OF cs44/7kqrQi+2yWO2n4Yy8JNFr5LYDiTgyP/VnNoVOR6SPgluU0Nh7NySoGIoeHVlnt9 4aug== 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:content-transfer-encoding; bh=A6iCsqt0TvG5TvMoLlvkijAFRd3Lor8tjYVmEvDuXtE=; b=QeV95oElcVQYZBEjL9rdtm0qKIz6axtXsK2k4TNpR/HtFZXI0sadLb5F7+20Tgxa2B h4mwUafUy8ZtSlJMGCaZ3pwl9GMdsjcSoO315wcq2p3eo4q9nAbn4sbDr0XxQ/hFF0zl nfRAAmzCpJewj9F1E/E1ddMjHronkw7Qiw1EYDpkTTU3589BbOV2OIha3w47fz93Ozk0 M8gwC+mQ/pBos+DPfU0OMuNs1qH18SjTWavAADb5C/PCLJdbF9U+gSwR9ik28BiRxdkC VxDR4ESgYNmmK9gvSy6MpzpUzvHJchlENKANnqL4npOk4U4dr9ngS96T64UUPwqTH2OW eieQ== X-Gm-Message-State: AFeK/H3y+u85NC0ioOrxWMqWM07/REXEMXjqMHYx3R7LwtQt6IU0Fv4dYkpxmBTpN+leA/374mwKbKH5GowK/g== X-Received: by 10.107.174.220 with SMTP id n89mr5665683ioo.166.1490856471597; Wed, 29 Mar 2017 23:47:51 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 23:47:51 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:519c:a6cb:84ea:e021] In-Reply-To: <6B63C559-C48C-4824-9D24-87FF89336FE4@gmail.com> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> <6B63C559-C48C-4824-9D24-87FF89336FE4@gmail.com> From: Warner Losh Date: Thu, 30 Mar 2017 00:47:51 -0600 X-Google-Sender-Auth: RhnSRUFu-wAbl6kuFjJ2EYyXKbg Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: "Ngie Cooper (yaneurabeya)" Cc: Bruce Evans , 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 Content-Transfer-Encoding: quoted-printable 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:47:52 -0000 On Thu, Mar 30, 2017 at 12:42 AM, Ngie Cooper (yaneurabeya) wrote: > >> On Mar 29, 2017, at 23:38, Warner Losh wrote: >> >> On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans wro= te: >>> 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. > > I know that a handful of people (several years ago) spent a lot of time m= aking clang work with boot2 and be under the limit. I=E2=80=99m not entirel= y sure, but we could have done similar things (but in more ominous ways in)= gcc 4.2.1 to shrink down the boot loader. We did. In fact, with every single new gcc release we did unnatural things. I did some of those things on many occasions. This is literally nothing new. We've been hacking gcc options, code layout and other things to get it to produce code < 7.5k for maybe 20 years in the project. Nobody has done more than compile with newer gcc's. It's broken there, but has been since at least 4.7, released several years ago. I'd be surprised if it worked on 4.3 or 4.4, but don't have the time to track those down :) Warner