qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG
Date: Thu, 23 Nov 2017 23:08:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 22/11/2017 13:14, Peter Maydell wrote:
>> We do this all of the time for more regular tests that are obviously
>> compile-time.  I am a really big fan of this, because it makes sure that the
>> (usually 32-bit) else branch continues to compile.
> I'm happy with code that is "we assume the compiler is going to
> be sensible here so we don't have to use #ifdefs in the name
> of performance". I just don't think we should write code that
> can't compile at all if the compiler happens to not identify
> the codepath as dead. There's no guarantee by the compiler
> that it's going to do that.

There's plenty of cases where "if (kvm_enabled())" code would fail to
link if the compiler didn't do that optimization.

(In fact, it's one of the very few optimizations that the compiler
performs at -O0, because it's extremely effective).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]