News for hackers. Stuff that matters.
Re:Decreasing the Number of Memory Accesses 1/2 by bell-cot on Friday March 31, 2023 @07:47AM (#35385597)
There's a long history of compilers attempting such "smarter" optimizations - with (metaphorically) "...and it flew straight into the mountainside" results.

I don't blame the compiler guys. They have to deal with tortuously complex real-world code. Sight unseen. And that code may only work correctly because of some unwritten assumptions, side-effects, and undefined behaviors, which no good program would ever rely upon.

Re:Decreasing the Number of Memory Accesses 1/2 by RobotToaster on Friday March 31, 2023 @08:29AM (#35386071)
GCC already has flags for various "dangerous" optimisation options (ffast-math for instance), there's no reason you couldn't have similar options that are disabled by default.
Re:Decreasing the Number of Memory Accesses 1/2 by bell-cot on Friday March 31, 2023 @08:51AM (#35386360)
Very difficult to do + even more difficult to get right + seldom used ==> proposed feature is a low priority for the compiler team.