em3702 wrote:
:
compiling with -Wall doesn't change our output anything:
Ok, I can confirm the bug. After checking the code, I saw that there
where multiply instructions emitted. I remember, that I stumble from
time to time into problems when this feature is enabled. Using
'-mdisable-hwmul' always solved mysterious compiler problems for me.
In your case it is the same. Even adding code lines like
g_mgmt[a].data[MY_BUFFER_SIZE-0] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+1] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+2] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+3] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+4] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+5] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+6] = a_pData->txs;
g_mgmt[a].data[MY_BUFFER_SIZE+7] = a_pData->txs;
and so on until the branch generation switches to
jeq +4
br #.L4
did not produce the bug. With hwmul the problem was generated even when
commenting out some lines of code. That means the problem was not
limited to an off by one situation or so.
I guess this is a problem in code length calculation of the hw multiply
instructions.
Perhaps there is anybody out there who wants to get into deeper detail?
To my experience this could close a long lasting bug in the compiler!
Hardy