target-alpha: Avoid gcc 6.1 werror for linux-user
PATCH 1/1 target-alpha: Avoid gcc 6.1 werror for linux-user
Using gcc 6.1 for alpha-linux-user target we see the following build error:
.../target-alpha/translate.c: In function ‘in_superpage’:.../target-alpha/translate.c:454:52: error: self-comparison always evaluates to true [-Werror=tautological-compare]
&& addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
--- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
target-alpha/translate.c +6 -3
@@ -448,10 +448,13 @@ static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb,static bool in_superpage (DisasContext *ctx,int64_t addr) { +#ifndef CONFIG_USER_ONLY 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 + && ((addr >>41 ) &3 ) ==2 ); +#else +return false; +#endif }static bool use_goto_tb (DisasContext *ctx,uint64_t dest)
Signature · 1 line
2.5.5
Quoted 24 lines · Richard Henderson
Using gcc 6.1 for alpha-linux-user target we see the following build error:
.../target-alpha/translate.c: In function ‘in_superpage’:.../target-alpha/translate.c:454:52: error: self-comparison always evaluates to true [-Werror=tautological-compare]&& addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);Reported-by Pranith Kumar <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)target-alpha/translate.c +1
-1@@ -448,10 +448,13 @@ static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb,static bool in_superpage (DisasContext *ctx,int64_t addr) { +#ifndef CONFIG_USER_ONLY return ((ctx->tb->flags & TB_FLAGS_USER_MODE) == 0 - && addr < 0
target-alpha/translate.c static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb, · line 460
Quoted 10 lines
target-alpha/translate.c +5
-2- && ((addr >>41 ) &3 ) ==2 - && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63); + && addr >>TARGET_VIRT_ADDR_SPACE_BITS ==-1 + && ((addr >> 41) & 3) == 2); +#else +return false; +#endif }static bool use_goto_tb (DisasContext *ctx,uint64_t dest)
Peter, can you apply this as a build-breakage fix? (Fedora 24 is now out and has this bug).
Paolo
Peter Maydell
AppliedQuoted 35 lines · Paolo Bonzini
Quoted 32 lines · Richard Henderson
Using gcc 6.1 for alpha-linux-user target we see the following build error:
.../target-alpha/translate.c: In function ‘in_superpage’:.../target-alpha/translate.c:454:52: error: self-comparison always evaluates to true [-Werror=tautological-compare]&& addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);Reported-by Pranith Kumar <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)target-alpha/translate.c +6
-3@@ -448,10 +448,13 @@ static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb,static bool in_superpage (DisasContext *ctx,int64_t addr) { +#ifndef CONFIG_USER_ONLY 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 + && ((addr >>41 ) &3 ) ==2 ); +#else +return false; +#endif }
Quoted 5 lines
target-alpha/translate.c static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb, · line 460
Quoted 2 lines
target-alpha/translate.c +0
-0static bool use_goto_tb (DisasContext *ctx,uint64_t dest)Peter, can you apply this as a build-breakage fix? (Fedora 24 is now out and has this bug).
Applied to master, thanks.
-- PMM