------- Comment #3 from regehr at cs dot utah dot edu  2008-03-29 19:16 -------
Subject: Re:  apparent integer math bug

> This multiplication overflows so the resulting behavior is undefined.

Right-- but always in the past it has been (or seemed) fine to assume 
two's complement overflow behavior for signed arithmetic under gcc on 
two's complement platforms.

I have seen the "strict overflow" options and those seem quite 
reasonable.  However, changing overflow behavior for multiply seems risky!

Is it still reasonable at least to rely on two's complement behavior for 
signed addition and subtraction?

Thanks,

John Regehr


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35753

Reply via email to