]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
more icc -Wall cleanups
authorJulian Seward <jseward@acm.org>
Mon, 28 Mar 2005 00:46:27 +0000 (00:46 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 28 Mar 2005 00:46:27 +0000 (00:46 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1108

VEX/priv/guest-amd64/toIR.c
VEX/priv/guest-ppc32/toIR.c
VEX/priv/guest-x86/ghelpers.c
VEX/priv/host-generic/reg_alloc2.c
VEX/priv/host-ppc32/isel.c
VEX/pub/libvex_basictypes.h

index e3ca9a704010ca64e8ec49905762cb4d0c9e4e1d..8016801dfd8fe9c7f49153e4d66d1b149b3f55bd 100644 (file)
@@ -5164,7 +5164,7 @@ ULong dis_FPU ( /*OUT*/Bool* decode_ok,
 
             case 0xC8 ... 0xCF: /* FCMOVNE(NZ) ST(i), ST(0) */
                r_src = (UInt)modrm - 0xC8;
-               DIP("fcmovnz %%st(%d), %%st(0)\n", r_src);
+               DIP("fcmovnz %%st(%u), %%st(0)\n", r_src);
                put_ST_UNCHECKED(
                   0, 
                   IRExpr_Mux0X( 
@@ -5178,7 +5178,7 @@ ULong dis_FPU ( /*OUT*/Bool* decode_ok,
 
             case 0xD0 ... 0xD7: /* FCMOVNBE ST(i), ST(0) */
                r_src = (UInt)modrm - 0xD0;
-               DIP("fcmovnbe %%st(%d), %%st(0)\n", r_src);
+               DIP("fcmovnbe %%st(%u), %%st(0)\n", r_src);
                put_ST_UNCHECKED(
                   0, 
                   IRExpr_Mux0X( 
index a7e0d860dea252e2776efa3b3690b22522b8935a..5701f01a69860dba60f8f6b0a2fc52ee01cf60c1 100644 (file)
@@ -380,7 +380,7 @@ IRBB* bbToIR_PPC32 ( UChar*           ppc32code,
          vassert(irbb->next == NULL);
          /* figure out a new delta to continue at. */
          vassert(chase_into_ok(guest_next));
-         delta = (UInt)(guest_next - guest_pc_start);
+         delta = toUInt(guest_next - guest_pc_start);
          n_resteers++;
          d_resteers++;
          if (0 && (n_resteers & 0xFF) == 0)
index c1d1767d9fe0bf82857420f9d338964f18a7c3df..cd221c04695151eaee4cdb15a3cfb5f9619c4480 100644 (file)
@@ -1070,12 +1070,12 @@ IRExpr* guest_x86_spechelper ( HChar* function_name,
 
    if (vex_streq(function_name, "x86g_calculate_eflags_all")) {
       /* specialise calls to above "calculate_eflags_all" function */
-      IRExpr *cc_op, *cc_dep1, *cc_dep2, *cc_ndep;
+      IRExpr *cc_op, *cc_dep1; /*, *cc_dep2, *cc_ndep; */
       vassert(arity == 4);
       cc_op   = args[0];
       cc_dep1 = args[1];
-      cc_dep2 = args[2];
-      cc_ndep = args[3];
+      /* cc_dep2 = args[2]; */
+      /* cc_ndep = args[3]; */
 
       if (isU32(cc_op, X86G_CC_OP_COPY)) {
          /* eflags after COPY are stored in DEP1. */
index fbbde4ec1a61decddf3732c181a51d8a008ac30d..d294f3d64b460d4302edfbc7527d5a129887411a 100644 (file)
@@ -432,12 +432,12 @@ HInstrArray* doRegisterAllocation (
                   vpanic("doRegisterAllocation: "
                          "first event for vreg is Read");
                }
-               vreg_lrs[k].dead_before = ii + 1;
+               vreg_lrs[k].dead_before = toShort(ii + 1);
                break;
             case HRmWrite:
                if (vreg_lrs[k].live_after == INVALID_INSTRNO)
-                  vreg_lrs[k].live_after = ii;
-               vreg_lrs[k].dead_before = ii + 1;
+                  vreg_lrs[k].live_after = toShort(ii);
+               vreg_lrs[k].dead_before = toShort(ii + 1);
                break;
             case HRmModify:
                if (vreg_lrs[k].live_after == INVALID_INSTRNO) {
@@ -445,7 +445,7 @@ HInstrArray* doRegisterAllocation (
                   vpanic("doRegisterAllocation: "
                          "first event for vreg is Modify");
                }
-               vreg_lrs[k].dead_before = ii + 1;
+               vreg_lrs[k].dead_before = toShort(ii + 1);
                break;
             default:
                vpanic("doRegisterAllocation(1)");
@@ -528,8 +528,8 @@ HInstrArray* doRegisterAllocation (
             if (0) 
                vex_printf("FLUSH 1 (%d,%d)\n", flush_la, flush_db);
             rreg_lrs[rreg_lrs_used].rreg        = rreg;
-            rreg_lrs[rreg_lrs_used].live_after  = flush_la;
-            rreg_lrs[rreg_lrs_used].dead_before = flush_db;
+            rreg_lrs[rreg_lrs_used].live_after  = toShort(flush_la);
+            rreg_lrs[rreg_lrs_used].dead_before = toShort(flush_db);
             rreg_lrs_used++;
          }
 
@@ -565,8 +565,8 @@ HInstrArray* doRegisterAllocation (
          vex_printf("FLUSH 2 (%d,%d)\n", 
                     rreg_live_after[j], rreg_dead_before[j]);
       rreg_lrs[rreg_lrs_used].rreg        = available_real_regs[j];
-      rreg_lrs[rreg_lrs_used].live_after  = rreg_live_after[j];
-      rreg_lrs[rreg_lrs_used].dead_before = rreg_dead_before[j];
+      rreg_lrs[rreg_lrs_used].live_after  = toShort(rreg_live_after[j]);
+      rreg_lrs[rreg_lrs_used].dead_before = toShort(rreg_dead_before[j]);
       rreg_lrs_used++;
    }
 
@@ -681,7 +681,7 @@ HInstrArray* doRegisterAllocation (
       /* This reflects LibVEX's hard-wired knowledge of the baseBlock
          layout: the guest state, then an equal sized area following
          it for shadow state, and then the spill area. */
-      vreg_lrs[j].spill_offset = guest_sizeB * 2 + k * 8;
+      vreg_lrs[j].spill_offset = toShort(guest_sizeB * 2 + k * 8);
 
       /* if (j > max_ss_no) */
       /*    max_ss_no = j; */
index a9bbd7c666cda16467d2bf06f2e5ca95ef8ecce7..9ad2d8fea7eb73f01d842a97d42be70d798fba07 100644 (file)
@@ -659,7 +659,7 @@ void doHelperCall ( ISelEnv* env,
 
    /* Finally, the call itself. */
    addInstr(env, PPC32Instr_Call( cc,
-                                  Ptr_to_ULong(cee->addr),
+                                  toUInt(Ptr_to_ULong(cee->addr)),
                                   n_args + (passBBP ? 1 : 0) ));
 }
 
index 88aa0fc54d41611ef0fbc9bb2f67fd345d0c57cc..db191efa74b51c3933b8169155d15eea87972492 100644 (file)
@@ -90,6 +90,10 @@ static inline UShort toUShort ( Int x ) {
    x &= 0xFFFF;
    return (UShort)x;
 }
+static inline Short toShort ( Int x ) {
+   x &= 0xFFFF;
+   return (Short)x;
+}
 static inline UInt toUInt ( Long x ) {
    x &= 0xFFFFFFFFLL;
    return (UInt)x;