sac2c issueshttps://gitlab.sac-home.org/sac-group/sac2c/-/issues2017-11-19T21:56:55Zhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2091libsacprelude does not compile2017-11-19T21:56:55ZClemens Grelcklibsacprelude does not compile| | |
| --- | --- |
| Bugzilla Link | [531](http://bugs.sac-home.org/show_bug.cgi?id=531) |
| Created on | Jul 23, 2009 09:15 |
| Resolution | FIXED |
| Resolved on | Jul 23, 2009 18:52 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [531](http://bugs.sac-home.org/show_bug.cgi?id=531) |
| Created on | Jul 23, 2009 09:15 |
| Resolution | FIXED |
| Resolved on | Jul 23, 2009 18:52 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>As of revision 16229 (at least) sac2c fails to compile the sacprelude:
****** Optimizing regular function:
****** sacprelude::adjustLacFunParams( bool[*], int[*], int[.]): ...
Applying common subexpression elimination ...
Inferring loop invariant variables ...
Applying type upgrade ...
Eliminating Type Variables ...
Eliminating Bottom Types ...
Applying function call dispatch ...
Applying inlining ...
Applying with-loop propagation ...
Applying constant folding ...
ASSERTION FAILED: file 'constants/constants_basic.c', line 780
Constant is NULL!
EXECUTION TERMINATED
Aborted</pre>Sven-Bodo ScholzSven-Bodo Scholzhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2080tree gets muddled up by CF; problem with idx_shape_sel2017-11-19T21:55:49ZSven-Bodo Scholztree gets muddled up by CF; problem with idx_shape_sel| | |
| --- | --- |
| Bugzilla Link | [444](http://bugs.sac-home.org/show_bug.cgi?id=444) |
| Created on | Jul 01, 2008 11:00 |
| Resolution | FIXED |
| Resolved on | Jul 02, 2008 05:53 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [444](http://bugs.sac-home.org/show_bug.cgi?id=444) |
| Created on | Jul 01, 2008 11:00 |
| Resolution | FIXED |
| Resolved on | Jul 02, 2008 05:53 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [tutu.sac](/uploads/aa98c09906c9cecd83665fc19ad4187c/tutu.sac) |
## Extended Description
<pre>Created an attachment (id=481)
source code
Here is a small example for a CF problem. Unfortunately, it only arises
if you a) update to rev 15749 and b) modify constant_folding.c in line 224
from INFO_LACFUNOK( arg_info) = TRUE;
into INFO_LACFUNOK( arg_info) = FALSE;
After that you cannot create the prelude anymore!!!
But you can compile the attached example with
sac2c tutu.sac -b11:cyc:wlpr:1 -noprelude and with
sac2c tutu.sac -b11:cyc:cf:1 -noprelude
You will see a difference in the else branch of the conditional in xxx_Cond_0!
If you try to compile further by
sac2c tutu.sac -b11:cyc:dcr:1 -noprelude printing goes badaboom</pre>Sven-Bodo ScholzSven-Bodo Scholzhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2047CF producing wrong answer for min/max( N, N + ( -1))2017-11-19T21:52:37ZRobert BerneckyCF producing wrong answer for min/max( N, N + ( -1))| | |
| --- | --- |
| Bugzilla Link | [1088](http://bugs.sac-home.org/show_bug.cgi?id=1088) |
| Created on | Sep 26, 2013 19:38 |
| Resolution | FIXED |
| Resolved on | Sep 26, 2013 20:55 |
| Version | svn |
| OS | Linux |
| Architectu...| | |
| --- | --- |
| Bugzilla Link | [1088](http://bugs.sac-home.org/show_bug.cgi?id=1088) |
| Created on | Sep 26, 2013 19:38 |
| Resolution | FIXED |
| Resolved on | Sep 26, 2013 20:55 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [crud2.sac](/uploads/834963150b32aba51ca0604e5ac71aaf/crud2.sac) |
## Extended Description
<pre>Created an attachment (id=986)
source code to reproduce fault
The CF function isVal1IsSumOfVal2 was failing to check the sign
of the "constant" argument to the addition when evaluating the
composition min( N, N + constant).
This led me on a merry chase through many dark alleys.</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2023CF in LACFUN fails to catch _idx_sel_( 0, [ X, Y])2017-11-19T21:50:16ZRobert BerneckyCF in LACFUN fails to catch _idx_sel_( 0, [ X, Y])| | |
| --- | --- |
| Bugzilla Link | [870](http://bugs.sac-home.org/show_bug.cgi?id=870) |
| Created on | Sep 06, 2011 23:53 |
| Resolution | FIXED |
| Resolved on | Oct 14, 2011 17:46 |
| Version | svn |
| OS | Linux |
| Architecture...| | |
| --- | --- |
| Bugzilla Link | [870](http://bugs.sac-home.org/show_bug.cgi?id=870) |
| Created on | Sep 06, 2011 23:53 |
| Resolution | FIXED |
| Resolved on | Oct 14, 2011 17:46 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [crud.sac](/uploads/1e1b98207438a8ea840dad60e3f0d398/crud.sac) |
## Extended Description
<pre>Created an attachment (id=817)
source code to reproduce failure
sac@rattler:~/sac2c$ sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 17603:MODIFIED linux-gnu_x86_64
(Tue Sep 6 18:29:51 EDT 2011 by sac)
CF misses this one, which should be simplified to X.
Here's how ya do it:
sac2c crud.sac -doawlf -nowlf -bopt -v1 >crud2
Loop_3 contains the offending code, which happens to
make the -doawlf version of this AKD test run 3X slower
than it should.</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2007constraints are optimised wrongly by symbolic CF2017-11-19T21:48:38ZSven-Bodo Scholzconstraints are optimised wrongly by symbolic CF| | |
| --- | --- |
| Bugzilla Link | [525](http://bugs.sac-home.org/show_bug.cgi?id=525) |
| Created on | Jul 14, 2009 21:20 |
| Resolution | FIXED |
| Resolved on | Jul 15, 2009 12:25 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [525](http://bugs.sac-home.org/show_bug.cgi?id=525) |
| Created on | Jul 14, 2009 21:20 |
| Resolution | FIXED |
| Resolved on | Jul 15, 2009 12:25 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [bug.sac](/uploads/e828563142030780b0eec54ac5f3b1c6/bug.sac) |
## Extended Description
<pre>Created an attachment (id=552)
source code
sac2c rev 16177
compile with -noprelude -check c
running the binary will produce a constraint error.
running -b10 shows:
_flat_0 = 1;
shp = _MAIN::aud( _flat_0);
_idc_27, _icc_16_pred = _non_neg_val_V_( shp);
_idc_28, _idc_29, _icc_19_pred = _same_shape_AxA_( _idc_27, _idc_27);
_idc_30, _icc_20_pred = _val_le_val_VxV_( _idc_29, _idc_29);
_flat_3 = 0;
_flat_2 = _mul_SxV_( _flat_3, _idc_30);
_idc_31, _icc_15_pred = _non_neg_val_V_( _flat_2);
_idc_32, _idc_33, _icc_17_pred = _same_shape_AxA_( _idc_31, _idc_30);
_idc_34, _icc_18_pred = _val_le_val_VxV_( _idc_32, _idc_33);
_flat_1 = 2;
which looks ok to me
running -b11 yields:
_flat_0 = 1;
shp = _MAIN::aud( _flat_0);
_idc_27, _icc_16_pred = _non_neg_val_V_( shp);
_idc_30, _icc_20_pred = _val_le_val_VxV_( _idc_27, _idc_27);
_flat_2 = _mul_SxV_( 0, _idc_30);
_idc_31, _icc_15_pred = _non_neg_val_V_( _flat_2);
_idc_34, _icc_18_pred = _val_le_val_VxV_( _idc_30, _idc_31);
_flat_1 = 2;
the last _val_le_val_VxV_ has been muddled up!!
compilation -noCF makes this bug go away.....</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2001structural CF on _modarray_AxVxA_ broken!2017-11-19T21:48:02ZSven-Bodo Scholzstructural CF on _modarray_AxVxA_ broken!| | |
| --- | --- |
| Bugzilla Link | [447](http://bugs.sac-home.org/show_bug.cgi?id=447) |
| Created on | Jul 11, 2008 12:28 |
| Resolution | FIXED |
| Resolved on | Jul 12, 2008 20:09 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [447](http://bugs.sac-home.org/show_bug.cgi?id=447) |
| Created on | Jul 11, 2008 12:28 |
| Resolution | FIXED |
| Resolved on | Jul 12, 2008 20:09 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [error.sac](/uploads/1ebd5c5c0d79721c5387ce711d644322/error.sac) |
## Extended Description
<pre>Created an attachment (id=489)
source code
as of rev15771:
run sac2c error.sac -v4 -b11:cyc:cse:2 -noprelude and you obtain:
a = [ 1, 2, 3, 4 ];
b = [ [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] ];
b__SSA0_1 = b;
iv = [ 1 ];
b__SSA0_1__SSA2_1 = _modarray_AxVxA_( b__SSA0_1, iv, a);
iv__SSA2_1 = [ 0 ];
_wldp_54 = sacprelude::sel( iv__SSA2_1, b);
b__SSA0_1__SSA2_2 = _modarray_AxVxA_( b__SSA0_1__SSA2_1, iv__SSA2_1, _wldp_54);
Now running cf ( sac2c error.sac -v4 -b11:cyc:cf:2 -noprelude) we get:
a = [ 1, 2, 3, 4 ];
b = [ [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] ];
b__SSA0_1 = b;
iv = [ 1 ];
b__SSA0_1__SSA2_1 = [ [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] ];
iv__SSA2_1 = [ 0 ];
_wldp_54 = sacprelude::sel( iv__SSA2_1, b);
b__SSA0_1__SSA2_2 = [ [ _wldp_54, 2, 3, 4 ], [ 1, 2, 3, 4 ] ];
^^^^^^^^^
OUCH!!!
which subsequently (correctly) leads to array-element incompatability errors
(see masterruns E-04.sac etcetcetc)</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1998sudoku demo does not run any more2017-11-19T21:47:43ZClemens Grelcksudoku demo does not run any more| | |
| --- | --- |
| Bugzilla Link | [435](http://bugs.sac-home.org/show_bug.cgi?id=435) |
| Created on | Jun 13, 2008 11:21 |
| Resolution | FIXED |
| Resolved on | Jul 12, 2008 20:41 |
| Version | 1.00alpha |
| OS | All |
| Architec...| | |
| --- | --- |
| Bugzilla Link | [435](http://bugs.sac-home.org/show_bug.cgi?id=435) |
| Created on | Jun 13, 2008 11:21 |
| Resolution | FIXED |
| Resolved on | Jul 12, 2008 20:41 |
| Version | 1.00alpha |
| OS | All |
| Architecture | PC |
## Extended Description
<pre>If compiled with the latest sac compiler (rev 15729),
the sudoku examples in demos/fun produce a runtime error:
grelck@pcclt05:~/sac/sac/demos/fun> sudoku < inputs/easy01.inp
*** SAC runtime error
*** line 152
*** Shape of argument #1 of "_sel_VxA_" should match dimensionality of
*** argument #2; types found: int[4] and bool[.,.,.]
Program was compiled with standard options:
sac2c -O3 -v1 -maxlur 3 -o sudoku_jfp sudoku_jfp.sac
I suspect something in the partial evaluator goes wrong.</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1996more non-flattened code produced by CF2017-11-19T21:47:31ZStephan Herhutmore non-flattened code produced by CF| | |
| --- | --- |
| Bugzilla Link | [410](http://bugs.sac-home.org/show_bug.cgi?id=410) |
| Created on | Feb 20, 2008 21:28 |
| Resolution | FIXED |
| Resolved on | Jul 13, 2008 15:18 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [410](http://bugs.sac-home.org/show_bug.cgi?id=410) |
| Created on | Feb 20, 2008 21:28 |
| Resolution | FIXED |
| Resolved on | Jul 13, 2008 15:18 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [mat.sac](/uploads/ba8468c06886ba5ba7dbefe81cfdfbe7/mat.sac) |
## Extended Description
<pre>Created an attachment (id=460)
testcase to replicate
When compiling sac/testsuite/optimizations/ls/mat.sac, constantfolding creates the following selection operations:
_ls_282 = _sel_VxA_( [ 1 ], _flat_6);
_ls_283 = _sel_VxA_( [ 0 ], _flat_6);
_ls_284 = _sel_VxA_( [ 1 ], _flat_3);
_ls_285 = _sel_VxA_( [ 0 ], _flat_3);
Again, the index-vectors need to be flattened out, as we only allow scalar constants or identifiers as arguments to primitive functions.</pre>Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1995Dead code walks again: StructOpSel2017-11-19T21:47:25ZStephan HerhutDead code walks again: StructOpSel| | |
| --- | --- |
| Bugzilla Link | [409](http://bugs.sac-home.org/show_bug.cgi?id=409) |
| Created on | Feb 18, 2008 19:23 |
| Resolution | FIXED |
| Resolved on | Jun 29, 2008 21:31 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [409](http://bugs.sac-home.org/show_bug.cgi?id=409) |
| Created on | Feb 18, 2008 19:23 |
| Resolution | FIXED |
| Resolved on | Jun 29, 2008 21:31 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [supersimple.sac](/uploads/e441193aa18ab04b617fabe1b93522c2/supersimple.sac) |
## Extended Description
Created an attachment (id=459)
code to produce the error
The attached code breaks the compiler as of rev 15667 / 1063 (compiler/stdlib).Robert BerneckyRobert Berneckyhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1588modarray-sel elimination not generally correct2017-11-19T21:05:40ZClemens Grelckmodarray-sel elimination not generally correct| | |
| --- | --- |
| Bugzilla Link | [356](http://bugs.sac-home.org/show_bug.cgi?id=356) |
| Created on | May 01, 2007 09:22 |
| Resolution | FIXED |
| Resolved on | Nov 19, 2009 00:21 |
| Version | 1.00alpha |
| OS | All |
| Architec...| | |
| --- | --- |
| Bugzilla Link | [356](http://bugs.sac-home.org/show_bug.cgi?id=356) |
| Created on | May 01, 2007 09:22 |
| Resolution | FIXED |
| Resolved on | Nov 19, 2009 00:21 |
| Version | 1.00alpha |
| OS | All |
| Architecture | All |
| Attachments | [killer.sac](/uploads/b4b87ffa41b7b7af861354deb6995a91/killer.sac), [format.sac](/uploads/9da62d60874c9e0a4116e7ac4ba16fcd/format.sac) |
## Extended Description
<pre>The transformation
a = modarray( b, iv, val);
x = sel( iv, a);
=>
x = val;
is incorrect if val is not of correct element shape to be inserted
into b. In the original version the code eventually generated for
modarray will check consistency, whereas the optimised code obviously
does not do so.
To make this transformation correct we need to insert an appropriate
type assert.</pre>Robert BerneckyRobert Bernecky