|
|
Bugzilla Link |
858 |
Created on |
Aug 19, 2011 17:36 |
Resolution |
WORKSFORME |
Resolved on |
Oct 13, 2011 19:07 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
I came across this while trying to up the AL unit test directory
for Clemens. I am not sure if this is just something I've done
locally, or if the compiler is really doing this "for" everybody:
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 17562:MODIFIED linux-gnu_x86_64
(Fri Aug 19 11:06:12 EDT 2011 by sac)
cd ~/sac/testsuite/optimizations/al
sac2c wlir.sac -bewl:cse >crud
Now, look at the WL in foo():
_flat_3 = [ 90, 90 ];
_flat_2 = [ 10, 10 ];
_flat_1 = 0;
_flat_0 = [ 100, 100 ];
r = with {
/*** Partition ***/
(_flat_2 <= _flat_4=[i, j] < _flat_3)
{
_flat_5 = _add_SxS_( i, c);
q = _add_SxS_( b, _flat_5);
} : q ; ,
/*** Partition ***/
default partition( _flat_4=[i, j] ):
{
/* empty */
} : _flat_1 ;
} :
genarray( _flat_0, _flat_1);
Fairly reasonable, I think. Now, let's break the compiler
at the next traversal and see what we get:
sac2c wlir.sac -bewl:wlpg >crud
_flat_3 = [ 90, 90 ];
_flat_2 = [ 10, 10 ];
_flat_1 = 0;
_flat_0 = [ 100, 100 ];
_wlpg_34_zeros = [ 0, 0 ];
_wlpg_35_axis = 0;
_wlpg_36_lmax, _wlpg_37_umin, _wlpg_38_nmin, _wlpg_39_nmax = wrapper:sacprelude::partitionSlicer( _wlpg_34_zeros, _flat_0, _wlpg_35_axis, _flat_2, _flat_3) ;
_wlpg_40_axis = 1;
_wlpg_41_lmax, _wlpg_42_umin, _wlpg_43_nmin, _wlpg_44_nmax = wrapper:sacprelude::partitionSlicer( _wlpg_38_nmin, _wlpg_39_nmax, _wlpg_40_axis, _flat_2, _flat_3) ;
r = with {
/*** Partition ***/
(_wlpg_37_umin <= _flat_4=[i, j] < _flat_0)
{
/* empty */
} : _flat_1 ; ,
/*** Partition ***/
(_wlpg_34_zeros <= _flat_4=[i, j] < _wlpg_36_lmax)
{
/* empty */
} : _flat_1 ; ,
/*** Partition ***/
(_wlpg_42_umin <= _flat_4=[i, j] < _wlpg_39_nmax)
{
/* empty */
} : _flat_1 ; ,
/*** Partition ***/
(_wlpg_38_nmin <= _flat_4=[i, j] < _wlpg_41_lmax)
{
/* empty */
} : _flat_1 ; ,
/*** Partition ***/
(_flat_2 <= _flat_4=[i, j] < _flat_3)
{
_flat_5 = _add_SxS_( i, c);
q = _add_SxS_( b, _flat_5);
} : q ;
} :
genarray( _flat_0, _flat_1);
These partitions do NOT go away by -bopt time, either.
All I can think of is that I have somehow managed to bust
sacprelude with recent changes.
At any rate, perhaps somebody with an older sac2c can try
this same test and see what happens.