rle.sac failure: LACSO vs. DCR causes crash in WLIR
|
|
Bugzilla Link |
1034 |
Created on |
Nov 08, 2012 23:05 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
crud.breaks.sac |
Extended Description
cd sac/apex/rle
sac@rattler:~/sac/apex/rle$ sac2c rle.sac -v1
stdopt/withloop_invariant_removal.c:861 Assertion "AVIS_DEFDEPTH(ID_AVIS(arg_node)) != DD_UNDEFINED" failed!
reference to undefined identifier _lacso_17413
sac@rattler:~/sac/apex/rle$ sac2c rle.sac -v1 -nolacso
sac2c -V
sac@rattler:~/sac/apex/rle$ sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18019 linux-gnu_x86_64
(Thu Nov 8 17:08:16 EST 2012 by sac)
I believe what is going on is this:
1. LACSO introduces a new scalar result value, which
is never used in the calling context, but it IS used
as an AVIS_SHAPE element in the called context.
2. DCR comes along, sees that the result value is unused in
the caller, so deletes the N_funcond after the recursive
call, which then marks the recursive call result dead.
3. Things eventually die in WLIR.
I think the correct fix is to make DCR check for
uses of the result value in AVIS son nodes, and mark
the avis as live if that is the case. I don't like this
approach, but have no better ideas yet.