Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • 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 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1045
Closed
Open
Created Nov 11, 2009 by Robert Bernecky@rbeDeveloper

Weird with-loops

Bugzilla Link 589
Created on Nov 11, 2009 17:02
Version 1.00beta
OS Linux
Architecture PC
Attachments crud2.sac

Extended Description

Created an attachment (id=596)
Source code to reproduce fault
The attached (unlikely) code exhibits several interesting properties.
When compiled with  Build #16534 (and probably many earlier ones...),
 sac2c -b11 crud2.sac 
produces this function:
-----------------------------------------------------
 _pinl_622__flat_792 = true;
  _pinl_624_res__SSA0_1 = with {
        ([ 0 ] <= _pinl_623_iv__SSA0_1=[_pinl_626__eat_11] (IDXS:_wlidx_1240__pinl_624_res__SSA0_1) < [ 8 ])
        {
          /* empty */
        } : _pinl_622__flat_792 ; ,
        ([ 8 ] <= _pinl_623_iv__SSA0_1=[_pinl_626__eat_11] (IDXS:_wlidx_1240__pinl_624_res__SSA0_1) < [ 16 ])
        {
          /* empty */
        } : _pinl_622__flat_792 ;
 } :
      genarray( [ 16 ], IDX(_wlidx_1240__pinl_624_res__SSA0_1));
----------------------------------------------------------------
I am not sure if this gets merged back into a single WL in the back end
or not. However, it does look weird. 
Even weirder is what we get when compiled with:
 sac2c -b11 -extrema -doawlf -nowlf crud2.sac
------------------------------------------------------
 _pinl_612_res = with {
        (_flatg_982 <= _pinl_610_iv=[_pinl_625__eat_10] (IDXS:_wlidx_1375__pinl_612_res) < _flatg_980)
        {
          /* empty */
        } : _pinl_611__flat_784 ; ,
        (_flatg_980 <= _pinl_610_iv=[_pinl_625__eat_10] (IDXS:_wlidx_1375__pinl_612_res) < _flatg_981)
        {
          /* empty */
        } : _pinl_513__flat_780 ;
 } :
      genarray( [ 16 ], _pinl_513__flat_780, IDX(_wlidx_1375__pinl_612_res));
  _pinl_624_res__SSA0_1__SSA4_1 = _idx_modarray_AxSxS_( _pinl_612_res, _pinl_598__flat_777, _pinl_611__flat_784);
  _ivesplit_1382 = 9;
  _pinl_624_res__SSA0_1__SSA4_2 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_1, _ivesplit_1382, _pinl_611__flat_784);
  _ivesplit_1383 = 10;
  _pinl_624_res__SSA0_1__SSA4_3 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_2, _ivesplit_1383, _pinl_611__flat_784);
  _ivesplit_1384 = 11;
  _pinl_624_res__SSA0_1__SSA4_4 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_3, _ivesplit_1384, _pinl_611__flat_784);
  _ivesplit_1385 = 12;
  _pinl_624_res__SSA0_1__SSA4_5 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_4, _ivesplit_1385, _pinl_611__flat_784);
  _ivesplit_1386 = 13;
  _pinl_624_res__SSA0_1__SSA4_6 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_5, _ivesplit_1386, _pinl_611__flat_784);
  _ivesplit_1387 = 14;
  _pinl_624_res__SSA0_1__SSA4_7 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_6, _ivesplit_1387, _pinl_611__flat_784);
  _ivesplit_1388 = 15;
  _pinl_624_res__SSA0_1__SSA4_8 = _idx_modarray_AxSxS_( _pinl_624_res__SSA0_1__SSA4_7, _ivesplit_1388, _pinl_611__flat_784);
  return( _pinl_624_res__SSA0_1__SSA4_8);
}
-----------------------------------
Doesn't look very healthy from a performance viewpoint.
I'm not going to be able to look into it right away, but
wanted to note the problem, while it's fresh in my mind.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking