sac2c issueshttps://gitlab.sac-home.org/sac-group/sac2c/-/issues2022-03-05T07:43:12Zhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2295testing when two files are needed2022-03-05T07:43:12ZSven-Bodo Scholztesting when two files are neededI need a class and a program to produce the error. It seems creating a suitable test is not quite possible, is it?I need a class and a program to produce the error. It seems creating a suitable test is not quite possible, is it?Artem ShinkarovArtem Shinkarovhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2294code generation bug for AKD specialisation of AUD code and printf2022-05-04T13:30:03ZSven-Bodo Scholzcode generation bug for AKD specialisation of AUD code and printfThis is a strange bug that can be reproduced when compiling the following code:
```
use Array: all;
int[2] scanP( int[2] a)
{
return a;
}
int[*] scanP( int[*] a)
{
a = {[i] -> scanP( a[i])};
StdIO::printf (" ");
return...This is a strange bug that can be reproduced when compiling the following code:
```
use Array: all;
int[2] scanP( int[2] a)
{
return a;
}
int[*] scanP( int[*] a)
{
a = {[i] -> scanP( a[i])};
StdIO::printf (" ");
return a;
}
int main()
{
a = reshape( [2,2], iota(4));
a = scanP (a);
return 0;
}
```
and compiling with `-noprelude`.
The `reshape iota` is needed to enable akd-specialisation only.
This leads to a segfault due to an allocation with undefined size....https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2292Compiling an empty program leads to a core dump in 12:wlur2022-05-04T13:30:02ZMichiel VerloopCompiling an empty program leads to a core dump in 12:wlurIn the most recent commit on the develop branch (c21cf938e9047879795de2700edaf662f50f2041), SaC dumps the core when trying to compile an empty program in the with-loop unrolling step.
This bug is not yet present in the `1.3.3-MijasCost...In the most recent commit on the develop branch (c21cf938e9047879795de2700edaf662f50f2041), SaC dumps the core when trying to compile an empty program in the with-loop unrolling step.
This bug is not yet present in the `1.3.3-MijasCosta-705-g41ed2` release.
I'd attach a minimum working example but if you're in the build folder it's literally just `touch test-empty.sac && ./sac2c_d test-empty.sac`Hans-Nikolai ViessmannHans-Nikolai Viessmannhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2291CentOS 8/RHEL 8 (non Stream) is EOL; unable to build CUDA pkgs2022-02-07T14:24:55ZHans-Nikolai ViessmannCentOS 8/RHEL 8 (non Stream) is EOL; unable to build CUDA pkgsWe are unable to create new CUDA packages of sac2c for the CentOS 8 distro.
Unfortunately, in an attempt to push users to CentOS 8 Stream (rolling release model), the CentOS/RHEL guys EOL'd CentOS 8 end of 2021, with a short grace-peri...We are unable to create new CUDA packages of sac2c for the CentOS 8 distro.
Unfortunately, in an attempt to push users to CentOS 8 Stream (rolling release model), the CentOS/RHEL guys EOL'd CentOS 8 end of 2021, with a short grace-period till the repos were closed. As off now (Feb. 2022) the official CentOS 8 repos are down.
Users have the option to switch to Stream, *but* NVIDIA has not yet decided what they're going to do about this: https://gitlab.com/nvidia/container-images/cuda/-/issues/149. It isn't clear if they're going to provide packages for Stream, or if they move to another RHEL8 derivative distro like RockyLinux (https://rockylinux.org/).
Additionally, CentOS 9 is also out, but NVIDIA *does not* support it (at the moment?). Bizarrely CentOS 7 is still supported by CentOS/RHEL guys for a few more years (WTF?!?!?!?!), so building here works fine.
So the questions is, what do we do? Do we try to force a build on a unsupported distro, or do we drop it for the moment?https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2290fun-attrs.h missing on install2022-02-06T12:30:17ZHans-Nikolai Viessmannfun-attrs.h missing on installWith an installed version of sac2c we no longer have the fun-attrs.h header available:
```sh
0%] Building `ScalarArith.sac' from `ScalarArith.xsac' for target `seq'
[ 0%] Building module `ScalarArith' for target `seq'
In file include...With an installed version of sac2c we no longer have the fun-attrs.h header available:
```sh
0%] Building `ScalarArith.sac' from `ScalarArith.xsac' for target `seq'
[ 0%] Building module `ScalarArith' for target `seq'
In file included from /usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release/sac.h:105,
from /tmp/SAC_EVD6hb/header.h:278,
from /tmp/SAC_EVD6hb/fun1.c:1:
/usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release/libsac/essentials/message.h:21:10: fatal error: fun-attrs.h: No such file or directory
21 | #include "fun-attrs.h"
| ^~~~~~~~~~~~~
compilation terminated.
abort: System failed to execute shell command
abort: /usr/sbin/cc -I. -DHAVE_CONFIG_H
abort: -I/builds/sac-group/build-sac-pkgs/stdlib-build/include
abort: -I/builds/sac-group/build-sac-pkgs/stdlib/include -DFULLTYPES
abort: -DEXT_STDLIB
abort: -I/usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release
abort: -DSAC_TARGET_STRING=\"seq\" -DSAC_MODEXT_STRING=\".so\"
abort: -DSAC_TARGET_ENV_STRING=\"host\" -DSAC_SBI_STRING=\"seq\"
abort: -DSAC_RC_METHOD=SAC_RCM_local -DSAC_BACKEND_C99 -DSAC_MT_LIB_
abort: -DSAC_MT_MODE=0 -DSAC_DO_RTSPEC=0 -DSAC_DO_CUDA_ALLOC=SAC_CA_system
abort: -DSAC_DO_CUDA_SYNC=1 -O3 -mtune=generic -pedantic -g -fPIC
abort: -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
abort: -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter
abort: -Wno-unused-but-set-variable -Wno-unused-function -Wno-strict-overflow
abort: -Wimplicit-fallthrough=3 -Wno-format-truncation -pedantic -std=gnu99
abort: -pedantic -Wno-unused -fno-builtin -E -o /tmp/SAC_EVD6hb/fun1.i
abort: /tmp/SAC_EVD6hb/fun1.c
abort: with exit code 1
compilation failed while Creating binary code.
make[2]: *** [src-seq/CMakeFiles/seq-module-Interval.dir/build.make:74: lib/host/seq/libIntervalMod.so] Error 168
make[1]: *** [CMakeFiles/Makefile2:2319: src-seq/CMakeFiles/seq-module-Interval.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release/sac.h:105,
from /tmp/SAC_HDPAPK/header.h:278,
from /tmp/SAC_HDPAPK/fun1.c:1:
/usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release/libsac/essentials/message.h:21:10: fatal error: fun-attrs.h: No such file or directory
21 | #include "fun-attrs.h"
| ^~~~~~~~~~~~~
compilation terminated.
abort: System failed to execute shell command
abort: /usr/sbin/cc -I. -DHAVE_CONFIG_H
abort: -I/builds/sac-group/build-sac-pkgs/stdlib-build/include
abort: -I/builds/sac-group/build-sac-pkgs/stdlib/include -DFULLTYPES
abort: -DEXT_STDLIB
abort: -I/usr/local/include/sac2c/1.3.3-MijasCosta-736-g60b1b/release
abort: -DSAC_TARGET_STRING=\"seq\" -DSAC_MODEXT_STRING=\".so\"
abort: -DSAC_TARGET_ENV_STRING=\"host\" -DSAC_SBI_STRING=\"seq\"
abort: -DSAC_RC_METHOD=SAC_RCM_local -DSAC_BACKEND_C99 -DSAC_MT_LIB_
abort: -DSAC_MT_MODE=0 -DSAC_DO_RTSPEC=0 -DSAC_DO_CUDA_ALLOC=SAC_CA_system
abort: -DSAC_DO_CUDA_SYNC=1 -O3 -mtune=generic -pedantic -g -fPIC
abort: -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
abort: -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter
abort: -Wno-unused-but-set-variable -Wno-unused-function -Wno-strict-overflow
abort: -Wimplicit-fallthrough=3 -Wno-format-truncation -pedantic -std=gnu99
abort: -pedantic -Wno-unused -fno-builtin -E -o /tmp/SAC_HDPAPK/fun1.i
abort: /tmp/SAC_HDPAPK/fun1.c
abort: with exit code 1
compilation failed while Creating binary code.
make[2]: *** [src-seq/CMakeFiles/seq-module-ScalarArith.dir/build.make:74: lib/host/seq/libScalarArithMod.so] Error 168
make[1]: *** [CMakeFiles/Makefile2:340: src-seq/CMakeFiles/seq-module-ScalarArith.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
```Hans-Nikolai ViessmannHans-Nikolai Viessmannhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2289Newest release fails to install sac-stdlib on RHEL 82022-02-04T16:06:30ZTroels HenriksenNewest release fails to install sac-stdlib on RHEL 8I downloaded the two "full" packages listed for RHEL 8 [here](https://gitlab.sac-home.org/sac-group/sac-packages/-/releases#v1.3.3-705-1). While sac2c-1.3.3-MijasCosta-705-g41ed2-omnibus.rpm installs fine, sac-stdlib-1.3-137-g1cad5.rpm ...I downloaded the two "full" packages listed for RHEL 8 [here](https://gitlab.sac-home.org/sac-group/sac-packages/-/releases#v1.3.3-705-1). While sac2c-1.3.3-MijasCosta-705-g41ed2-omnibus.rpm installs fine, sac-stdlib-1.3-137-g1cad5.rpm fails with:
```
Error:
Problem: conflicting requests
- nothing provides sac2c-compiler = 1.3.3.709 needed by sac-stdlib-1.3_137_g1cad5-1.x86_64
```
(Note 709 versus the 705 in the sac2c package version.)https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2288crash optimizing reference counts in phase 152022-02-09T22:39:52ZRobert Berneckycrash optimizing reference counts in phase 15[UTThornReal.sacbugreport](/uploads/9e718869d25738b48e71b56f1f25080b/UTThornReal.sacbugreport)
```
**** Optimizing reference counting instructions ...
TRAVERSE ERROR: node of type 32:N_id found where 33:N_num was expected!
sac2c -V
s...[UTThornReal.sacbugreport](/uploads/9e718869d25738b48e71b56f1f25080b/UTThornReal.sacbugreport)
```
**** Optimizing reference counting instructions ...
TRAVERSE ERROR: node of type 32:N_id found where 33:N_num was expected!
sac2c -V
sac2c 1.3.3-MijasCosta-711-gf5267
build-type: RELEASE
built-by: "sac" at 2022-01-18T13:13:49
```
sacbugreport attachedhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2287sac2c do not protect space character in folderpath or filename when construct...2022-11-27T20:18:26ZRenato Ferocesac2c do not protect space character in folderpath or filename when constructing compiler callAssume wsl is opened and located in the folder "user/folder1 containing spaces/folder2 containing spaces".\
In this folder, I created the file world.sac.
running the command "sac2c -o world./world.sac", resulted only in a generated file...Assume wsl is opened and located in the folder "user/folder1 containing spaces/folder2 containing spaces".\
In this folder, I created the file world.sac.
running the command "sac2c -o world./world.sac", resulted only in a generated file called "world.c" (both expected files "world" and "world.i" were not generated).\
Moreover, the shell shows the error:
cc: error: containing: No such file or directory\
cc: error: spaces/folder2: No such file or directory\
cc: error: containing: No such file or directory\
cc: error: spaces/a.out.i: No such file or directory\
cc: error: user/folder1: No such file or directory\
cc: error: containing: No such file or directory\
cc: error: spaces/folder2: No such file or directory\
cc: error: containing: No such file or directory\
cc: error: spaces/a.out.c: No such file or directory\
cc: fatal error: no input files\
compilation terminated.\
abort: System failed to execute shell command\
abort: /usr/bin/cc -I. -I/usr/local/include/sac2c/1.3.3-MijasCosta-718-g26409/release\
[...] // containing many flags and/or variables\
abort: -Wno-unused -fno-builtin -E -o /user/folder1 containing spaces/folder2 containing\
abort: spaces/a.out.i /user/folder1 containing spaces/folder2 containing spaces/a.out.c\
abort: with exit code 1\
compilation failed while Creating binary code.\https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2286C compiler issues warnings on wrapper functions2022-01-31T15:45:15ZSven-Bodo ScholzC compiler issues warnings on wrapper functionsMy latest compiler (clang 12) complains about our wrapper codes.
As a frequent pattern, they generate code like this
```
int res;
if (cond) {
res = fun();
} else {
SAC_RuntimeError ( "type error.....");
}
return res;
```
The c...My latest compiler (clang 12) complains about our wrapper codes.
As a frequent pattern, they generate code like this
```
int res;
if (cond) {
res = fun();
} else {
SAC_RuntimeError ( "type error.....");
}
return res;
```
The compiler complains about `res` potentially not being initialised.
We have two options ere: either initialise `res` with some dummy value, or declare `SAC_RuntimeError` to be non-returning.
I would prefer the latter, *but* I am not sure how to do this in a platform (C compiler) - independent way. My clang compiler allows for:
`_Noreturn void SAC_RuntimeError( ...);`
This seems to be C++11 standard as well..... but I guess we may have to go through cmake to make this happen.https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2285-check t producing cc warnings2023-01-27T09:48:46ZSven-Bodo Scholz-check t producing cc warningsCompiling
```
int main()
{
a = Array::iota(16);
return _sel_VxA_([0], a);
}
```
with sac2c -check t -noprelude on 1.3.3-MijasCosta-705-g41ed2
yields:
```
/Volumes/Users/sbs/Dropbox/BodoSac/scan/a.out.c:520:24: warning: code wil...Compiling
```
int main()
{
a = Array::iota(16);
return _sel_VxA_([0], a);
}
```
with sac2c -check t -noprelude on 1.3.3-MijasCosta-705-g41ed2
yields:
```
/Volumes/Users/sbs/Dropbox/BodoSac/scan/a.out.c:520:24: warning: code will never be executed [-Wunreachable-code]
if (!((0 == 0))) { SAC_RuntimeErrorLine (5, "1st argument of _idx_sel_ is not a scalar!"); };
^~~~~~~~~~~~~~~~~~~~
/Volumes/Users/sbs/Dropbox/BodoSac/scan/a.out.c:520:12: note: silence by adding parentheses to mark code as explicitly dead
if (!((0 == 0))) { SAC_RuntimeErrorLine (5, "1st argument of _idx_sel_ is not a scalar!"); };
^
/* DISABLES CODE */ ( )
/Volumes/Users/sbs/Dropbox/BodoSac/scan/a.out.c:453:24: warning: code will never be executed [-Wunreachable-code]
if (!((0 == 0))) { SAC_RuntimeErrorLine (237, "Assignment with incompatible types found!"); };
^~~~~~~~~~~~~~~~~~~~
/Volumes/Users/sbs/Dropbox/BodoSac/scan/a.out.c:453:12: note: silence by adding parentheses to mark code as explicitly dead
if (!((0 == 0))) { SAC_RuntimeErrorLine (237, "Assignment with incompatible types found!"); };
^
/* DISABLES CODE */ ( )
2 warnings generated.
```
This is not a bug but a nuisance :-)https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2284bug in CTZ2022-01-25T11:51:22ZSven-Bodo Scholzbug in CTZCTZ is not correct for unsigned types such as uint!
Example:
```
noinline
int foo( uint a)
{
b = _lt_SxS_ ( 0ui, a);
return _toi_S_( b);
}
int main ()
{
return foo( 2ui );
}
```
CTZ turns the body into (sac2c -bopt):
```
...CTZ is not correct for unsigned types such as uint!
Example:
```
noinline
int foo( uint a)
{
b = _lt_SxS_ ( 0ui, a);
return _toi_S_( b);
}
int main ()
{
return foo( 2ui );
}
```
CTZ turns the body into (sac2c -bopt):
```
int _MAIN::foo( uint a { ,NN } )
/*
* foo :: ---
*/
{
uint _esd_13 { , NN } ;
int _flat_1 { , NN } ;
bool b { , NN } ;
_esd_13 = _neg_S_( a);
b = _lt_SxS_( _esd_13, 0ui);
_flat_1 = _toi_S_( b);
return( _flat_1);
}
```
which clearly is not legal as _neg_S_ is illegal. The fact that the type inference does not complain about it shows that the type inference is not correct for _neg_ on unsigned types either :-)
So it is two bugs for the price of one.Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/228342u is parsed as int rather than uint2022-01-21T19:49:47ZSven-Bodo Scholz42u is parsed as int rather than uintIt turns out that the lexer scans `42u` as `tok_number` instead of `tok_number_uint`, only
`42ui` is scanned as `tok_number_uint`.It turns out that the lexer scans `42u` as `tok_number` instead of `tok_number_uint`, only
`42ui` is scanned as `tok_number_uint`.https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2282Streamlining errors and warnings2022-08-13T15:43:04ZMichiel VerloopStreamlining errors and warningsCurrently, all errors, warnings and notes (here: messages) go through the various functions in `/src/libsac2c/global/ctinfo.c`.
For these messages, the file and location are printed if they are present and relevant. For longer messages...Currently, all errors, warnings and notes (here: messages) go through the various functions in `/src/libsac2c/global/ctinfo.c`.
For these messages, the file and location are printed if they are present and relevant. For longer messages, they are split up and joined by a new line and one of the seperators `"abort: "`, `"error: "`, `"warning: "`, `"=> "`, `""`, `" "`.
An example of this can be seen by compiling any valid sac file and giving the `-printstart` compiler argument without also providing `-printstop`:
```
$ sac2c generic_error.sac -printstart 1:prs
error: Please use both -printstart <phase_id> and -printstop <phase_id>
error: If it is only one phase/subphase/cyclephase you want reported
error: then the -printstart and -printstop options should be identical.
compilation failed while Loading SAC program, 1 error(s).
```
If multiple such errors appear after each other, it's impossible for a computer to tell where the first error ends and the second error begins. For humans, I argue the distinction between the two errors wouldn't be immediately obvious either.
Additionally, type errors and SAC optimization errors currently differ in format from the other errors for no discernable reason.
In an effort to make the messages from the compiler parsable by regexes without ambiguity and to increase readability, I propose the following:
* The error message is only printed on the first line if the message bears no location information.
* The error message is always printed on a subsequent line if the file, line and/or column is known.
* The message header (abort/error/warning) is included in the function that determines where to place line breaks.
* Type errors are unified with the other errors.
* We capitalize the message headers and 'compilation' properly. (Arguably not important but this bugs me more than it should)
<details><summary>Current vs proposed message forms (click to expand)</summary>
<details><summary>Errors without location information</summary>
Current:
```
$ sac2c generic_error.sac -printstart 1:prs
error: Please use both -printstart <phase_id> and -printstop <phase_id>
error: If it is only one phase/subphase/cyclephase you want reported
error: then the -printstart and -printstop options should be identical.
compilation failed while Loading SAC program, 1 error(s).
```
Proposed:
```
$ sac2c generic_error.sac -printstart 1:prs
Error: Please use both -printstart <phase_id> and -printstop <phase_id>
If it is only one phase/subphase/cyclephase you want reported
then the -printstart and -printstop options should be identical.
Compilation failed while Loading SAC program, 1 error(s).
```
</details>
<details><summary>Errors with line information</summary>
Current:
```
$ sac2c overload_error.sac
./overload_error.sac 10 abort: Cannot overload functions of arity 0
compilation failed while Converting to static single assignment form.
```
Proposed:
```
$ sac2c overload_error.sac
./overload_error.sac 10 abort:
Cannot overload functions of arity 0
Compilation failed while Converting to static single assignment form.
```
</details>
<details><summary>Errors line and column information</summary>
Current:
```
$ sac2c syntax_error.sac
./syntax_error.sac:7:12: error:
=> token `}' expected, `f' token found
./syntax_error.sac:7:12: error:
=> type expected, `f' found
./syntax_error.sac:9:1: error:
=> function body or semicolon expected
abort: Failed to construct a syntax tree for `syntax_error.sac'
compilation failed while Loading SAC program, 3 error(s).
```
Proposed:
```
$ sac2c syntax_error.sac
./syntax_error.sac:7:12: error:
token `}' expected, `f' token found
./syntax_error.sac:7:12: error:
type expected, `f' found
./syntax_error.sac:9:1: error:
function body or semicolon expected
Abort: Failed to construct a syntax tree for `syntax_error.sac'
Compilation failed while Loading SAC program, 3 error(s).
```
</details>
</details>
I am still unsure what to do about SAC optimization errors. For the purposes of easily detecting them, I'd like to give them a special header like `optimization error`. Other than that, I'm told that finding the location in the source code instead of generated code is a worth a thesis on its own, so we probably can't make those more kind to the users.Michiel VerloopMichiel Verloophttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2280Flag -no opt causes internal error: with-loop with empty iteration space found2022-01-22T08:24:14ZMichiel VerloopFlag -no opt causes internal error: with-loop with empty iteration space foundVersion: sac2c 1.3.3-MijasCosta-705-g41ed2
Launch arguments: `sac2c MWE.sac -no opt`
Relevant output:
```
Internal compiler error
Program reached impossible state at /builds/sac-group/build-sac-pkgs/sac2c/src/libsac2c/wltransform/wltr...Version: sac2c 1.3.3-MijasCosta-705-g41ed2
Launch arguments: `sac2c MWE.sac -no opt`
Relevant output:
```
Internal compiler error
Program reached impossible state at /builds/sac-group/build-sac-pkgs/sac2c/src/libsac2c/wltransform/wltransform.c:6970 -- with-loop with empty iteration space found!
```
Compiling the program with optimizations enabled builds the program without errors, as expected.
The minimum working example is attached as [MWE.sac](/uploads/41708f26afdb9e885dbcca41c1000a50/MWE.sac)https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2277make warnings for sac2c on ubuntu 21.102022-01-01T20:50:32ZRobert Berneckymake warnings for sac2c on ubuntu 21.10Version 41ed2a07336495a37360df1643e3d11cb272932e of sac2c gets this warning
during make:
```
/home/sac/sac2c/src/libsac2c/support/system.c: In function ‘SYSexec_and_read_output’:
[ 85%] Building C object src/libsac2c/CMakeFiles/sac2cSh...Version 41ed2a07336495a37360df1643e3d11cb272932e of sac2c gets this warning
during make:
```
/home/sac/sac2c/src/libsac2c/support/system.c: In function ‘SYSexec_and_read_output’:
[ 85%] Building C object src/libsac2c/CMakeFiles/sac2cShared.dir/typecheck/create_wrapper_code.c.o
/home/sac/sac2c/src/libsac2c/support/system.c:282:5: warning: ‘fclose’ called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
282 | fclose (f);
| ^~~~~~~~~~
/home/sac/sac2c/src/libsac2c/support/system.c:264:15: note: returned from ‘popen’
264 | FILE *f = popen (cmd, "r");
| ^~~~~~~~~~~~~~~~
```https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2276crash while inferring ranges for set expressions2022-02-08T18:19:19ZRobert Berneckycrash while inferring ranges for set expressionssac2c crashes quickly on this:
```
use Array:{sel};
int main()
{
y = [true, false];
z = with {
//(. <= iv <= .) : sel( sel( iv, y) ? ["0 "] : ["1 "]);
(. <= iv <= .) : sel( true ? ["0 "] : ["1 "]);
} : genar...sac2c crashes quickly on this:
```
use Array:{sel};
int main()
{
y = [true, false];
z = with {
//(. <= iv <= .) : sel( sel( iv, y) ? ["0 "] : ["1 "]);
(. <= iv <= .) : sel( true ? ["0 "] : ["1 "]);
} : genarray([2]);
return(0);
}
```Sven-Bodo ScholzSven-Bodo Scholzhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2275Newly cloned sac2c does not like extant ~/.sac2crc folder2021-09-15T19:06:00ZRobert BerneckyNewly cloned sac2c does not like extant ~/.sac2crc folderI ran into this while trying to build a newly cloned sac2c on my system. I don't particularly want to blow
away the other sac2crc stuff...
Regardless of that, the error message is clearly wrong. What's the best
way to handle this?
T...I ran into this while trying to build a newly cloned sac2c on my system. I don't particularly want to blow
away the other sac2crc stuff...
Regardless of that, the error message is clearly wrong. What's the best
way to handle this?
This is my commit after:
commit 9e509b33cd5f24726a0a5a4c78d329044c6a2649 (origin/develop, origin/HEAD, NoSerialize)
```
~/sac2c.Mainbranch/sac2c/build_r$ sudo make install
[sudo] password for sac:
[ 0%] Checking git repo version
[ 0%] Built target check_repo_version
[ 1%] Built target sac2c
[ 1%] Built target cse
[ 1%] Built target echo
[ 1%] Built target sac2tex
[ 2%] Built target csd
[ 2%] Built target cb
[ 2%] Copying over sac2crc file to user's .sac2crc directory
CMake Error at /home/sac/sac2c.Mainbranch/sac2c/cmake/place-sac2crc-prelude-file.cmake:30 (MESSAGE):
No ~/.sac2crc directory found, please create it. If you have a `.sac2crc'
file, please move this to the ~/.sac2crc directory and rename it
`sac2crc.config'.
make[2]: *** [CMakeFiles/copy-sac2crc-prelude-file.dir/build.make:71: CMakeFiles/copy-sac2crc-prelude-file] Error 1
make[1]: *** [CMakeFiles/Makefile2:554: CMakeFiles/copy-sac2crc-prelude-file.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
sac@boa:~/sac2c.Mainbranch/sac2c/build_r$ git status .
On branch develop
Your branch is ahead of 'origin/develop' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
```https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2274TC problem with conditionals2021-09-20T09:40:55ZSven-Bodo ScholzTC problem with conditionalsThe following program
```
int main()
{
bodies = [1,2,3,4,5,6,7];
accs = {[i] -> {[j] -> (_eq_SxS_(i,j) ? _sel_VxA_([i], bodies) : _sel_VxA_([j], bodies)) } };
return(0);
}
```
when compiled with `-noprelude` yields:
```
./b...The following program
```
int main()
{
bodies = [1,2,3,4,5,6,7];
accs = {[i] -> {[j] -> (_eq_SxS_(i,j) ? _sel_VxA_([i], bodies) : _sel_VxA_([j], bodies)) } };
return(0);
}
```
when compiled with `-noprelude` yields:
```
./bodies.sac 5 error: Identifier '_hce_23` used without previous definition
./bodies.sac 5 error: Identifier '_hce_22` used without previous definition
./bodies.sac 5 error: Identifier '_hce_25` used without previous definition
./bodies.sac 5 error: Identifier '_hce_24` used without previous definition
compilation failed while Converting to static single assignment form, 4 error(s).
```
in phase 4 when using
```
sac2c 1.3.3-MijasCosta-721-g71fd
```Sven-Bodo ScholzSven-Bodo Scholzhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2271WLF multi-operator bug2021-08-19T16:12:01ZSven-Bodo ScholzWLF multi-operator bugThe following program:
```
int main()
{
ax,ay = with {
( [0, 0] <= [i,j] < [2,10]) : (2, 2.0);
} : ( genarray( [10,10] ,1),
genarray( [10,10], 1.0 ));
ax,ay = with {
( [0, 0] <= [i...The following program:
```
int main()
{
ax,ay = with {
( [0, 0] <= [i,j] < [2,10]) : (2, 2.0);
} : ( genarray( [10,10] ,1),
genarray( [10,10], 1.0 ));
ax,ay = with {
( [0, 0] <= [i,j] < [2,10]) : (_sel_VxA_([i,j], ax), _sel_VxA_([i,j], ay));
} : ( genarray( [10,10] ,1),
genarray( [10,10], 1.0 ));
return _sel_VxA_( [2,2], ax) ;
}
```
when compiled with
`sac2c 1.3.3-MijasCosta-682-gd1a1`
replaces the second selection wrongly, which subsequently leads to the following error:
```
error: line 9 in file ./reg.sac:
error: Element types of one generator body expression and another generator body expression should be identical; types found:
error: double{1.0...} and int{2}
compilation failed while Running SAC optimizations.
```https://gitlab.sac-home.org/sac-group/sac2c/-/issues/2270WLIDX breakes on multi-operator WL2021-08-10T12:42:56ZSven-Bodo ScholzWLIDX breakes on multi-operator WLName: sac2c
Version: 1.3.3-MijasCosta-682-gd1a1
Build-type: DEBUG
Date: 2021-08-07T23:34:36
User: sbs
Host: SvenBodosAir2.fritz.box
...Name: sac2c
Version: 1.3.3-MijasCosta-682-gd1a1
Build-type: DEBUG
Date: 2021-08-07T23:34:36
User: sbs
Host: SvenBodosAir2.fritz.box
Detected OS string: Darwin-20.3.0
Detected CPU string: x86_64
CMake Generator: Unix Makefiles
CMake Variant: DEBUG
when run with -v3 reg.sac -bopt:wlidx -noprelude
on
```c
int main()
{
zz_c_g = 0;
zz_c_h = 1.0;
zz_a = [1,2];
zz_b = 6;
yy_c_g = 9;
yy_c_h = 3.0;
yy_a = [5,6];
yy_b = 7;
dim = [3,3];
zz_c_g, zz_c_h, zz_a, zz_b = with {
( [0, 0] <= [i,j] < [1,1] ) : (yy_c_g, yy_c_h, yy_a, yy_b);
} : (genarray( dim, zz_c_g),
genarray( dim, zz_c_h),
genarray( dim, zz_a),
genarray( dim, zz_b));
StdIO::print( _sel_VxA_ ([0,0], zz_b) );
return 0;
}
```
breaks with
```
**** Annotating offset variable at with-loops ...
OOOOOOOPS, your program crashed the compiler 8-((
Please, send a bug report to bugs@sac-home.org,
or file a bug in the SaC-Zilla bug management system.
For your convenience, the compiler has pre-fabricated a bug report
in the file "./reg.sacbugreport" !
```