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]
Other format: [Raw text]

Re: RFA: remove clobber test from reg_used_between_p


Ian Lance Taylor wrote:

This raises the question: what is the real difference betwen
reg_referenced_p and reg_overlap_mentioned_p? reg_referenced_p mostly
just calls reg_overlap_mentioned_p. Is there any case in which the
two functions would return different values? Why do we have both?
The similarity seems to extend back to the beginning of source code
control in 1991.


Indeed, this seems to be a real can of worms.

reg_overlap_mentioned_p handles SETs intelligently only where it uses
refers_to_regno_p.  I.e., it will consider a SET of a MEM to depend on any
MEM.  The refers_to_regno_p subreg handling appears to confuse  SUBREG
with STRICT_LOW_PART.

reg_referened_p can only handle an instruction body, i.e. what you get with
the PATTERN macro. It has a switch statement to handle the various possibilities,
thus avoiding recursion into irrelevant vectors. However, it has a default: return 0;
clause, which seems somewhat dangerous.
CLOBBERs of subregs are not considered to be a reference. A SET_DEST to
set a subreg that has the same number of words as its SUBREG_REG is not
considered a reference.


For that matter, in the MEM case in reg_overlap_mentioned_p, why do we
not check for 'E' codes?



Huh? But we do!


         else if (fmt[i] == 'E')
           {
             int j;
             for (j = XVECLEN (in, i) - 1; j >= 0; --j)
               if (reg_overlap_mentioned_p (x, XVECEXP (in, i, j)))
                 return 1;

Anyhow, this patch is simple, should cause no harm, and may help a
little bit. Approved.


Thanks, I've checekd it in.


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