3 ms·
Globals and locals are different. All compilers will give a global a specific memory location and load and store from it. Locals by contrast can be escape analy
by wbl 5y ago
Globals and locals are different. All compilers will give a global a specific memory location and load and store from it. Locals by contrast can be escape analyzed.
- mjevans 5y agoThe example didn't show where X was defined; it could be anything.
- wbl 5y agoNo it could not have been for copy propagation to be valid. It had to be a local except under some very special conditions.
- mjevans 5y agoHow about circumstances such as opting in to a semantically new version of C? #ifndef __CC_VOLATILE_FUNCTIONS /\* No volatile function support, remove code */ #define VOLFUNC #else /* This compiler supports volatile functions. Only volatile functions may cause external side effects without likely bugs. */ #define VOLFUNC volatile #endif https://www.postgresql.org/docs/current/xfunc-volatility.html https://www.postgresql.org/docs/current/xfunc-volatility.htm... Similarly stable functions could have results cached. You might also note that PostgreSQL assumes any undeclared function is volatile.