well maybe not compiler.
Steps to Reproduce:
create any shader with x * x and pow (x, 2.0) side by side, you will see a difference.
x * x is always equal to pow (x, 2.0)
pow (x, 2.0) is zero when x < 0
ios 8.0 12A4345d
See this commit
And the demo that is fixed by it:
I actually have a recording of how that demo looked prior to commit: https://www.youtube.com/watch?v=y5-VwWlFZqo
pow(x < 0, ...) is undefined behavior according to the spec
According to the OpenGL ES GLSL 1.0 spec
genType pow (genType x, genType y)
Returns x raised to the y power, i.e., x ^ y
Results are undefined if x < 0.
Results are undefined if x = 0 and y <= 0.