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
  • #2267
Closed
Open
Created Jun 25, 2021 by Robert Bernecky@rbeDeveloper

negative array shape crash in code generator

sac2c_d snp3.codegencrash.sac -v1 
Internal compiler error
Assertion "size >= 0" failed at /home/sac/sac2c.AprilFool/sac2c/src/libsac2c/codegen/icm2c_std.c:1250 -- array with size <0 found!
cat snp3.codegencrash.sac 
use Array: {genarray,sum,shape,toi,sel,-,drop,==};

inline    // ! ! ! must be inlined to fail
bool[.,.,.] jotdoteqIIB(int [.] x, int [.,.] y)
{ /* AxA outer product */
        cell = genarray(shape(y), false);
        z = with { (. <= iv <= .) { xitem = x[iv];
                } : xitem == y;
        } : genarray(shape(x), cell);
        return(z);
}

int[.,.] plusslXBIFOLD(bool[.,.,.] y)
{ /* last axis reduce rank-2 or greater matrix w/folding */
        zrho = [3,10000];
        z = with { (. <= iv <= .)
                        : sum(toi(y[iv]));
        } : genarray(zrho, 0);
        return(z);
}

int main()
{ 
        snp_0 = genarray([10000,80000], 2);
        A_17=jotdoteqIIB([0, 1, 2],snp_0);
        A_56=plusslXBIFOLD( A_17);
        return(sum(A_56));
}
sac2c -V
sac2c 1.3.3-MijasCosta-677-g0587e
build-type: RELEASE
built-by: "sac" at 2021-06-23T15:20:00]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking