W5100fix: Workaround for compiler bug + small size optimization #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I had a little problems with Ethernet libs example programs. I managed to find out that those were actually caused by avr-gcc 4.5.1 compiler bug. I slightly "rephrased" the code in w5100.h to work around that problem. As a side effect, the 16-bit register reading function gets compiled to 10 bytes smaller code.
Forum thread with my analysis (incl. disassembly): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1290209328
With this patch Ethernet's TCP and UDP examples are working nicely with Arduino UNO, Ehtershield SD and avr-gcc 4.5.1. IDE version 0021 running on 64bit Linux.
Yes, the workaround as such is quite pointless, but maybe you're interested in slight code size optimization.