3 ms·
The problem is that that kind of analysis would require full program optimization, rather than optimizing individual functions, because the signature of the cal
by thayne 2y ago
The problem is that that kind of analysis would require full program optimization, rather than optimizing individual functions, because the signature of the call to read doesn't provide enough information for the compiler to know if it ever reads the data. And indeed, it can't know until link time.
I think it's theoretically possible, but at the cost of much longer compile times, and greater complexity in the compiler.