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

bug in aud code generation

When we compile the following example (sac2c 1.3.3-MijasCosta-572-g9eca without flags)

tutu.sac

we get a two element vector as result! Closer inspection shows that there is a problem in the descriptor initialisation for the constant array.

after compilation, we have:

SAC_ND_ALLOC_BEGIN((SACp_emal_2334__flat_18, (AUD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), 1, 1, int) ND_CREATE__ARRAY__SHAPE( (SACp_emal_2334__flat_18, (AUD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), -1, 1, 2, 2, (SACl_f, (AUD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), (SACl_f, (AUD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), -2) SAC_ND_ALLOC_END((SACp_emal_2334__flat_18, (AUD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), 1, 1, int)

ALLOC_BEGIN is expanded into:

... SACp_emal_2334__flat_18__dim = 1;

subsequently, ND_CREATE__ARRAY__SHAPE does not change the dim, but it fills the shape components correctly up until __dim:

... (((SAC_array_descriptor_t) (((intptr_t)SACp_emal_2334__flat_18__desc) & (-1 ^ (3))))[(6 + (0))]) = 2; SAC_i = 1; for (SAC_j = 0; SAC_i < SACp_emal_2334__flat_18__dim; SAC_i++, SAC_j++) { (((SAC_array_descriptor_t) (((intptr_t)SACp_emal_2334__flat_18__desc) & (-1 ^ (3))))[(6 + (SAC_i))]) = (((SAC_array_descriptor_t) (((intptr_t)SACl_f__desc) & (-1 ^ (3))))[(6 + (SAC_j))]); } ...

all the data is copied correctly as well!

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