[Bug c/59961] Use of size_t in leading term of computation with subtraction

2014-01-27 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59961 --- Comment #4 from Andrew Pinski --- (In reply to Olaf from comment #3) > Well... naive me found it quite surprising and unexpected that the following > two lines produce grossly different results: > > double result1 = -s1*d1 + s2*d2; > double r

[Bug c/59961] Use of size_t in leading term of computation with subtraction

2014-01-27 Thread olaf at robots dot ox.ac.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59961 --- Comment #3 from Olaf --- Well... naive me found it quite surprising and unexpected that the following two lines produce grossly different results: double result1 = -s1*d1 + s2*d2; double result2 = s2*d2 - s1*d1; ...but never mind.

[Bug c/59961] Use of size_t in leading term of computation with subtraction

2014-01-27 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59961 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c/59961] Use of size_t in leading term of computation with subtraction

2014-01-27 Thread sch...@linux-m68k.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59961 --- Comment #1 from Andreas Schwab --- -100 is not the same as -s1. The latter is SIZE_MAX + 1 - 100, a big number, depending on the size of size_t. If s1 is declared as unsigned short or unsigned char, it will be promoted to int before any futh