Signed overflow optimization hazards in the kernel
Signed overflow optimization hazards in the kernel
Posted Aug 17, 2012 19:16 UTC (Fri) by gmaxwell (guest, #30048)In reply to: Signed overflow optimization hazards in the kernel by jmspeex
Parent article: Signed overflow optimization hazards in the kernel
Beyond the optimization possibilities, the existence of tools like this is also a reason for keeping the undefined behavior, e.g. continue using signed values for counters that don't need the extra unsigned range: Most of the time overflow that you didn't expect (and thus couldn't wrap in a casting macro) is a sign of a logic error. By keeping it invalid you gain the possibility of dynamic instrumentation to catch those errors.
(Though I don't know if anyone has managed to get tools like this working with the kernel yet!)
