From a4997bf3d952f904bce824ee3e8f3e12e8524071 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Wed, 26 Jun 2019 05:43:47 +0200 Subject: [PATCH] Inverse last intr test so that function always returns. This prevents warning as found with gcc 8.3 and it matches other function styles doing the same in ARM generator. --- arm-gen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arm-gen.c b/arm-gen.c index abc0942..b93d298 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -404,9 +404,9 @@ static uint32_t intr(int r) return 12; if(r >= TREG_R0 && r <= TREG_R3) return r - TREG_R0; - if (r >= TREG_SP && r <= TREG_LR) - return r + (13 - TREG_SP); - tcc_error("compiler error! register %i is no int register",r); + if (!(r >= TREG_SP && r <= TREG_LR)) + tcc_error("compiler error! register %i is no int register",r); + return r + (13 - TREG_SP); } static void calcaddr(uint32_t *base, int *off, int *sgn, int maxoff, unsigned shift)