3 ms·
You're probably not turning on optimization. For example, gcc 8.3 with -O3 gives the result that the OP posted. There's no undefined behavior in that example,
by foldr 8y ago
You're probably not turning on optimization. For example, gcc 8.3 with -O3 gives the result that the OP posted.
There's no undefined behavior in that example, as far as I can see. The point is that the compiler optimizes away all of the actual computation, since it's able to determine at compile time that the result will always be 0x20.