Duncan Sands wrote:
The C front-end performs this transformation too. I'm not claiming that the
back-end optimizers would actually do something sensible if the front-end
didn't transform this code (in fact they don't seem too), but since the
optimal way of doing the check presumably depends on the target, wouldn't
it make sense if the backend took care of it?
Remember that not all GNAT backends use GCC, so sometimes we do
optimizations in the front end rather than duplicate the code in
each of our back ends (JGNAT, Dotgnat (the .Net version), AAMP,
and maybe more in the future, who knows?)