From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg McGary To: law@cygnus.com Cc: Joern Rennecke , gcc@gcc.gnu.org Subject: Re: Need advice on bounds checking approaches Date: Sun, 09 Apr 2000 16:26:00 -0000 Message-id: References: <5150.955299145@upchuck> X-SW-Source: 2000-04/msg00157.html Jeffrey A Law writes: > > It is very easy to eliminate redundant checks at the end of the main > > loop in combine_instructions: > This looks very compile-time expensive since you have to walk the LOG_LINKs > chain all the way back to the top of the dependency chain. I'll look for a cheaper way to do this. > Presumably you're trying to delete one conditional trap that is subsumed by > an earlier conditional trap? I'm not sure what you mean by "subsumed" in this context. What I'm trying to optimize is this case: if (x) p->a = 1; p->b = 2; p->c = 3; p->d = 4; p++; p->e = 5; p->f = 6; p->g = 7; p->h = 8; Without optimization, the bounds of `p' are checked eight times, once per `->' operator. The necessary checks are at `p->a = 1', `p->b = 2', `p->e = 5'; the rest are redundant and should be deleted. p->a is separated from the others by a BB boundary, so there's nothing special here. p->b .. p->h are in the same BB, but p->e .. p->h have LOG_LINKS that point to the increment of p.value, and so differ from p->a .. p->d. > If so, that might be best modeled after an > identical optimization we do on jumps. See jump.c Would you kindly give a more specific clue about where to look in jump.c?