------- Comment #13 from law at redhat dot com  2006-05-01 16:36 -------
The overflow check for multiplication is totally bogus.  The right way to check
for overflow of an integer multiplication is to use division.

ie, given
res = a * b;

Divide res by a, if the result is less than b, then the multiplication
overlowed.
[ Note, assumes a != 0. ]  In fact, any result other than "b" is bad.

Anyway, once we muck up the overflow status of the multiplication we lose.

Jeff


-- 


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

Reply via email to