tree-optimization/123061 - invalid hoisting of division

The following fixes the computation of always-exeecuted-in in the LIM
pass which was enhanced to handle inner loops in a better way but
in this process ended up setting inner loop always-executed-in state
based on outer loop analysis, which is wrong because an inner loop
block needs to be proven to be always executed for all inner loop
iterations as well, not only for all outer loop iterations.

The fix is to iterate over inner loops first and when processing
an outer loop only update always-executedness if a block belongs
to the very same loop or an immediately nested loop and always
executed inside that.

	PR tree-optimization/123061
	PR tree-optimization/123636
	* tree-ssa-loop-im.cc (fill_always_executed_in_1): Change
	outer-to-inner to inner-to-outer iteration.  Update inner
	loop state only when always executed in an immediately
	nested loop.

	* gcc.dg/torture/pr123061.c: New testcase.
	* gcc.dg/torture/pr123636.c: Likewise.
	* gcc.dg/tree-ssa/ssa-lim-26.c: Likewise.

(cherry picked from commit e48704694d686de1aaaaf934c04a2eda1a6033cb)
4 files changed