search for: dosomethingwithints

Displaying 2 results from an estimated 2 matches for "dosomethingwithints".

2016 Dec 16
0
Alignment of the StoreInst
...ly become a problem. On almost all targets I'm aware of 32-bit integers should be aligned to 32-bits. There's a bit more variation for 64-bit ints. Programs that work on buffers of bytes often cast pointers into those buffers inappropriately. E.g. char *Buf = ...; [...] return doSomethingWithInts((int32_t *)&Buf[Idx]); For example I'd be very suspicious of ALACEncoder.cpp lines 340 and 352. I expect there's more, those are just the first two I found by grepping for "(int32_t *)". Everything seems to work fine until the compiler becomes clever enough to realise it can...
2016 Dec 16
2
Alignment of the StoreInst
Hi Tim, Thanks for the explanation. The above code snippets is actually extracted by bugpoint from MultiSource/Applications/ALAC/encode/alacconvert-encode.test. I get a different result if I cast the pointer to int and mask away the lower two bits and cast the int back to pointer. While casting pointer to int and back to pointer do not cause any problem. Thanks Hongbin On Fri, Dec 16, 2016 at