vector shift() produces strange WL partitions
|
|
Bugzilla Link |
1048 |
Created on |
Feb 27, 2013 22:56 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
crud4.sac |
Extended Description
Created an attachment (id=948)
source code to reproduce fault
This WL has three partitions, but the first one is, supposedly, degenerate:
_pinl_964__icc_698 = with {
([ _pinl_1147_z ] <= _pinl_975_iv=[_pinl_981__eat_24] < [ N__SSA0_2 ] genwidth [ _wlsimp_1161 ])
{
} : _flat_21 ; ,
([ 0 ] <= _pinl_975_iv=[_pinl_981__eat_24] < [ _uprf_1209 ] genwidth [ _uprf_1209 ])
{
} : _flat_21 ; ,
([ _uprf_1209 ] <= _pinl_975_iv=[_pinl_981__eat_24] < [ N__SSA0_2 ] genwidth [ _wlsimp_1158 ])
{
_ivexi_2036_ext = _noteminval_( _pinl_981__eat_24, _uprf_1209);
_ivexi_2037_ext = _notemaxval_( _ivexi_2036_ext, N__SSA0_2);
_dup_2038__uprf_1203 = _sub_SxS_( _ivexi_2037_ext, _uprf_1209);
_dup_2041__uprf_1190, _dup_2042__uprf_1191 = _val_lt_val_SxS_( _dup_2038__uprf_1203, N__SSA0_2);
_dup_2046__pinl_977__flat_12 = _afterguard_( _dup_2041__uprf_1190, _dup_2042__uprf_1191);
} : _dup_2046__pinl_977__flat_12 ;
} :
genarray( [ N__SSA0_2 ], _flat_21);
What I find odd about this is that there is clearly a complete partitioning
of the array in the next two partitions, which clearly cover the
genarray.
I would like it if we can prevent such degenerate partitions
from being generated at all, or provide a way to eliminate them
when they are clearly degenerate, as this one is.
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18059 linux-gnu_x86_64
(Tue Feb 26 10:58:59 EST 2013 by sac)
This may require a change in the semantics of WLs, but I think
it would be a good thing. I am not convinced that the current
semantics serve any useful purpose, in practice.
If you compile this way, you can observe the fault:
sac2c -doawlf -nowlf -v1 crud4.sac -bopt >crud
Adding -DAKV eliminates the problem (by using a constant shift count),
and lets AWLF work as it should.