This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix ICE on user view-conversion (v2)


Eric Botcazou wrote:
  /* As an optimization, reject constants that mips_legitimize_move
     can expand inline.

     Suppose we have a multi-instruction sequence that loads constant C
     into register R.  If R does not get allocated a hard register, and
     R is used in an operand that allows both registers and memory
     references, reload will consider forcing C into memory and using
     one of the instruction's memory alternatives.  Returning false
     here will force it to use an input reload instead.  */
  if (GET_CODE (x) == CONST_INT && LEGITIMATE_CONSTANT_P (x))
    return true;

I think this is a bug in the mips port. And looking closer, in the bfin and frv ports as well. Everyone else appears to actually identify those constants that *can't* go to memory. In particular, I don't see CONST_INT, CONST_DOUBLE, or CONST_VECTOR being rejected.

These 3 ports are all assuming that force_const_mem is only called
by reload to push non-legitimate constants to memory.  There are
clearly other applications.  This is one; there are several others.

Another option for these ports is if we add another parameter that
specifies that this is being called from reload.  Though, knowing
reload there's probably a cleaner way to handle that.


r~



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