From f904465e9c2dbc1cb5aec0e4c0ad5e375d3043ed Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 22 May 2013 00:16:16 +0100 Subject: [PATCH] Fix signedness problem that was showing up on ARM. --HG-- branch : dtrg-videocore --- mach/vc4/as/mach5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mach/vc4/as/mach5.c b/mach/vc4/as/mach5.c index b1ce314bc..f3671bf64 100644 --- a/mach/vc4/as/mach5.c +++ b/mach/vc4/as/mach5.c @@ -5,6 +5,8 @@ * See the file 'Copying' in the root of the distribution for the full text. */ +#include + #define maskx(v, x) (v & ((1<<(x))-1)) static void toobig(void) @@ -120,7 +122,7 @@ void branch_instr(int bl, int cc, struct expr_t* expr) /* The VC4 branch instructions express distance in 2-byte * words. */ - int d = (expr->val - pc) / 2; + int d = ((int32_t)expr->val - (int32_t)pc) / 2; /* We now know the worst case for the instruction layout. At * this point we can emit the instructions, which may shrink -- 2.34.1