scop detection: remove an iteration over all uses

reenabled reverted patch after checking that it passes without regressions on
the nightly test-suite.  Added testcase from Tobi.