4 ms·
There's a long history of compilers attempting such "smarter" optimizations - with (metaphorically) "...and it flew straight into the mountainside" results. I
by bell-cot 4y ago
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.
- RobotToaster 4y agoGCC 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.
- bell-cot 4y agoVery difficult to do + even more difficult to get right + seldom used ==> proposed feature is a low priority for the compiler team.