[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/4] tcg: Mask shift counts to avoid undefine
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/4] tcg: Mask shift counts to avoid undefined behavior |
Date: |
Wed, 19 Mar 2014 15:59:57 +0000 |
On 19 March 2014 15:25, Richard Henderson <address@hidden> wrote:
> On 03/18/2014 11:21 PM, Stefan Weil wrote:
>> Are there test cases which fail with the old code?
>
> Only when running under analysis tools looking for technical violations of the
> standard. Under normal circumstances it would never crash since, as with the
> native backends, the underlying cpu is going to treat this some rational way.
I think the major reason for fixing this kind of thing is that
modern C compilers are becoming increasingly adversarial,
and if we don't try to clean up our use of undefined behaviours
one day gcc is going to decide that it can optimize our code
into something that breaks...
thanks
-- PMM