Skip to contentSkip to conversation

target-alpha: Avoid gcc 6.1 werror for linux-user

PATCH Applied Richard Henderson 3 participants 3 messages Jun 17, 2016 – Jun 28, 2016

lore
Share & tools
lore
#0 lore raw

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
index f9b2426..051b4b7 100644
@@ -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
#1 lore raw
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);
---
 target-alpha/translate.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
target-alpha/translate.c +1 -1
index f9b2426..051b4b7 100644
@@ -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

#2 lore raw
Quoted 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);
---
 target-alpha/translate.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
target-alpha/translate.c +6 -3
index f9b2426..051b4b7 100644
@@ -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 -0
 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).

Applied to master, thanks.

-- PMM