This should be a very common "problem" with GCC. I want to assign a 32-bit variable a value constructed from four 8-bit variables.
This could be done as
var32 = var8_1 + var8_2*256 + var8_3*256*256 + var8_4*256*256*256
but this seems to generate a large amount of (redundant) code. I simply want to assign each byte of var32 the value of var8_1, var8_2, etc. Can I do this in a better (more efficient) way?
Edit: actually there's not a lot of redundant code, only a little...