|
|
Bugzilla Link |
990 |
Created on |
Jul 06, 2012 22:21 |
Resolution |
FIXED |
Resolved on |
Jul 07, 2012 10:40 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
bugxxx.sac |
Extended Description
Created an attachment (id=905)
source code to reproduce fault
Guards are introduced very early in the compilation process, and AWLF/CF
use the extrema information they provide to drive certain optimizations.
In the AWLF unit test suite, bugxxx.sac provides a good test case.
After -bopt:cwc:dcr, we have this iota():
inline
int[.] ArrayBasics::iota( int shp { ,NN } )
/*
* iota :: ---
*/
{
int[.] res { , NN } ;
int i { , NN } ;
int[1] _flat_115 { , NN } ;
int[1] _flat_109 { , NN } ;
int{0} _flat_110 { , NN } ;
int[1] _flat_111 { , NN } ;
int{0} _flat_112 { , NN } ;
int[1] _flat_113 { , NN } ;
int[1] _flat_114 { , NN } ;
_flat_114 = [ shp ];
_flat_113 = [ shp ];
_flat_112 = 0;
_flat_111 = _mul_SxV_( _flat_112, _flat_113);
_flat_110 = 0;
_flat_109 = [ shp ];
res = with {
(_flat_111 <= _flat_115=[i] < _flat_114)
{
} : i ;
} :
genarray( _flat_109, _flat_110);
return( res);
}
The next traversal inserts guards, and we end up with:
_flat_114 = [ shp ];
_idc_383, _icc_375_pred = _non_neg_val_V_( _flat_114);
_flat_113 = [ shp ];
_flat_112 = 0;
_flat_111 = _mul_SxV_( _flat_112, _flat_113);
_idc_384, _icc_374_pred = _non_neg_val_V_( _flat_111);
_flat_110 = 0;
_flat_109 = [ shp ];
_idc_385, _idc_386, _icc_376_pred = _same_shape_AxA_( _idc_384, _flat_109);
_idc_387, _icc_377_pred = _val_le_val_VxV_( _idc_385, _idc_386);
_idc_388, _idc_389, _icc_378_pred = _same_shape_AxA_( _idc_383, _idc_386);
_idc_390, _icc_379_pred = _val_le_val_VxV_( _idc_388, _idc_389);
_idc_391, _icc_380_pred = _non_neg_val_V_( _idc_389);
_icc_382 = with {
(_idc_387 <= _flat_115=[i] < _idc_390)
{
_idc_392, _idc_393, _icc_381_pred = _same_shape_AxA_( i, _flat_110);
} : _idc_392 ;
} :
genarray( _idc_391, _flat_110);
res = _afterguard_( _icc_382, _icc_380_pred, _icc_379_pred, _icc_378_pred, _icc_377_pred, _icc_376_pred, _icc_375_pred, _icc_374_pred);
return( res);
}
That explains how values such as "shp" appear to be creeping above
their guarded values.
What is odd is that CSE has not done its job. Perhaps the fact
that iota() lives in stdlib is related to this problem?