This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: miscompiled loop condition
- To: bernds at pathia dot cygnus dot co dot uk
- Subject: Re: miscompiled loop condition
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 29 Nov 1999 07:57:22 -0800
- Cc: moshier at mediaone dot net, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.20.9911251315180.5076-100000@moshier.ne.mediaone.net><Pine.LNX.4.04.9911291403250.16486-100000@pathia.cygnus.co.uk>
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