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

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


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