From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDcdn-0007YE-U3 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 15:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDcdj-0007zQ-OS for qemu-devel@nongnu.org; Thu, 16 Jun 2016 15:07:46 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDcdj-0007zM-Jw for qemu-devel@nongnu.org; Thu, 16 Jun 2016 15:07:43 -0400 Received: by mail-qk0-x243.google.com with SMTP id l81so8754822qke.3 for ; Thu, 16 Jun 2016 12:07:43 -0700 (PDT) Sender: Richard Henderson References: <20160616185639.5312-1-bobby.prani@gmail.com> From: Richard Henderson Message-ID: <64e568b4-863d-fa79-185e-0da4c719d10d@twiddle.net> Date: Thu, 16 Jun 2016 12:07:40 -0700 MIME-Version: 1.0 In-Reply-To: <20160616185639.5312-1-bobby.prani@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] alpha: Fix build error for linux-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pranith Kumar , "open list:All patches CC here" 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 > --- > 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~