654 karma · joined Aug 30, 2017 (9y ago) · 216 submissions
comment 7y ago · link · parent
BBC: https://www.bbc.co.uk/programmes/n3ct5g1c SvT: https://www.svtplay.se/video/20431599/nobel/nobel-2018-snill...
comment 8y ago · link · parent
I think what they mean is that if the compiler has analyzed the code, not shown in the example, that comes before the if statement, and concluded that unless something undefined happens, cond can only be 0 or 1, then it can optimize out the condition.
They are not saying that the code actually shown is enough to conclude that cond must be 0 or 1.
comment 9y ago · link · parent