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: [PATCH PR62151]Fix uninitialized register issue caused by distribute_notes in combine pass


On Wed, Sep 03, 2014 at 10:34:39AM +0800, Bin.Cheng wrote:
> >> Now I guess this check could be relaxed if somewhere else in combine we'd
> >> recognize the substitution into a clobber and simply omit it in that case.
> >
> > Yeah.
> >
> > In the testcase, combine tries combining 76,77 (77 is that clobbering
> > insn) and refuses it; then it tries 32,76,77 and refuses it; and then
> > it tries 32,76,77,43 and allows it (it doesn't do this check at all,
> > 77 is not i3, combine omits the clobber completely).  Which is inconsistent.
> 
> I guess it makes sense because this way it doesn't introduce any
> invalid instructions.  But yes, how combine handles the clobber in
> this way may help combine the three instructions?

Combine could just throw away all clobbers on i3 and add them back if
wanted by the combined insn.  I think it does things the way it does so
that it creates slightly less garbage RTL and/or it is a little less work.
But it does disallow this case; easily fixed, have patch, will post in a
minute.

That will hide your problem, but not really fix it I think.  Maybe we
need to disallow all combos that set the same register twice in four-insn
combinations.  Or at least when that register does not die.  Why is this
combination tried anyway?  r84 (as set in 77, used in 43) does not die,
so this is just doing a very expensive very limited form of un-cse?


Segher


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