qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values
Date: Wed, 25 Nov 2015 19:18:34 +0000	[thread overview]
Message-ID: <CAFEAcA8LRY8Fi=AzBzQi4SX43AiWBi6p==4_JAssKUyK9Z98CA@mail.gmail.com> (raw)
In-Reply-To: <5655F4CB.10509@redhat.com>

On 25 November 2015 at 17:50, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 25/11/2015 18:44, Peter Maydell wrote:
>> We still haven't had any response from the LLVM/clang folks that
>> this interpretation of the meaning of -fwrapv is their interpretation
>> of it, have we? (I can't see any comments on the referenced bug.)
>
> Reasonably, they will have to follow what GCC does, independent of
> -fwrapv.  GCC has now promised to not exploit << undefined behavior,
> even without -fwrapv.

I don't think that follows. If -fwrapv is still documented by gcc
as only affecting arithmetic and not shifts, I don't see any
reason why the llvm people will expect it do to anything else.
And LLVM is its own project and its developers don't always exactly
follow gcc behaviour.

Your latest patch at https://gcc.gnu.org/ml/gcc-patches/2015-11/msg03055.html
doesn't seem to touch the documentation of -fwrapv at all, so I
don't think it is sufficient to allow users of the compiler
to say "-fwrapv means signed behaviour for shifts".

> So at this point, -fwrapv is only required to placate ubsan---which it
> will do for GCC as soon as my other patch is approved (I talked on IRC
> with one of the GCC-ubsan authors and he said he was okay).  clang with
> ubsan remains broken, but that's no worse than before.

I would rather see GCC's documentation explicitly state that
-fwrapv means a dialect where [among other things] shifts of
signed integers have 2s-complement behaviour, and ditto
clang, before we accept this patch. (Or at least have those
documentation fixes in the works.)

I don't mind if there are still unsuppressed warnings with
older compilers. What I want is a clear statement in the
docs for both compilers that -fwrapv gives us the semantics
we're trying to rely on.

thanks
-- PMM

  reply	other threads:[~2015-11-25 19:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 17:19 [Qemu-devel] [PULL 0/9] Misc patches for QEMU 2.5-rc2 (2015-11-25) Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 1/9] MAINTAINERS: Update TCG CPU cores section Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values Paolo Bonzini
2015-11-25 17:44   ` Peter Maydell
2015-11-25 17:50     ` Paolo Bonzini
2015-11-25 19:18       ` Peter Maydell [this message]
2015-11-25 19:30         ` Paolo Bonzini
2015-11-25 19:54           ` Peter Maydell
2015-11-25 21:05             ` Paolo Bonzini
2015-11-25 21:22               ` Peter Maydell
2015-11-25 17:19 ` [Qemu-devel] [PULL 3/9] call bdrv_drain_all() even if the vm is stopped Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 4/9] Revert "exec: silence hugetlbfs warning under qtest" Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 5/9] exec: remove warning about mempath and hugetlbfs Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 6/9] target-sparc: fix 32-bit truncation in fpackfix Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 7/9] target-i386: kvm: Abort if MCE bank count is not supported by host Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 8/9] target-i386: kvm: Use env->mcg_cap when setting up MCE Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 9/9] target-i386: kvm: Print warning when clearing mcg_cap bits Paolo Bonzini
2015-11-26  9:46 ` [Qemu-devel] [PULL 0/9] Misc patches for QEMU 2.5-rc2 (2015-11-25) Peter Maydell
2015-11-26 10:40   ` Paolo Bonzini
2015-11-26 10:56     ` Peter Maydell
2015-11-26 11:23       ` Paolo Bonzini
2015-11-26 11:28         ` Peter Maydell
2015-11-26 12:15           ` Markus Armbruster
2015-11-26 12:19             ` Peter Maydell
2015-11-26 13:07               ` Paolo Bonzini
2015-11-26 13:04           ` Paolo Bonzini
2015-11-26 15:01             ` Peter Maydell
2015-11-26 15:40               ` Paolo Bonzini
2015-11-26 15:55                 ` Peter Maydell
2015-11-26 16:06                   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8LRY8Fi=AzBzQi4SX43AiWBi6p==4_JAssKUyK9Z98CA@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).