|
|
Bugzilla Link |
565 |
Created on |
Sep 29, 2009 00:18 |
Resolution |
FIXED |
Resolved on |
Nov 06, 2009 23:27 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Attachments |
prdreverse2.sac |
Extended Description
Created an attachment (id=573)
Source code to reproduce fault
If compiled with:
sac2c -extrema -doswlf -nowlf prdreverse2.sac -b11
we get this fold WL generated:
_pinl_205_res = with {
(_flatg_695 <= _pinl_203_iv=[_pinl_206__eat_15] < _flatg_696)
{
_dup_715__pinl_207__ea_94_res = _accu_( _pinl_203_iv);
_ivexp_1010__dup_850__ivexp_840__dup_730__pinl_178__flat_10 = _sub_SxS_( 49, _pinl_206__eat_15);
_ivexp_1097__dup_1067__ivexp_843__dup_745__pinl_148__flat_10 = _sub_SxS_( 49, _ivexp_1010__dup_850__ivexp_840__dup_730__pinl_178__flat_10);
_dup_717__pinl_213___flat_69 = _add_SxS_( _dup_715__pinl_207__ea_94_res, _ivexp_1097__dup_1067__ivexp_843__dup_745__pinl_148__flat_10);
} : _dup_717__pinl_213___flat_69 ;
} :
fold( ScalarArith::+, _pinl_118__flat_3);
The two substract operations should be simplified by AS, but are not.
The problem arises from _attachextrema_ code inserted by -extrema:
_pinl_205_res = with {
(_flatg_695 <= _pinl_203_iv=[_pinl_206__eat_15] < _flatg_696 genwidth [ 50 ])
{
_ivexi_705 = _attachextrema_( _pinl_203_iv, _flatg_695, _ivexp_954);
_dup_715__pinl_207__ea_94_res = _accu_( _ivexi_705);
_dup_847__ivexi_729__pinl_177_i = _attachextrema_( _pinl_206__eat_15, _pinl_118__flat_3, _ivexi_743___flatg_698);
_ivexp_1010__dup_850__ivexp_840__dup_730__pinl_178__flat_10 = _sub_SxS_( 49, _dup_847__ivexi_729__pinl_177_i);
_dup_850__ivexp_840__dup_730__pinl_178__flat_10 = _attachextrema_( _ivexp_1010__dup_850__ivexp_840__dup_730__pinl_178__flat_10, _pinl_118__flat_3, _ivexi_743___flatg_698);
_dup_851___pinl_178__flat_10 = _attachextrema_( _dup_850__ivexp_840__dup_730__pinl_178__flat_10, _pinl_118__flat_3, _ivexi_743___flatg_698);
_ivexp_1007 = _attachextreman_( _dup_851___pinl_178__flat_10, _flatg_695, _ivexp_954);
_dup_1066__ivexi_744__pinl_147_i = _attachextrema_( _ivexp_1007, _pinl_118__flat_3, _ivexi_743___flatg_698);
_ivexp_1097__dup_1067__ivexp_843__dup_745__pinl_148__flat_10 = _sub_SxS_( 49, _dup_1066__ivexi_744__pinl_147_i);
_dup_1067__ivexp_843__dup_745__pinl_148__flat_10 = _attachextrema_( _ivexp_1097__dup_1067__ivexp_843__dup_745__pinl_148__flat_10, _pinl_118__flat_3, _ivexi_743___flatg_698);
_dup_1068___pinl_148__flat_10 = _attachextrema_( _dup_1067__ivexp_843__dup_745__pinl_148__flat_10, _pinl_118__flat_3, _ivexi_743___flatg_698);
_dup_1069__ivexp_955 = _attachextreman_( _dup_1068___pinl_148__flat_10, _flatg_695, _ivexp_954);
_dup_717__pinl_213___flat_69 = _add_SxS_( _dup_715__pinl_207__ea_94_res, _dup_1069__ivexp_955);
} : _dup_717__pinl_213___flat_69 ;
} :
fold( ScalarArith::+, _pinl_118__flat_3);
I'll have a go at fixing this in the morning.