[PATCH] Fix CoerceIntOrPtrToIntOrPtr on big-endian targets

John McCall rjmccall at apple.com
Tue Jun 4 10:32:11 PDT 2013


On May 28, 2013, at 9:04 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> Please review this patch which fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian targets.
> 
> If I understand coercion correctly, it is supposed to be equivalent to storing one type and loading a different type from the same address. The CoerceIntOrPtrToIntOrPtr() performs type coercion of integers and pointers without the loads and stores. On big-endian targets, it needs to insert shifts when coercing types of different sizes.
> 
> This also gets us the correct argument passing behavior on SPARC v9 which passes small structs in the high bits of registers.

Approved.

John.



More information about the cfe-commits mailing list