summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-04-05 11:18:49 +0100
committer Vladimir Marko <vmarko@google.com> 2016-04-05 12:27:58 +0100
commitace7a000a433ce4ecf94f30adea39c01a76fa936 (patch)
tree9d41d8974c1feda1af134a536eee8064028d670f /compiler/optimizing/nodes.cc
parent75563e34a4e64a8e805e6810b13e07f1cafec137 (diff)
Optimizing: LoadString may not have any side effects.
LoadString does not have any side effects if the string is known to be in the dex cache or it's a boot image string referenced directly, as specified by the string load kind. We need to clear the side effects for these cases to avoid a DCHECK() failure when such LoadString instruction ends up between a ClinitCheck and an instruction to which we want to merge that ClinitCheck. This may happen as a consequence of inlining, LICM and DCE as shown by a regression test. Bug: 27929914 Change-Id: I7b3bddf7d8c79ce1828a4a751f1270cf2e3d61f0
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 9f448af73a..6aa8cef430 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -2346,6 +2346,7 @@ void HLoadString::SetLoadKindInternal(LoadKind load_kind) {
}
if (!NeedsEnvironment()) {
RemoveEnvironment();
+ SetSideEffects(SideEffects::None());
}
}