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



Bernd --

  Here's a none-too-substantive comment on your patch. :-)

  + /* 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;
  + }
  + 

I'd rather use a struct here rather than a global.  The whole point of
adding the `void *' argument `note_stores' was to avoid globals; they
make analyzing what's going on unduly difficult, non-reentrant, etc.
I think it would be nicer to make an itty-bitty struct to hold reg and
set_seen.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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