You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bugc: CSE leaves a removed temp in ssaVariables, so the local loses its location #392
Common subexpression elimination (packages/bugc/src/optimizer/steps/common-subexpression-elimination.ts) replaces a duplicate computation's temp with the earlier one, but it does not update func.ssaVariables. A local whose temp it removes keeps pointing at a temp that no longer exists, so evmgen gives it no location.
name CseLocal;
storage { [0] s: address; [1] t: address; [2] n: uint256; }
create {}
code {
let a = msg.sender;
n = 1;
let b = msg.sender;
s = b;
t = a;
}
At -O0 and -O1, b has stack pointers in the runtime program's variables contexts. At -O2 and -O3, the IR is
b's SSA entry still names t3, and b appears only as {"identifier":"b"}, with no pointer anywhere, although its value is in t0 (a's home) the whole time.
CSE could record the replacement in ssaVariables (the entry's temp field), the way other passes keep a local's location when they rename its temp.
Activity