Need advice on bounds checking approaches

Jeffrey A Law law@cygnus.com
Fri Mar 24 16:18:00 GMT 2000


  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
  > 




More information about the Gcc mailing list