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