From c3bb056f05a014c77bd6fdf4817c962c9b78d48e Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 10 Jan 2019 23:26:58 +0100 Subject: [PATCH] Revert the optimization re-added in 1946acf3a4da9bbbab6e2e386bb9a4e792e7a896 That change needs much more analysis and thought. And we need more testcases. --- lslopt/lsldeadcode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lslopt/lsldeadcode.py b/lslopt/lsldeadcode.py index df82658..728c17a 100644 --- a/lslopt/lsldeadcode.py +++ b/lslopt/lsldeadcode.py @@ -358,7 +358,10 @@ class deadcode(object): # Replacing j with i+1 in llOwnerSay will produce wrong code because # the name i is redefined after j is assigned. shrinknames prevents # that. - if not self.shrinknames or not node.SEF: + # FIXME: shrinknames and SEF are not enough guarantee. This needs + # analyzing a control flow graph. + #if not self.shrinknames or not node.SEF: + if True or not self.shrinknames or not node.SEF: return False if nt not in ('VECTOR', 'ROTATION'):