PATCH to implement `restrict' in C

Richard Henderson rth@cygnus.com
Fri Oct 16 04:10:00 GMT 1998


On Thu, Oct 15, 1998 at 08:38:09PM +0200, Jan Hubicka wrote:
> I believe that it should be possible to make gcc to take advantage of
> some simple assertions (like assert(a>0);) and should bring quite clean
> and natural way how to write informations to optimizer... Gcc actually
> does it in conditions, so makng assertions act like "conditions" should
> do the job.

If we had full value-range propagation, we would get this with the 
default macro version -- at least if it isn't NDEBUG'ed out.  This
because we'd see

	if (a < 0) { noreturn_function(); }

and so `a >= 0' would naturally be propagated to the `else' part
of the `if', which in this case is the rest of the cfg dominated
by the test.

The notion of having assert() expand to non-null when NDEBUG is
defined is an interesting twist...


r~



More information about the Gcc mailing list