From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773AbbDHM5b (ORCPT ); Wed, 8 Apr 2015 08:57:31 -0400 Received: from 251.110.2.81.in-addr.arpa ([81.2.110.251]:32911 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbbDHM53 (ORCPT ); Wed, 8 Apr 2015 08:57:29 -0400 Date: Wed, 8 Apr 2015 13:57:21 +0100 From: One Thousand Gnomes To: Austin S Hemmelgarn Cc: Pengfei Yuan <0xcoolypf@gmail.com>, Mike Galbraith , linux-kernel@vger.kernel.org Subject: Re: Why not build kernel with -O3 Message-ID: <20150408135721.1be4fb3a@lxorguk.ukuu.org.uk> In-Reply-To: <552519AF.1060201@gmail.com> References: <1428388995.3152.10.camel@gmail.com> <1428401356.3152.38.camel@gmail.com> <55241C51.8040107@gmail.com> <552519AF.1060201@gmail.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I can't remember any off the top of my head, but it does say explicitly > in the GCC manual to be careful with -O3. IIRC, most of the issues > relate to -O3 enabling -ffast-math (which tends to really mess with code > that expects strict IEEE 754 compliance), so it may not be as much of an > issue for kernel code. You might look into some of the projects that > use -O3 by default (I think most of the Mozilla so0ftware does these > days, and I know that there are others, I just can't remember what right > now). Historically -O3 used to produce code that used a lot more memory and was frequently neither correct nor fast. That was however in the days of gcc 2.7.x and I don't know that anyone has taken a hard look at stuff with a modern gcc. At the very least I think a -O3 change for x86 as well as being benchmarked would need to go through all the stress testers and regression testing build systems we now have to try and catch any surprises. If your numbers are right then it looks well worth investigating. Alan