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: law at cygnus dot com
- Subject: Re: Need advice on bounds checking approaches
- From: Greg McGary <gkm at eng dot ascend dot com>
- Date: 27 Mar 2000 14:04:35 -0700
- Cc: Joern Rennecke <amylaar at cygnus dot co dot uk>, gcc at gcc dot gnu dot org
- References: <6462.954188496@upchuck>
Jeffrey A Law <law@cygnus.com> writes:
> > Perhaps I could do that in a limited way, by adding a BP-specific
> > optimization pass after loop optimization that eliminates redundant
> > checks and expands "check_bounds" into primitive RTL for targets that
> > don't HAVE_check_bounds. Could that pass muster?
>
> Possibly. However, I'm not a big fan of having feature specific
> optimization passes, even if we've had some in the past (addressof &
> constant_p).
>
> I'd be much happier if we could find a clean way to get the optimizations
> you need using our existing optimizers.
We can do without a special pass. CSE seems the best place to
eliminate redundant checks, so we'd just need a little bit of code to
handle the new check_bounds_rtx. We can just forget about doing
default translation of check_bounds_rtx into primitive RTL, and
require that targets supporting bounds checking handle it in the
machine description. So far, all of the targets I want to support
initially (i960, PowerPC, i386, MIPS) will benefit from special
handling in the MD file anyway.
Does that sound reasonable?
> > It's a fine thought, but I can't do that today, can I? I only see
> > whole function mode being used for C++ inlines.
>
> That's not my understanding -- you'd probably need to talk to Mark -- I
> was under the impression that we always did function at a time stuff
> for C++.
You're right. I was careless in my initial reading of the condition
surrounding the setting of cfun->x_whole_function_mode_p. Even so,
this doesn't help me for C or ObjC, unless those will be converted
soon.