|
|
Bugzilla Link |
606 |
Created on |
Nov 23, 2009 17:07 |
Resolution |
FIXED |
Resolved on |
Nov 25, 2009 18:15 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Attachments |
crud.sac |
Extended Description
Created an attachment (id=612)
Source code to reproduce fault
This is some problem in my code, almost for sure, but it's doing some
oddball things, and I'm at a loss as to how to localize the fault.
sac2c -V
sac2c v1.00-beta (Buchette d'Anjou)
product rev 16620:MODIFIED linux-gnu_x86_64
(Mon Nov 23 11:21:58 EST 2009 by sac)
sac@rattler:~/sac/testsuite/optimizations/awlf$ sac2c crud.sac -b11:saacyc:awlfi:1 -extrema -nowlf -doawlf >crud
-----------------------------------------------------
If I stop in ddd AWLFIfundef return() for main(), I have this code inserted,
which looks good to me:
int[1] _awlfi_694 { } ;
bool[1] _awlfi_693 { } ;
int _awlfi_692 { dim: 0, shape: [:int] } ;
int[1] _awlfi_691 { } ;
_awlfi_691 = _sub_VxV_( _pinl_285_max_lower, _pinl_193__wlbsc_140_sc_bound);
_awlfi_692 = 0;
_awlfi_693 = _gt_VxS_( _awlfi_691, _awlfi_692);
_awlfi_694 = _mesh_VxVxV_( _awlfi_693, _pinl_285_max_lower,
_pinl_193__wlbsc_140_sc_bound);
But if I break at -b11:saacyc:awlfi:1, I get this, instead:
_awlfi_691 = _sub_VxV_( _pinl_285_max_lower, _pinl_193__wlbsc_140_sc_bound);
_awlfi_692 = 0;
_awlfi_693 = _gt_VxS_( _awlfi_691, _pinl_179__flat_3);
_awlfi_694 = [ 0 ];
Note that the mesh is gone, and that it has been replaced by
the (incorrect) [ 0 ];
The mesh is like the stdlib where() function
in semantics: PRF_ARG1 is a Boolean vector that selects
an element from PRF_ARG2 if the corresponding element is true, else the
element from PRF_ARG3.
So, how is it that the code is OK at fundef time, but has been trashed
by the time we get around to printing it at end-of-traversal?
Another oddity: If I break before or after -b11:saacyc:AWLFI:1,
main() prints OK. But, if I "call PRTdoPrintNode(arg_node) from
within CFfundef, the print() code dies because it finds CODE_USED == -2
in some WL. Today, I can't make it do that, but we're several revisions newer.