Fix 1176647: Jit does invalid reordering of left and right side
authorCarol Eidt <carol.eidt@microsoft.com>
Mon, 1 Jun 2015 23:36:26 +0000 (16:36 -0700)
committerCarol Eidt <carol.eidt@microsoft.com>
Mon, 1 Jun 2015 23:36:26 +0000 (16:36 -0700)
commitf612e01198b00d6ee2a5234dc0101312585b80c1
tree17461ba0cece98f3a50c699a0129240f4360a747
parent4fcd3c3af8366018c7a2fb8b9da0396171448962
Fix 1176647: Jit does invalid reordering of left and right side

This bug occurs in the Lowering of the code for a compare, where op1 is an indirection, and op2 is a call.  It chooses to make op1 "contained" (i.e. do the load as part of the compare op), but this is invalid because the call may modify op1.

This also fixes a similar issue with RMW operators (e.g. +=).

Fixing this causes numerous regressions (a few improvements, due to keeping fewer things live across the call), but they look valid - that is, they are a similar case of delaying a load past a call.

[tfs-changeset: 1480705]
src/jit/lower.cpp
src/jit/lower.h
src/jit/lowerxarch.cpp