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: miscompiled loop condition



  In message <Pine.LNX.4.04.9911291403250.16486-100000@pathia.cygnus.co.uk>you 
write:
  > It is now restricted to extended basic blocks.  The way the loop optimizer
  > is written (no good information about control flow available) makes it hard
  > to do better. 
FWIW, this will be changing soon [ see recent submissions from Michael Hayes].

When I first started looking at this problem I seriously considered building
a cfg for the loop, then calling into the global cprop optimizer.  But we're
not at a point where we can do that (yet).  But that may be the long term
direction depending on its cost.

  > I'd like to install this variant of the testcase in the testsuite.  OK?
Yes.  Please do.


  > + /* For communication between note_reg_stored and its caller.  */
  > + static int set_seen;
  > + 
  > + /* Called via note_stores, record in SET_SEEN whether X, which is written
  > ,
  > +    is equal to ARG.  */
  > + static void
  > + note_reg_stored (x, setter, arg)
  > +      rtx x, setter;
  > +      void *arg;
  > + {
  > +   rtx reg = (rtx) arg;
  > +   if (arg == x)
  > +     set_seen = 1;
  > + }
As Mark mentioned, you might as well pass in a structure, then set the
return value via that structure.  Also, mark setter with ATTRIBUTE_UNUSED.

Maybe I'm missing something, but if you stop replacing when you hit a
label (end of extended basic block), what happens to uses *after* that point?

jeff


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