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

type pattern that contain + or * do match incorrectly

When compiling

int foo( int[*,n] a)
{
    return n;
}


int main()
{
   return foo( [[1,2]]);
}

with sac2c -check cp -noprelude tutu2.sac -b2 using sac2c 2.1.0-PuurGeluk-209-ge94f3 we get:

int _tp_foo_impl( int[+] a { ,NN } )
/*
 *  _tp_foo_impl ::  ---
 */
{
  n = _sel_VxA_( [ 0 ], _shape_A_( a)) /* no constant offset in dim 1 */;
  return( n);
}

which is wrong! For + instead of * that is (and also was prior to MR!612) wrong. MR!612 corrected ATP for d>n:shp pattern and saved var-pattern slightly differently than before but both versions do not handle these cases correctly.

Another example, which I believe to be the same issue, is the take function with the second argument TP being [n:oshp,*] .... So, once the above example is fixed, please check the take variant and, if necessary, raise another issue....

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking