Forum Discussion
Altera_Forum
Honored Contributor
11 years agoNIOS II Structure Casting w/ Opt. (-O3)
I recently enabled optimization on my NIOS II software (custom telnet server + webserver) and I'm experiencing unexpected behavior. I suspect memory corruption and alignment issues, but I can't seem ...
Altera_Forum
Honored Contributor
11 years agoLook at the assembler code generated for your code.
I had a case on an x86 where bit-field access resulted in byte-based assembly instructions, even though the bit-field is described using integers. In your case, since each bit-field is actually a byte, it might be less ambiguous (in the sense of undefined compiler operation) to use an array of bytes. You can use a union to make the array accessible as either a single integer or four single byte fields. Cheers, Dave