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 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2322
Closed
Open
Created Jan 17, 2023 by Sven-Bodo Scholz@sbsOwner

weird Type upgrade problem

When I compile


inline
int[10,10] myrotate (int[2] counts,  int[10,10] A)
{
  for( i=0; _lt_SxS_(i,2); i=_add_SxS_(i,1) ) {
    count = _sel_VxA_([i],counts);
    slice_shp = _modarray_AxVxS_([10,10], [i], count);

    A = with {
             ( [0,0] <= iv < slice_shp ) : _sel_VxA_(    _add_VxV_(_sub_VxV_([10,10],slice_shp),iv)    , A);
           } : modarray( A );
  }

  return(A);
}

int main()
{
    x = with {} : genarray([10, 10], 0);

    a = with {
                ([0,0]<= iv <[4,4]) : myrotate ( iv, x);
             } : genarray( [4,4], x);

    return _sel_VxA_([0,0,1,2], a);
}

using

sac2c 1.3.3-MijasCosta-1032-gff7ec
build-type: RELEASE
built-by: "sbs" at 2023-01-16T20:34:58

(can be experiences using -noprelude) then I get

Internal compiler error
Assertion "cviv[i] < cvshp[i]" failed at /Volumes/Users/sbs/sac2c/src/libsac2c/constants/constants_struc_ops.c:1275 -- Index error: iv[1] >= shp[1]
Please file a bug at: https://gitlab.sac-home.org/sac-group/sac2c/-/issues
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking