3 ms·
Do you have an example (or maybe a published study) where -fwrapv generates better code?
by vinkelhake 8y ago
Do you have an example (or maybe a published study) where -fwrapv generates better code?
- vyodaiken 8y agoDo you have a single published study showing that the UB "optimizations" benefit real programs? I typed in the example code and current Clang generates exactly the same assembly for both u and not u integers - which is correct. So the problem he is describing is an error in Clang code generation that has since been fixed. Again: I have yet to see a serious attempt to validate the utility of UB "optimizations" - this video certainly does not contain any.
- wolf550e 8y agoThe generated code is not the same: https://godbolt.org/z/GkFGqe https://godbolt.org/z/GkFGqe
- vyodaiken 8y agoBut the purported massive difference of the video disappears on those versions too. So that's the big proof of the efficacy of UB driven "optimization" - one additional assembler instruction in the clang code, some movslq vs movl. Dramatic. A micro-benchmark that indicates zero.