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
  • #2051
Closed
Open
Created Jun 13, 2017 by Andreas Boysen@abnGuest

Tutorial code crashes sac2c (Listing 20)

Bugzilla Link 1195
Created on Jun 13, 2017 23:33
Resolution FIXED
Resolved on Jun 20, 2017 19:55
Version svn
OS Linux
Architecture PC
Attachments bugbug_no.sac

Extended Description

Created an attachment (id=1061) bugbug_no.sac I tried to compile the tutorial example (Listing 20: Relaxation with Cyclic Boundaries) in part 2.2.3 from the tutorial on sac-home.org (http://www.sac-home.org/doku.php?id=docs:tutorial#Ch2.S2.SS3). the compiler exits with the message :

sac2c  hw8.sac 
Internal compiler error
Assertion "cviv[0] < cvshp[0]" failed at /var/jenkins/workspace/sac2c-packages/cudas/cuda-8.0/label/RHEL7/packs/RPM/phmo/ON/src/libsac2c/constants/constants_struc_ops.c:1262 -- Index error: iv[0] >= shp([0]
Please file a bug at: http://bugs.sac-home.org

I was able to reduce the code to (bugbug_no.sac)

use StdIO: all;
use Array: all;
int main()
{
  weights = [0,0,0];
  vect = [1, 0,0,0];
  erg = { iv -> weights[iv] + rotate(iv, vect)};
  print(erg);
  return 0;
}

If I apply any of the following changes, sac2c runs without error:

line6:  a shorter array
    weights = [0,0] 
line7:  a zero array
    vect = [0, 0,0,0]
line7:  a shorter array
    vect = [1,0,0]
line9:  a fix rotate value
    ... rotate([100], vect) ...
line9:  removing the rotate
    erg = { iv -> weights[iv] +  vect};
line9:  replacing the rotate
    erg = { iv -> weights[iv] + shift(iv, 42, vect)};
line10 removing print

I'm using the sac2c version (sac2c -help): "1.2-beta-BlackForest-467-gce8d4" downloaded via AUR. on a Arch linux (uname -a) "Linux Andromeda 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux" the SacBase/Stdlib was downloaded today (2017-06-14) from github. related bugs: I'm not sure if bug report "Bug 1042" is the same issue or not.

Edited Oct 18, 2018 by Artem Shinkarov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking