[Scummvm-devel] Wii & Gamecube (resp. PowerPC) vs. unaligned memory access

Andre Heider a.heider at gmail.com
Fri May 6 18:08:19 CEST 2011


Hi,

the more I try to remember and read about this, the more confused I get ;)

While the broadway "requires alignment on certain instructions", I'm
not so sure anymore if that applies to our READ/WRITE stuff in
endian.h. I think that's where this whole thread comes from, right?

I vaguely remember that it may also have been an aliasing issue, where
the need_memalign=no path resulted in optimized code from the compiler
that was not what we expected in certain situations.

So the cause of the issue I ran into somewhere in the distant past may
not be related to unaligned access, but it made me set need_memalign.

Confusing? Yes. But reading "return *(const uint32 *)(ptr);" makes me
wonder if need_memalign has a confusing name in the first place. If I
read GCC's manpage about -fstrict-aliasing right, that may also be
undefined behaviour.

Regards,
Andre




More information about the Scummvm-devel mailing list