CF needs CSE to run first if -ecc enabled
|
|
Bugzilla Link |
425 |
Created on |
May 10, 2008 20:27 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Attachments |
SCCFprf_modarray5.sac |
Extended Description
Created an attachment (id=469)
Source code to reproduce above fault
This is part of the result of compiling sac/testsuite/optimizations
/constantfolding/SCCFprf_modarray5.sac with:
sac2c -b11 -ecc SCCFprf_modarray5.sac:
x = [ [ two, three ], [ four, five ] ];
_ivesplit_1149 = _vect2offset_( [ 2, 2 ], iv);
_icc_36 = _idx_modarray_AxSxS_( x, _ivesplit_1149, 42);
_ivesplit_1150 = _vect2offset_( [ 2, 2 ], iv);
_icc_40 = _idx_sel_( _ivesplit_1150, _icc_36);
Note the two vect2offsets are identical, but CSE has not
picked up on this. That makes CF unable to optimize the sel() into
_icc_40 = 42;
If I compile without -ecc, the optimization works properly.
I am reluctant to change compiler phase ordering or to introduce
new CSE calls without some other eyeballs on the case.