diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-05-19 12:56:12 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-05-19 12:56:12 +0200 |
commit | 81309e7e0fb568b3ba12df9631c607232b68960b (patch) | |
tree | 944a78faa022dbd193b3e464a9b20adcd71a2cae | |
parent | f0eb8d93d51b110f11786a5f3664cde9db66efcc (diff) | |
download | scala-81309e7e0fb568b3ba12df9631c607232b68960b.tar.gz scala-81309e7e0fb568b3ba12df9631c607232b68960b.tar.bz2 scala-81309e7e0fb568b3ba12df9631c607232b68960b.zip |
Revert "SI-8601 Don't treat int/long division, or arraylength, as dead-code"
This reverts commit ee611cd76c29fedd416162e482c7ab3f15b831ca.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala | 2 | ||||
-rw-r--r-- | test/files/run/t8601.flags | 1 | ||||
-rw-r--r-- | test/files/run/t8601.scala | 15 | ||||
-rw-r--r-- | test/files/run/t8601b.flags | 1 | ||||
-rw-r--r-- | test/files/run/t8601b.scala | 9 |
5 files changed, 0 insertions, 28 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala index 3c983e6fdf..90c37ba0b3 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala @@ -193,8 +193,6 @@ abstract class DeadCodeElimination extends SubComponent { moveToWorkListIf(necessary) case LOAD_MODULE(sym) if isLoadNeeded(sym) => moveToWorkList() // SI-4859 Module initialization might side-effect. - case CALL_PRIMITIVE(Arithmetic(DIV | REM, INT | LONG) | ArrayLength(_)) => - moveToWorkList() // SI-8601 Might divide by zero case _ => () moveToWorkListIf(cond = false) } diff --git a/test/files/run/t8601.flags b/test/files/run/t8601.flags deleted file mode 100644 index 1182725e86..0000000000 --- a/test/files/run/t8601.flags +++ /dev/null @@ -1 +0,0 @@ --optimize
\ No newline at end of file diff --git a/test/files/run/t8601.scala b/test/files/run/t8601.scala deleted file mode 100644 index e1afc23cc4..0000000000 --- a/test/files/run/t8601.scala +++ /dev/null @@ -1,15 +0,0 @@ -object Test { - def idiv(x: Int): Unit = x / 0 - def ldiv(x: Long): Unit = x / 0 - def irem(x: Int): Unit = x % 0 - def lrem(x: Long): Unit = x % 0 - - def check(x: => Any) = try { x; sys.error("failed to throw divide by zero!") } catch { case _: ArithmeticException => } - - def main(args: Array[String]) { - check(idiv(1)) - check(ldiv(1L)) - check(irem(1)) - check(lrem(1L)) - } -} diff --git a/test/files/run/t8601b.flags b/test/files/run/t8601b.flags deleted file mode 100644 index 1182725e86..0000000000 --- a/test/files/run/t8601b.flags +++ /dev/null @@ -1 +0,0 @@ --optimize
\ No newline at end of file diff --git a/test/files/run/t8601b.scala b/test/files/run/t8601b.scala deleted file mode 100644 index 42b562af96..0000000000 --- a/test/files/run/t8601b.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test { - def len(x: Array[String]): Unit = x.length - - def check(x: => Any) = try { x; sys.error("failed to throw NPE!") } catch { case _: NullPointerException => } - - def main(args: Array[String]) { - check(len(null)) - } -} |