From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid() Date: Tue, 12 Nov 2013 15:57:36 +0100 Message-ID: <528241E0.5060503@redhat.com> References: <5281580D.7060305@redhat.com> <52816422.8060002@redhat.com> <52821A62.2050001@redhat.com> <52822958.8060508@redhat.com> <20131112132337.GB2008@redhat.com> <528233DD.6020306@redhat.com> <20131112140935.GD2008@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Peter Maydell , Anthony Liguori , QEMU Developers , kvm-devel , Patch Tracking , Andreas Tobler , Anthony Liguori To: Gleb Natapov Return-path: Received: from mail-ea0-f172.google.com ([209.85.215.172]:54703 "EHLO mail-ea0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756274Ab3KLO5l (ORCPT ); Tue, 12 Nov 2013 09:57:41 -0500 Received: by mail-ea0-f172.google.com with SMTP id h11so2428304eaj.17 for ; Tue, 12 Nov 2013 06:57:40 -0800 (PST) In-Reply-To: <20131112140935.GD2008@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 12/11/2013 15:09, Gleb Natapov ha scritto: > On Tue, Nov 12, 2013 at 02:57:49PM +0100, Paolo Bonzini wrote: >> Il 12/11/2013 14:23, Gleb Natapov ha scritto: >>>> If -O0 does not do that, let's move debug builds to -O1. >>> >>> Why not enable dce with -fdce? >> >> First, because clang doesn't have fine-tuned optimization options (at >> least I couldn't find them and -fdce doesn't work). > > -O1 then for clang. We can even test in configure for the exact optimizations we want, in fact. But I think -O1 doesn't sacrifice debuggability that much: http://www.redhat.com/magazine/011sep05/features/gcc/ -O0 Barely any transformations are done to the code, just code generation. At this level, the target code can be debugged with no loss of information. -O1 Some transformations that preserve execution ordering. Debuggability of the generated code is hardly affected. User variables should not disappear and function inlining is not done. -O2 More aggressive transformations that may affect execution ordering and usually provide faster code. Debuggability may be somewhat compromised by disappearing user variables and function bodies. Not very recent, but things have remained roughly the same and gdb also has improved. Hmm... I just found out that GCC has a shiny new "-Og" option to optimize for debuggability and still producing good code. Using "-Og" if it is present, and -O1 otherwise, seems like a good idea to me for 1.8. For 1.7 it can just be -O1. >> Second, because most optimization options are no-ops at -O0 (try "-fdce >> -fdump-tree-all" with GCC. >> > Strange. Is this by design? We can do -O1 and bunch of "-fno-" to > disable most of optimizations -O1 enables, but this is ugly. Yes, some data structures (I'm not up to date as to which exactly) are not even built at -O0 to make compilation faster, and they're required for most optimizations. Paolo