This is the mail archive of the
mailing list for the GCC project.
Re: How to handle subreg(mem(X)) after reload?
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 11 Jan 2005 20:38:50 +0000
- Subject: Re: How to handle subreg(mem(X)) after reload?
> > I'm having a problem with a subreg(mem(X)) insn being generated as a
> > result of reload.
> Whatever created that subreg, and didn't resolve it, is the bug.
I know, but it doesn't look like GCC has the chance anywhere to resolve it.
in reload.c:find_reloads_toplev, look for this comment:
/* If the subreg contains a reg that will be converted to a mem,
convert the subreg to a narrower memref now.
Otherwise, we would get (subreg (mem ...) ...),
which would force reload of the mem.
We also need to do this if there is an equivalent MEM that is
not offsettable. In that case, alter_subreg would produce an
invalid address on big-endian machines.
For machines that extend byte loads, we must not reload using
a wider mode if we have a paradoxical SUBREG. find_reloads will
force a reload in that case. So we should not do anything
Code that runs in-between find_reloads and the alteration of all pseudos
regs has to be careful not to produce a subreg of a reg that will get