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.


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 here. */


Code that runs in-between find_reloads and the alteration of all pseudos into hard
regs has to be careful not to produce a subreg of a reg that will get replaced by
a mem.




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