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
  • #2293
Closed
Open
Created Feb 10, 2022 by Robert Bernecky@rbeDeveloper

Several crashes with -maxoptcyc N, where N is 0 1 or 2

I got tired of waiting for sac2c to get its thumb out, so decided to short-circuit the optimizations. What happens next is shown below. I will look at this issue again when I get some other problems fixed in UTThornInt.sac.

UTThornInt.sac

apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c  UTThornInt.sac -maxoptcyc 0
free(): invalid next size (fast)
Aborted (core dumped)
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c  UTThornInt.sac -maxoptcyc 1
free(): invalid next size (fast)
Aborted (core dumped)
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c  UTThornInt.sac -maxoptcyc 2
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c: In function ‘SACf__MAIN_CLArrayFormat__format__i_1’:
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c:47950:369: error: ‘SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shpSAC_d’ undeclared (first use in this function); did you mean ‘SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shp0’?
47950 |     SAC_AUD_WL_BEGIN((SACp_pinl_63461_iv, (AKD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), (SACp_pinl_63466__wlidx_61383_res, (SCL, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), (SACp_emal_65927__pinl_60713__flat_49__SSA50_1, (AKS, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))))
      |                                                                                                                                                                                                                                                                                                                                                                                 ^                                                      
      |                                                                                                                                                                                                                                                                                                                                                                                 SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shp0
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c:47950:369: note: each undeclared identifier is reported only once for each function it appears in
abort: System failed to execute shell command
abort: /usr/bin/cc -O3  -march=native -mtune=native  -pedantic -g -fPIC -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_SVID_SOURCE
abort: -D_BSD_SOURCE  -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter -Wno-unused-but-set-variable  -Wno-unused-function
abort: -Wno-strict-overflow -Wimplicit-fallthrough=3 -Wno-format-truncation -pedantic -std=gnu99 -pedantic -Wno-unused -fno-builtin 
abort: -c -o /tmp/SAC_mnVRuG/a.out.o /primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.i
abort: with exit code 1
compilation failed while Creating binary code.
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c  UTThornInt.sac -maxoptcyc 3
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ a.out
got to A_69
got past A_69
got to A_74
got past A_74
got to A_82
got past A_82
got to A_92
got past A_92
1 1 1 1
1 1 1 1
0
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c -V
sac2c 1.3.3-MijasCosta-748-ga0acb
build-type: RELEASE
built-by: "sac" at 2022-02-10T10:30:52

With -maxoptcyc 3, the code executes properly.

With the debug compiler, things are slightly different:

apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c_d  UTThornInt.sac -maxoptcyc 0 -v1

error: line 152 in file /home/sac/sac/BASE/Stdlib/src/structures/ArrayBasics.xsac:
error: argument #1 of "_idx_sel_" should be legal offset index into argument #2; types found: int{0}  and  int[0]
compilation failed while Running SAC optimizations.
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c_d  UTThornInt.sac -maxoptcyc 1 -v1

error: line 152 in file /home/sac/sac/BASE/Stdlib/src/structures/ArrayBasics.xsac:
error: argument #1 of "_idx_sel_" should be legal offset index into argument #2; types found: int{0}  and  int[0]
compilation failed while Running SAC optimizations.
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c_d  UTThornInt.sac -maxoptcyc 2 -v1
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c: In function ‘SACf__MAIN_CLArrayFormat__format__i_1’:
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c:47950:369: error: ‘SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shpSAC_d’ undeclared (first use in this function); did you mean ‘SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shp0’?
47950 |     SAC_AUD_WL_BEGIN((SACp_pinl_63461_iv, (AKD, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), (SACp_pinl_63466__wlidx_61383_res, (SCL, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), (SACp_emal_65927__pinl_60713__flat_49__SSA50_1, (AKS, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))))
      |                                                                                                                                                                                                                                                                                                                                                                                 ^                                                      
      |                                                                                                                                                                                                                                                                                                                                                                                 SACp_emal_65927__pinl_60713__flat_49__SSA50_1__shp0
/primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.c:47950:369: note: each undeclared identifier is reported only once for each function it appears in
abort: System failed to execute shell command
abort: /usr/bin/cc   -march=native -mtune=native  -pedantic -g -fPIC -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_SVID_SOURCE
abort: -D_BSD_SOURCE  -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter -Wno-unused-but-set-variable  -Wno-unused-function
abort: -Wno-strict-overflow -Wimplicit-fallthrough=3 -Wno-format-truncation -pedantic -std=gnu99 -pedantic -Wno-unused -fno-builtin 
abort: -c -o /tmp/SAC_v3FTj9/a.out.o /primarypool/dshome/apex/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud/a.out.i
abort: with exit code 1
compilation failed while Creating binary code.
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c_d  UTThornInt.sac -maxoptcyc 3 -v1
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ a.out
got to A_69
got past A_69
got to A_74
got past A_74
got to A_82
got past A_82
got to A_92
got past A_92
1 1 1 1
1 1 1 1
0
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ 
apex@medusa:~/apexgit/Ancillary/benchmks/UnitTests/UTThornInt/src/crud$ sac2c_d -V
sac2c 1.3.3-MijasCosta-748-ga0acb
build-type: DEBUG
built-by: "sac" at 2022-02-10T10:28:29
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking