[quote user="Roger44834"]Running with -O3 has the effect, that sometimes myStruct gets other values.[/quote]
Sometimes myStruct gets other values? Anything is possible, but inconsistent behavior like that does not usually indicate a compiler problem. It is more likely that something else is going wrong, and this is the only symptom you currently see. Perhaps the stack is overflowing? Or some interrupt fails to preserve all of its state?
Thanks and regards,
-George