This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Detect most integer overflows.


On Sun, Oct 27, 2013 at 12:35:24PM +0100, OndÅej BÃlka wrote:
> On Sun, Oct 27, 2013 at 11:51:00AM +0100, Marek Polacek wrote:
> > Or just wait till the integer overflow detection in ubsan is completed.
> >
> As these computations now are done on unsigned type which has behaviour
> defined as modular arithmetic this would not help. 

But what is integer overflow on unsigned type?  If you want to add -1
in unsigned arithmetics, you add very large positive number instead and that
would overflow, even if it is unlikely it is an error and it is pretty common.

As part of ubsan or follow-up to that we probably want to add some builtins
for these, the question is what semantics to implement.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]