To summarize that, I get:
[ibook-dhum] lin/test% gfc -m64 -O2 -funsafe-math-optimizations air.f90
[ibook-dhum] lin/test% time a.out > /dev/null
8.459u 0.046s 0:08.51 99.7% 0+0k 0+7io 0pf+0w
[ibook-dhum] lin/test% gfc -fwhole-file -m64 -O2 -funsafe-math-optimizations air.f90
[ibook-dhum] lin/test% time a.out > /dev/null
8.468u 0.046s 0:08.52 99.7% 0+0k 0+7io 0pf+0w
[ibook-dhum] lin/test% /Volumes/MacBook/opt/gcc/gcc4.5w-do/bin/gfortran -m64 -O2 -funsafe-math-optimizations air.f90
[ibook-dhum] lin/test% time a.out > /dev/null
10.168u 0.046s 0:10.22 99.8% 0+0k 0+9io 0pf+0w
[ibook-dhum] lin/test% /Volumes/MacBook/opt/gcc/gcc4.5w-0/bin/gfortran -m64 -O2 -funsafe-math-optimizations air.f90
[ibook-dhum] lin/test% time a.out > /dev/null
8.407u 0.045s 0:08.46 99.7% 0+0k 0+8io 0pf+0w
where gcc4.5w-do is with your patch and gcc4.5w-0 is with
a '0 && ' insterted in the line 966 of trans-stmt.c, i.e. in
the block:
/* Special case simple loops. */
if (TREE_CODE (type) == INTEGER_TYPE
&& (integer_onep (step)
|| tree_int_cst_equal (step, integer_minus_one_node)))
return gfc_trans_simple_do (code, &block, dovar, from, to, step);
I also checked that the fast codes have a small count of pow().