CF IVEXPprf_mod.sac unit test fails due to ssarelat shortcoming
|
|
Bugzilla Link |
1024 |
Created on |
Sep 17, 2012 15:28 |
Resolution |
FIXED |
Resolved on |
Oct 05, 2012 19:56 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
This problem appears to have been around for many moons,
but I just stumbled on it over the weekend. The _gt_SxS_()
could be removed by CF, because:
five > (AVIS_MAX(res) - 1);
and
AVIS_MAX( res) = five;
so we should get:
five > (five - 1);
FALSE
The saarelat code is wrong here.
int[*] id(int[*] y)
{ return(y);
}
int main()
{
five = _max_SxS_( id(5), 0); /* mod wants args >= 0 for this */
two = _max_SxS_( id( 2), 0);
res = _mod_SxS_( two, five); /* res member 0...4 */
z = _gt_SxS_( five, res); /* AVIS_MAX(res) = five! */
StdIO::print( z);
return(0);
}
sac@rattler:~/sac/testsuite/optimizations/constantfolding$ sac2c crud.sac -doawlf -nowlf -nocyc -bopt:uglf -noctz -v1 >crud
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18221:MODIFIED linux-gnu_x86_64
(Sun Sep 16 17:08:12 EDT 2012 by sac)