From ace7a000a433ce4ecf94f30adea39c01a76fa936 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 5 Apr 2016 11:18:49 +0100 Subject: 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 --- compiler/optimizing/nodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 8a2e83a9ef..bb28b84dab 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -5674,6 +5674,7 @@ class HLoadString : public HExpression<1> { SetPackedFlag(true); DCHECK(!NeedsEnvironment()); RemoveEnvironment(); + SetSideEffects(SideEffects::None()); } size_t InputCount() const OVERRIDE { -- cgit v1.2.3-59-g8ed1b