Solc 0.8.18: Added optimization rule and(shl(X, Y), shl(X, Z))
=> shl(X, and(Y, Z))
#14060
Projects
and(shl(X, Y), shl(X, Z))
=> shl(X, and(Y, Z))
#14060
This is either a documentation issue or a real bug.
I have not verified this is a bug, only read it in the release notes of solc 0.8.18.
So it is possibly just a documentation issue (either incorrect documentation or my incorrect understanding of it).
Yet, I wanted to point that to your immediate attention:
A quick check reveals that for
X = 1, Y = 0, Z = 1
:and(shl(X, Y), shl(X, Z))
evaluates to0
shl(X, and(Y, Z))
evaluates to1
The text was updated successfully, but these errors were encountered: