Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 334
    • Issues 334
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1097

Closed
Open
Created Sep 21, 2011 by Robert Bernecky@rbeDeveloper

LINL doesn't remove dead function

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.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking