> Funny you should say that, because the Ada front-end likes to do this > transformation, rather than leaving it to the back-end. For example: > > turns into > > if ((unsigned int) ((integer) x - 10) <= 10)
The front end isn't doing this: the routine "fold" in fold-const.c is. True, it's being *called* by the front-end, but it's very definitely common code. See -gnatdg if you want to know what transformations the Ada front end if making. > The C front-end performs this transformation too. See above. ;-) > I'm not claiming that the back-end optimizers would actually do > something sensible if the front-end didn't transform this code I consider the optimizer that does this part of the middle-end (which is really what you mean, not "back end").