tcg/mips: Fix type of tcg_target_reg_alloc_order[]
PATCH 1/1 tcg/mips: Fix type of tcg_target_reg_alloc_order[]
The MIPS TCG backend is the only one to have tcg_target_reg_alloc_order[] elements of type TCGReg rather than int. This resulted in commit 91478cefaaf2 ("tcg: Allocate indirect_base temporaries in a different order") breaking the build on MIPS since the type differed from indirect_reg_alloc_order[]:
tcg/tcg.c:1725:44: error: pointer type mismatch in conditional expression [-Werror]
order = rev ? indirect_reg_alloc_order : tcg_target_reg_alloc_order;
^Make it an array of ints to fix the build and match other architectures.
--- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/mips/tcg-target.inc.c +1 -1
@@ -76,7 +76,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {#define TCG_TMP1 TCG_REG_T9/* check if we really need so many registers :P */ -static const TCGReg tcg_target_reg_alloc_order[] = { +static const int tcg_target_reg_alloc_order[] = {/* Call saved registers. */ TCG_REG_S0 ,TCG_REG_S1 ,
Signature · 1 line
2.4.10
Quoted 12 lines · James Hogan
The MIPS TCG backend is the only one to have tcg_target_reg_alloc_order[] elements of type TCGReg rather than int. This resulted in commit
91478cefaaf2("tcg: Allocateindirect_basetemporaries in a different order") breaking the build on MIPS since the type differed from indirect_reg_alloc_order[]:
tcg/tcg.c:1725:44: error: pointer type mismatch in conditional expression [-Werror]order = rev ? indirect_reg_alloc_order : tcg_target_reg_alloc_order; ^Make it an array of ints to fix the build and match other architectures.
Quoted 7 lines
Fixes 91478cefaaf2 ("tcg: Allocate indirect_base temporaries in a different order")Signed-off-by James Hogan<[email protected]>Cc Aurelien Jarno<[email protected]>Cc Richard Henderson<[email protected]>--- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Sorry, I've had the same fix queued for some time, but have failed to include it in a tcg pull. I'll rectify that soon.
r~
Quoted 25 lines · James Hogan
The MIPS TCG backend is the only one to have tcg_target_reg_alloc_order[] elements of type TCGReg rather than int. This resulted in commit
91478cefaaf2("tcg: Allocateindirect_basetemporaries in a different order") breaking the build on MIPS since the type differed from indirect_reg_alloc_order[]:
tcg/tcg.c:1725:44: error: pointer type mismatch in conditional expression [-Werror]order = rev ? indirect_reg_alloc_order : tcg_target_reg_alloc_order; ^Make it an array of ints to fix the build and match other architectures.
Fixes 91478cefaaf2 ("tcg: Allocate indirect_base temporaries in a different order")Signed-off-by James Hogan <[email protected]>Cc Aurelien Jarno <[email protected]>Cc Richard Henderson <[email protected]>--- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tcg/mips/tcg-target.inc.c +0
-0
tcg/mips/tcg-target.inc.c static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { · line 82
Quoted 8 lines
tcg/mips/tcg-target.inc.c +1
-1@@ -76,7 +76,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {#define TCG_TMP1 TCG_REG_T9/* check if we really need so many registers :P */ -static const TCGReg tcg_target_reg_alloc_order[] = { +static const int tcg_target_reg_alloc_order[] = {/* Call saved registers. */ TCG_REG_S0 ,TCG_REG_S1 ,
Richard, do you have a pending TCG pull request in which you can include this one?
Aurelien
Signature · 2 lines
Aurelien Jarno GPG: 4096R/1DDD8C9B [email protected] http://www.aurel32.net
Quoted 2 lines · Aurelien Jarno
Richard, do you have a pending TCG pull request in which you can include this one?
Nothing pending at the moment, no. I was going to do one special for this, but it looks as if I won't get to it before Sunday at minimum. If you'd like to include it in your own pull, feel free.
r~