qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Richard Henderson <rth@twiddle.net>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] libvixl: Add gcc format attribute
Date: Wed, 18 Jun 2014 19:27:52 +0200	[thread overview]
Message-ID: <53A1CC18.2000203@weilnetz.de> (raw)
In-Reply-To: <53A1ADE8.3010800@twiddle.net>

Am 18.06.2014 17:19, schrieb Richard Henderson:
>
> On 06/17/2014 09:45 PM, Stefan Weil wrote:
>>
>> Variable arguments usually are not converted to 64 bit values: if
>> they are smaller than int, they are expanded to int, and larger
>> values are passed as they are. But here obviously the compiler
>> expands uint32_t to int64_t. Why?
>
> They really really shouldn't be. It might be worth trying something
> more recent than 4.6.3, and if it persists file a bug. r~

I found the source of the problem.

The compiler is correct. Eight format strings in
disas/libvixl/a64/disasm-a64.cc are wrong.

The functions which are called don't come from
disas/libvixl/a64/assembler-a64.h as I expected.
They are generated by code in disas/libvixl/a64/instructions-a64.h:

  #define DEFINE_GETTER(Name, HighBit, LowBit, Func)             \
  inline int64_t Name() const { return Func(HighBit, LowBit); }
  INSTRUCTION_FIELDS_LIST(DEFINE_GETTER)
  #undef DEFINE_GETTER

So each of those functions really returns an int64_t which of course
should not use a "%d" format string.

Stefan

  reply	other threads:[~2014-06-18 17:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 21:07 [Qemu-devel] [PATCH] libvixl: Add gcc format attribute Stefan Weil
2014-06-17 22:09 ` Peter Maydell
2014-06-18  4:16   ` Stefan Weil
2014-06-18  4:28 ` Richard Henderson
2014-06-18  4:31   ` Stefan Weil
2014-06-18  4:45     ` Stefan Weil
2014-06-18  8:26       ` Peter Maydell
2014-06-18 14:52       ` Paolo Bonzini
2014-06-18 15:19       ` Richard Henderson
2014-06-18 17:27         ` Stefan Weil [this message]
2014-06-18 17:33           ` Peter Maydell
2014-06-18 17:43           ` Peter Maydell

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=53A1CC18.2000203@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).