|
|
Bugzilla Link |
874 |
Created on |
Sep 21, 2011 18:10 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
I'm not sure if this is my version or the production version of sac,
but if I compile this (lir.sac):
use Array:all;
int main()
{
x = 666;
for( i=0; i<10000000; i++) {
x = sum( iota( 100000000));
}
return(x);
}
~
with:
sac2c lir.sac -bopt
We get this LACFUN:
int _MAIN::_dup_825_main__Loop_0( int _pinl_770__icc_643 { ,NN } , int i { ,NN } )
/*
* _dup_825_main__Loop_0 :: ---
*/
{
int _al_850 { , NN } ;
int _pinl_795__flat_213 { , NN } ;
bool _pinl_796__flat_186 { , NN } ;
int x__SSA0_2 { , NN } ;
int x__SSA0_1 { , NN } ;
_pinl_795__flat_213 = _add_SxS_( i, 1);
_al_850 = _add_SxS_( -9999999, i);
_pinl_796__flat_186 = _lt_SxS_( _al_850, 0);
if (_pinl_796__flat_186)
{
x__SSA0_1 = _MAIN::_dup_825_main__Loop_0( _pinl_770__icc_643, _pinl_795__flat_213) ;
}
else
{
}
x__SSA0_2 = ( _pinl_796__flat_186 ? x__SSA0_1 : _pinl_770__icc_643 );
return( x__SSA0_2);
}
int _MAIN::_dup_825_main__Loop_0( int _pinl_770__icc_643 { ,NN } , int i { ,NN } )
/*
* _dup_825_main__Loop_0 :: ---
*/
{
int _al_850 { , NN } ;
int _pinl_795__flat_213 { , NN } ;
bool _pinl_796__flat_186 { , NN } ;
int x__SSA0_2 { , NN } ;
int x__SSA0_1 { , NN } ;
_pinl_795__flat_213 = _add_SxS_( i, 1);
_al_850 = _add_SxS_( -9999999, i);
_pinl_796__flat_186 = _lt_SxS_( _al_850, 0);
if (_pinl_796__flat_186)
{
x__SSA0_1 = _MAIN::_dup_825_main__Loop_0( _pinl_770__icc_643, _pinl_795__flat_213) ;
}
else
{
}
x__SSA0_2 = ( _pinl_796__flat_186 ? x__SSA0_1 : _pinl_770__icc_643 );
return( x__SSA0_2);
}
Two other oddities: compiling with -#d,LINL:
1. crashes eventually, but have not looked into this.
2. The traversal into main also traverses into the Loop.
BUT, sometimes it traverses the loopfn once, other times twice, and
other times three times.