This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to implement `restrict' in C
- To: Jan Hubicka <hubicka at horac dot ta dot jcu dot cz>, egcs at cygnus dot com
- Subject: Re: PATCH to implement `restrict' in C
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 15 Oct 1998 23:19:14 -0700
- References: <28987.908089172@hurl.cygnus.com> <199810110812.BAA28063@smtp.earthlink.net> <3621C047.56A6@acm.org> <19981015203809.61499@horac.ta.jcu.cz>
- Reply-To: Richard Henderson <rth at cygnus dot com>
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~