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]

no_new_pseudos == 1 and force_reg



Hi All
 I am thomas and I am attempting to finish a gcc port
for an embedded processor.

 I encountered a strange behaviour in gcc, when I try
to compile newlib. 

  My target allows  loads/stores from/to memory
through
a register only. So, I have defined  "movhi" pattern
in md file like this.

(define_expand "movhi"
  [(set (match_operand:HI 0 "nonimmediate_operand" "")
    (match_operand:HI 1 "general_operand" ""))]
  ""
  "
{
  /* Don't generate memory->memory moves, go through a
register */
  if (no_new_pseudos == 0
      && GET_CODE (operands[0]) == MEM
      && (GET_CODE (operands[1]) == MEM)
           || GET_CODE (operands[1]) == CONST_INT))
     {
      operands[1] = force_reg (HImode, operands[1]);
    }
  else
     abort (); //to check ....
}")


 But while building newlib it says 

  internal_compiler_error in emit_insn.c in gen_movhi.
So, where could be the possible mistake I must have
made. 

(This error comes For int to memory moves.
   (my observation))


 Some body addressed this issue in sh port. But it's
not quite clear why I one will get an error ??

Can somebody tell me where I am supposed to look for
this problem. 


Thanks and regards

-Thomas










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