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

Re: PATCH: PA PIC symbolic memory fix PART 1


> You also don't explain why IS_RELOADING_PSEUDO_P isn't needed.  It was
> put in there for a reason, you should explain why it isn't needed if
> you're planning to take it out.

Having thought a bit more about this, I believe that I can better explain
why IS_RELOADING_PSEUDO_P isn't needed and is in fact dangerous.

The problem that the patch was intended to fix was the substitution of
MEMs from other insns into the standard movsi/movdi pattern.  It was
noticed first with the LO_SUM PIC reference but I believe it also affects
the PLUS pic reference MEM, and possibly other MEM insns in the machine
definition.

In order to to eliminate pseudos, reload sets up memory equivalents and
makes a pass through the insns in a function to determine whether it can
directly substitute the equivalent in existing instructions.  It does this
by scaning the insn constraints.  If it can't do a direct substitution,
it does spills creating a new insn with a hard reload register and the
pseudo.

The Q constraint as it stands accepts DLT memory references because
the forms used are not checked in symbolic_memory_operand.  In order
to stop the substitution of DLT references, symbolic memory_operand_operand
needs to be revised to detect these references.  When this is done, reload
will generate a spill for a DLT reference rather than just substituting
it directly into a pattern which couldn't handle it.

The comments for IS_RELOADING_PSEUDO_P indicate that the spill would
immediately be re-recognized as a new movsi/movdi pattern.  If this
actually happens, the new insn would spill again in the next pass by
reload through the insns, and this could create an infinite loop.
Instead, we need the spill insn to be re-recognized after the memory
equivalent substitution has been done.  I have verified that this done
correctly and that IS_RELOADING_PSEUDO_P isn't needed.

I hope this helps.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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