This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Need advice on bounds checking approaches
- To: Greg McGary <gkm at eng dot ascend dot com>
- Subject: Re: Need advice on bounds checking approaches
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 24 Mar 2000 17:09:13 -0700
- cc: Joern Rennecke <amylaar at cygnus dot co dot uk>, gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <msitycyuyg.fsf@gkm-dsl-194.ascend.com>you write:
> I am aware of HAVE_check_bounds. Unfortunately, it doesn't do what I
> want. If HAVE_check_bounds, I could generate "check_bounds", and if
> ! HAVE_check_bounds, I could generate the primitive RTL (compares +
> conditional branches + abort). If ! HAVE_check_bounds, then I lose
> the ability to conveniently optimize away redundant checks, and my
> basic blocks get sliced up by the presence of extra branches.
>
> What I want is to always generate check_bounds insns, always optimize
> away redundant checks the same way, and then provide a default
> *expansion* if the MD doesn't define one.
>
> Is that feasible, or am I dreaming?
Right now, you're dreaming.
We have kicked around the idea of two levels of RTL where we do some
optimizations on the higher level RTL, then drop down to a lower level
RTL.
Maybe it would make sense to do your optimizations at the tree level? We're
working on functions-as-trees for the C front-end. Just a thought.
jeff
>
> Greg
>