[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] alpha: Fix build error for linux-user
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] alpha: Fix build error for linux-user |
Date: |
Thu, 16 Jun 2016 12:07:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 06/16/2016 11:56 AM, Pranith Kumar wrote:
> Using gcc 6.1 for alpha-linux-user target we see the following build
> error:
>
> /mnt/devops/code/qemu/target-alpha/translate.c: In function ‘in_superpage’:
> /mnt/devops/code/qemu/target-alpha/translate.c:454:52: error: self-comparison
> always evaluates to true [-Werror=tautological-compare]
> && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
>
> Fix it by replacing (addr >> 63) by '1' which is what it evaluates to
> since addr is negative.
>
> Signed-off-by: Pranith Kumar <address@hidden>
> ---
> target-alpha/translate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index f9b2426..31da6ea 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -451,7 +451,7 @@ static bool in_superpage(DisasContext *ctx, int64_t addr)
> return ((ctx->tb->flags & TB_FLAGS_USER_MODE) == 0
> && addr < 0
> && ((addr >> 41) & 3) == 2
> - && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
> + && addr >> TARGET_VIRT_ADDR_SPACE_BITS == 1);
> }
This fix is incorrect.
(1) addr is not always negative.
(2) in_superpage is only relevant for alpha-softmmu, where
TARGET_VIRT_ADDR_SPACE_BITS is not 63.
r~