Skip to content

Commit

Permalink
tcg/mips: Fix type of tcg_target_reg_alloc_order[]
Browse files Browse the repository at this point in the history
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 91478ce ("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.

Fixes: 91478ce ("tcg: Allocate indirect_base temporaries in a different order")
Signed-off-by: James Hogan <[email protected]>
Acked-by: Aurelien Jarno <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
James Hogan authored and rth7680 committed Apr 5, 2016
1 parent 43b0ea1 commit 2dc7553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcg/mips/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2dc7553

Please sign in to comment.