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
  • #2337
Closed
Open
Created May 03, 2023 by Robert Bernecky@rbeDeveloper

-nowlur causes wrong answer at run-time

apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornBoolean/crud$ sac2c crud.sac -dowlur -DBAD This works fine, with the following result at the tail:

a.out
...
 A_38  timesreduce arg, result is:
Dimension:  1
Shape    : <  2>
< 1  2 > 
Dimension:  0
Shape    : < >
 2

 prod(A_37), result is:
Dimension:  0
Shape    : < >
 2

However, if I compile it with:

sac2c  crud.sac -nowlur -DBAD


 A_38  timesreduce arg, result is:
Dimension:  1
Shape    : <  2>
< 1  2 > 
Dimension:  0
Shape    : < >
 1

 prod(A_37), result is:
Dimension:  0
Shape    : < >
 1

Compiling with "-d treecheck -chkfreq 4" finds several problems.

**** Type stabilization cycle pass: 1
  
 ****** Optimizing regular function:
 ******  _MAIN::main( hidden, hidden, hidden): ...
          Applying type upgrade ...
          -> Running syntax tree checks
Internal compiler error
Assertion "NODE_TYPE( arg_node)== N_module || global.local_funs_grouped" failed at /home/sac/sac2c/build_d/src/libsac2c/check_reset.c:44 -- If run fun-based, special funs must be grouped.

and lots of these:

 AVIS_SSAASSIGN is does not point to correct N_assign node for N_ids
Warning:
  AVIS_SSAASSIGN does not point to correct N_assign node
Warning:
  attribute ID_WL must be NULL

Similarly, if I compile with -check a, a.out executes without crashing, so no help there.

In the check_reset.c crash, arg_node is an N_fundef, and global.local.funs_grouped is false, yet according to sac2c -h, all but one of the traversals in scyc are fun-based.

crud.sac

sac2c_d -V
sac2c 1.3.3-MijasCosta-1047-g0c4a5
build-type: DEBUG
built-by: "sac" at 2023-02-15T14:33:53

Looking at -bopt code gave me a headache, so I welcome ideas.

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