This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE on user view-conversion (v2)
- From: Richard Henderson <rth at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, bernd dot schmidt at analog dot com, aoliva at redhat dot com
- Date: Fri, 26 Sep 2008 14:16:28 -0700
- Subject: Re: [PATCH] Fix ICE on user view-conversion (v2)
- References: <200809262140.10455.ebotcazou@adacore.com>
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~