From: Cornelia Huck <cohuck@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [Qemu-devel] [PATCH v2] kvm: workaround build break on gcc-7.1.1 / fedora26
Date: Mon, 7 Aug 2017 14:16:45 +0200 [thread overview]
Message-ID: <20170807141645.3392b3bf@gondolin> (raw)
In-Reply-To: <150210580404.1343.7325713896658799315.stgit@bahia.lan>
On Mon, 07 Aug 2017 13:36:44 +0200
Greg Kurz <groug@kaod.org> wrote:
> Building QEMU on fedora26 with the latest gcc package fails:
>
> CC ppc64-softmmu/target/ppc/kvm.o
> In file included from include/sysemu/hw_accel.h:16:0,
> from target/ppc/kvm.c:31:
> target/ppc/kvm.c: In function ‘kvmppc_booke_watchdog_enable’:
> include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
> cap.args[i] = args_tmp[i]; \
> ^
> target/ppc/kvm.c: In function ‘kvmppc_set_papr’:
> include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
> cc1: all warnings being treated as errors
>
> $ rpm -q gcc
> gcc-7.1.1-3.fc26.ppc64le
>
> The compiler should obviously optimize this code away when no extra
> agument is passed to kvm_vm_enable_cap() and kvm_vcpu_enable_cap(),
> but it doesn't. This bug should be fixed one day in gcc, but we can
> also change our code pattern so that we don't hit the issue anymore.
> We workaround this, by using memcpy() instead of open-coding the copy.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> v2: - use memcpy()
> ---
> include/sysemu/kvm.h | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
Acked-by: Cornelia Huck <cohuck@redhat.com>
prev parent reply other threads:[~2017-08-07 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 11:36 [Qemu-devel] [PATCH v2] kvm: workaround build break on gcc-7.1.1 / fedora26 Greg Kurz
2017-08-07 11:55 ` Paolo Bonzini
2017-08-07 14:06 ` Philippe Mathieu-Daudé
2017-08-07 12:16 ` Cornelia Huck [this message]
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=20170807141645.3392b3bf@gondolin \
--to=cohuck@redhat.com \
--cc=f4bug@amsat.org \
--cc=groug@kaod.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).