3 ms·
Indeed, if you re-interpret the article's usage of the phrase "optimizer bug", then the advice becomes useful: if changing the optimization level fixes your bro
by derefr 13y ago
Indeed, if you re-interpret the article's usage of the phrase "optimizer bug", then the advice becomes useful: if changing the optimization level fixes your broken code, you have an undefined-behavior bug.
- Eiwatah4 13y agoEither that, or a race condition.
- johnbender 13y agoI'm not sure that's necessarily the case. See my comment above about sequential consistency.
- ben0x539 13y agoAren't those undefined behavior bugs?
- Dylan16807 13y agoImagine two threads that safely lock a resource, increment it, copy the value, and then unlock it. This is entirely defined, but also a race condition. Race conditions are a lot like unsanitized input. They don't cause problems by themselves, but if you make incorrect assumptions it's easy to write incorrect code.
- gsg 13y agoIt's data races specifically that are undefined behaviour.