From: Julian Seward Date: Mon, 28 Mar 2005 00:46:27 +0000 (+0000) Subject: more icc -Wall cleanups X-Git-Tag: svn/VALGRIND_3_0_1^2~226 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5fe8ce34257a35a79f369416ea1a8702b75c327;p=thirdparty%2Fvalgrind.git more icc -Wall cleanups git-svn-id: svn://svn.valgrind.org/vex/trunk@1108 --- diff --git a/VEX/priv/guest-amd64/toIR.c b/VEX/priv/guest-amd64/toIR.c index e3ca9a7040..8016801dfd 100644 --- a/VEX/priv/guest-amd64/toIR.c +++ b/VEX/priv/guest-amd64/toIR.c @@ -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( diff --git a/VEX/priv/guest-ppc32/toIR.c b/VEX/priv/guest-ppc32/toIR.c index a7e0d860de..5701f01a69 100644 --- a/VEX/priv/guest-ppc32/toIR.c +++ b/VEX/priv/guest-ppc32/toIR.c @@ -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) diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index c1d1767d9f..cd221c0469 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -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. */ diff --git a/VEX/priv/host-generic/reg_alloc2.c b/VEX/priv/host-generic/reg_alloc2.c index fbbde4ec1a..d294f3d64b 100644 --- a/VEX/priv/host-generic/reg_alloc2.c +++ b/VEX/priv/host-generic/reg_alloc2.c @@ -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; */ diff --git a/VEX/priv/host-ppc32/isel.c b/VEX/priv/host-ppc32/isel.c index a9bbd7c666..9ad2d8fea7 100644 --- a/VEX/priv/host-ppc32/isel.c +++ b/VEX/priv/host-ppc32/isel.c @@ -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) )); } diff --git a/VEX/pub/libvex_basictypes.h b/VEX/pub/libvex_basictypes.h index 88aa0fc54d..db191efa74 100644 --- a/VEX/pub/libvex_basictypes.h +++ b/VEX/pub/libvex_basictypes.h @@ -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;