[avr-gcc-list] Optimization Hiccup? (Please CC me, I'm not subscribed)

2014-10-18 Thread Thomas Watson
GCC is generating substantially less optimized code than it does if I help it along a bit. Code is at http://pastie.org/private/awus9tkgdwbzpdwjgrbw and the assembler output is at http://pastie.org/private/s4liesmrd9f6fi2wahe0vg . Top block is with cx and bottom block is modifying the argument i

[avr-gcc-list] 16 Bit Store Optimizations

2016-12-19 Thread Thomas Watson
Hello all, A frequent need in my code is to combine two 8 bit variables into a 16 bit variable. I am trying to determine the optimal way to do this. The naïve way and a more clever way both generate extra instructions that could be optimized away. I include a test case and comments which explai