scala/scala — pull request #2059 by VladUreche (2013-02-03 22:56:04+00:00)
Title: SI-7060 More conservative dead code elim marking

In dead code elimination, a DROP instruction that gets marked as useful
and can be reached via several paths needs to also mark all the reaching
definitions as useful, else we'll get unbalanced stacks on the two paths.

A simplistic example:
```
BB1:
CALL X // useful, leaves a LONG on the stack
JUMP BB3

BB2:
LOAD_FIELD Y // not useful
JUMP BB3

BB3:
DROP LONG // useful because "CALL X" is useful
// but unless we mark "LOAD_FIELD Y" as useful too
// we'll get unbalanced stacks when reaching BB3
```

This patch addresses the unbalanced stack problem by adding all the
reaching definitions of a useful DROP as useful instructions too.