This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in reload_cse_move2add()
- To: rearnsha at arm dot com
- Subject: Re: Bug in reload_cse_move2add()
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 16 Jan 2001 20:45:43 -0200
- Cc: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>, Joern Rennecke <amylaar at redhat dot com>, gcc-patches at gcc dot gnu dot org, law at redhat dot com
- Organization: GCC Team, Red Hat
- References: <200101162224.WAA05218@cam-mail2.cambridge.arm.com>
On Jan 16, 2001, Richard Earnshaw <rearnsha@arm.com> wrote:
> The problem is that when we derive an increment from another expression we
> copy the base_reg information, but then keep only the offset if the other
> base_reg is not itself derived from another value. This makes the
> derivation appear to be for a constant.
I see. Your change looks right, but I'd rather make it indeed look
like a constant, which it indeed is.
/* If our base register is based on some other register, compute
the sum of the offsets (even if the base register was a
constant, in which case we're going to be a constant too).
Otherwise, use the offset of the current insn only. */
if (reg_offset[base_regno]
&& GET_CODE (reg_offset[base_regno]) == CONST_INT)
reg_offset[regno]
= plus_constant (offset, INTVAL (reg_offset[base_regno]));
else
reg_offset[regno] = offset;
Note that the problem of not tracking a back jump doesn't affect us
here; if there is a back jump, there must be a label, and if there is
a label between the initial constant assignment and the copy plus
offset, we'll ``forget'' it was constant because it crosses a label.
If the constant and the copy are within the same basic block, we're
fine.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me