From: Stefan Weil <weil@mail.berlios.de>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH] [S390] Remove warning in tcg stub (tcg_out_reloc)
Date: Tue, 11 May 2010 18:47:15 +0200 [thread overview]
Message-ID: <4BE98A13.1040103@mail.berlios.de> (raw)
In-Reply-To: <1273595012-19587-1-git-send-email-agraf@suse.de>
Am 11.05.2010 18:23, schrieb Alexander Graf:
> On S390 we don't have a real TCG implementation but use a stub
> instead. This
> stub obviously doesn't call any of the TCG helper functions that are
> usually
> used by the other TCG targets.
>
> If such a helper function is static though, we end up getting a
> warning that
> turns into an error thanks to Werror. So to successfully compile qemu,
> we need
> to get rid of it. In this case it's tcg_out_reloc.
>
> To do that, I figured the easiest way is to call tcg_out_reloc with dumb
> parameters after an abort call. That way the code in question never gets
> executed, but we got rid of the warning.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> tcg/s390/tcg-target.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
> index 265194a..f1a336d 100644
> --- a/tcg/s390/tcg-target.c
> +++ b/tcg/s390/tcg-target.c
> @@ -35,6 +35,12 @@ static void patch_reloc(uint8_t *code_ptr, int type,
> tcg_target_long value, tcg_target_long addend)
> {
> tcg_abort();
> +
> + /*
> + * XXX We need to call this function at least once, since it's static.
> + * Please remove that code when implementing real s390x tcg support.
> + */
> + tcg_out_reloc(NULL, NULL, 0, 0, 0);
> }
>
> static inline int tcg_target_get_call_iarg_regs_count(int flags)
Won't you get another warning about unreachable code
because tcg_abort never returns?
What about condition compilation for tcg_out_reloc
(don't compile it for hosts which don't need it)?
Regards,
Stefan
next prev parent reply other threads:[~2010-05-11 16:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 16:23 [Qemu-devel] [PATCH] [S390] Remove warning in tcg stub (tcg_out_reloc) Alexander Graf
2010-05-11 16:47 ` Stefan Weil [this message]
2010-05-11 17:26 ` Richard Henderson
2010-05-11 19:50 ` Alexander Graf
2010-05-12 17:28 ` Aurelien Jarno
2010-05-12 22:52 ` Alexander Graf
2010-05-21 16:46 ` Aurelien Jarno
2010-05-21 17:00 ` Richard Henderson
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=4BE98A13.1040103@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.