On Tue, Nov 27, 2018 at 12:26 PM Stephan T. Lavavej via Boost < boost@lists.boost.org> wrote:
[degski]
Interestingly [or maybe not so interestingly] MSVC (15.8/7) is the only
compiler
available there [on godbolt] that does NOT produce more optimal code for the signed integer case (at any optimization level) (STL are you listening).
I am listening, but I am not a compiler backend dev. :-) I recommend filing a bug about the missed optimization opportunity through the C++ tab of Developer Community at https://developercommunity.visualstudio.com/spaces/62/index.html .
I would have thought MSVC doesn't do this optimization so it doesn't break existing code which assumes int overflow wraps around. Microsoft is usually very careful with this, and for good reasons.