c: Avoid breaking strict-aliasing

Also enable -O2 in compile test to detect such problems.