I have great source code that runs on PowerPC. I need to transfer it to ARM. But ARM throws an h / w exception for unaligned memory access. So, I want to find all possible instances in which an exception may occur without memory access. I considered the following options.
- Use -Wcast-align in gcc, which would give warnings for uneven access.
- Make PowerPC throw an unmanaged exception. For ARM, there is the / proc / cpu / alignment option, with which the user can decide how to handle the exception. But for PowerPC there is no such option.
My questions:
- Is there a way to get PowerPC to throw an exception without memory access?
- Is there a better way to find out all occurrences of irrational memory access in the source code?
source share