
Dear Anatolij Gustschin,
In message 20111223170640.18cfe56f@wker you wrote:
The code and comment disagreed: the comment claimed that r6...r31 were copied, and consequently the arrays for "src" and "dst" were declared with 26 entries, but the actual code ("lmw r5,0(r3)" and "stmw r5,0(r4)") copied _27_ words (r5 through r31), which resulted in false "POST cpu Error at multi test" messages.
Great! Thanks for fixing this bug!
Thanks for testing and reporting it!
But I wonder why didn't we see it with U-Boot built using older GCC versions.
Yes, I was surprised,too, and suspected a compiler problem instead...
Since only 26 words will be compared after the test, the issue only shows up if the destination buffer is placed at lower addresses on the stack than the source buffer. In this case the first word in the source buffer is overwritten. GCC 4.6.1 generated code which changed the order of src[] and dst[] on the stack and the hidden bug showed up.
This matches my own analysis. Actually the code generated by gcc 4.5.1 and 4.6.1 looks _really_ different in a lot of places; it seems a lot has been changed in GCC again.
Best regards,
Wolfgang Denk