[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG |
Date: |
Fri, 24 Nov 2017 10:07:23 +0000 |
On 23 November 2017 at 22:08, Paolo Bonzini <address@hidden> wrote:
> 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.
I think that's a step less weird than "assert(kvm_enabled())",
but I tend to think of that kind of thing as "if the compiler
ever did decide not to link it we'd add missing stub functions".
thanks
-- PMM
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG, Peter Maydell, 2017/11/22
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG, Philippe Mathieu-Daudé, 2017/11/22
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG, no-reply, 2017/11/22
Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG, Peter Maydell, 2017/11/23