integer overflows: -2 < maxint() is false in sac
|
|
Bugzilla Link |
951 |
Created on |
May 04, 2012 14:29 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
cmp.sac |
Extended Description
Comparing (-2 < maxint()) returns false. See the attached source: it should print [true,true,true], but gives [true,false,false]. Tested on sac2c r17796.
_flat_3 = Constants::maxint() ; // 2147483647
_ctz_77 = _sub_SxS_( -2, _flat_3); // -2-2147483647 overflows to 2147483647
_pinl_48__flat_59 = _lt_SxS_( _ctz_77, 0); // compares 2147483647 < 0, giving false