Browse Source

Change is_macro to return true for A_JAL if in pic mode

Pierre Muller 2 years ago
parent
commit
b8920670f4
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/mips/aasmcpu.pas

+ 3 - 2
compiler/mips/aasmcpu.pas

@@ -262,9 +262,10 @@ end;
         { 'seq', 'sge', 'sgeu', 'sgt', 'sgtu', 'sle', 'sleu', 'sne', }
           (opcode=A_SEQ) or (opcode=A_SGE) or (opcode=A_SGEU) or (opcode=A_SGT) or
           (opcode=A_SGTU) or (opcode=A_SLE) or (opcode=A_SLEU) or (opcode=A_SNE)
-          { JAL is not here! See comments in TCGMIPS.a_call_name. }
+          { JAL is a macro in pic code mode }
+          or ((opcode=A_JAL) and (cs_create_pic in current_settings.moduleswitches))
           or (opcode=A_LA) or ((opcode=A_BC) and
-            not (condition in [C_EQ,C_NE,C_GTZ,C_GEZ,C_LTZ,C_LEZ,C_COP1TRUE,C_COP1FALSE])) {or (op=A_JAL)}
+            not (condition in [C_EQ,C_NE,C_GTZ,C_GEZ,C_LTZ,C_LEZ,C_COP1TRUE,C_COP1FALSE]))
           or (opcode=A_REM) or (opcode=A_REMU)
           { DIV and DIVU are normally macros, but use $zero as first arg to generate a CPU instruction. }
           or (((opcode=A_DIV) or (opcode=A_DIVU)) and