This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to handle subreg(mem(X)) after reload?
- From: Robert Baruch <autophile at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>, Robert Baruch <autophile at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 11 Jan 2005 14:38:01 -0500
- Subject: Re: How to handle subreg(mem(X)) after reload?
- References: <bbac368c050110075438b1ed57@mail.gmail.com> <20050111060505.GA26751@redhat.com>
- Reply-to: Robert Baruch <autophile at gmail dot com>
> > 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.
I stepped through reload where the original instruction P122.0 <- 0 is
handled. It gets broken into two instructions as it should, W <- 0 and
P122.0 <- W. Then, GCC apparently goes through all of the pseudos,
replacing them blindly with their memory equivalents. Thus, P122.0 <-
W gets replaced by [FP+104].0 <- W.
Then GCC, dies at reload1.c line 1206:
/* And simplify (subreg (reg)) if it appears as an operand. */
cleanup_subreg_operands (insn);
Well, of course at this point, the insn is a subreg(mem), not a
subreg(reg). The very first line in cleanup_subreg_operands calls
extract_insn_cached, which calls extract_insn, which calls
recog_memoized, which calls recog, which doesn't recognize subreg(mem)
anywhere, since I don't have a subreg(mem) anywhere in the md file.
That's why I was asking, where does GCC replace subreg(mem(BP+offset)
x) with mem(BP+offset+x), since GCC doesn't seem to even attempt it
anywhere.
Thanks for your help!
--Rob