This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

error: unrecognizable insn:


Dear All,
We are porting the gcc 4.8.1 for our private target .
The compiler pops up with below error .

error: unrecognizable insn:

(insn 22 21 32 6 (set (reg:HI 30 [ D.1532 ])
        (plus:HI (symbol_ref:HI ("stringArray")  <var_decl 0xb751a228
stringArray>)
            (const_int -1 [0xffffffff]))) -1
     (nil))
altcon_014.c:130:1: internal compiler error: in extract_insn, at recog.c:2150
0x836b497 _fatal_insn(char const*, rtx_def const*, char const*, int,
char const*)
        ../../../src/gcc-4.8.1/gcc/rtl-error.c:109
0x836b4e1 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../../src/gcc-4.8.1/gcc/rtl-error.c:117
0x8345974 extract_insn(rtx_def*)
        ../../../src/gcc-4.8.1/gcc/recog.c:2150
0x825072e instantiate_virtual_regs_in_insn
        ../../../src/gcc-4.8.1/gcc/function.c:1561
0x825072e instantiate_virtual_regs
        ../../../src/gcc-4.8.1/gcc/function.c:1928

The below is the movhi template defined  in the md file  for  a
HImode operation

define_insn "*movhi"
  [(set (match_operand:HI 0 "general_mov_lhs_operand" "=r,=r,=r,=r,R,A,=b,=r")
        (match_operand:HI 1 "general_mov_operand" "r,R ,A ,I ,r,r,S,S"))]

and respective  predicates are defined  as

(define_predicate "general_mov_lhs_operand"
  (match_code "mem,reg,subreg,const")
{
  /* Any (MEM LABEL_REF) is OK.  That is a pc-relative load.  */
  if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF)
    return 1;
  /* (MEM SYMBOL_REF) */
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
        return 1;
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == CONST_INT)
        return 1;
  return nonimmediate_operand(op,mode);
})

(define_predicate "general_mov_operand"
  (match_code "mem,reg,subreg,symbol_ref,label_ref,const,plus,const_int,const_double")
{
  /* Any (MEM LABEL_REF) is OK.  That is a pc-relative load.  */
  if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF)
    return 1;
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == CONST_INT)
        return 1;
  /* (MEM SYMBOL_REF) */
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
        return 1;
  return general_operand (op, mode);
})

If we modified the general_mov_operand predicate as

(define_predicate "general_mov_operand"
  (match_code "mem,reg,subreg,symbol_ref,label_ref,const,plus,const_int,const_double")
{
  /* Any (MEM LABEL_REF) is OK.  That is a pc-relative load.  */
  if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF)
    return 1;
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == CONST_INT)
        return 1;
  /* (MEM SYMBOL_REF) */
  else if(GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
        return 1;
  else if(GET_CODE (op) == PLUS  && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
        return 1;

  return general_operand (op, mode);
})


The compilation goes smooth ,but Iâm not sure why  the general_operand
couldnât match the error insn.

Any pointer will be appreciate and did our changes to the  predicate
file make  any sense ?

Thank you in advance
~Umesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]