On Fri, Feb 08, 2013 at 09:06:52AM -0800, H. Peter Anvin wrote: > On 02/08/2013 07:28 AM, Russell King - ARM Linux wrote: > > > > Whether that's safe for x86 or not, I don't know, but my suspicions are > > that it's unsafe on x86 as it's possible to refer to the various bytes/ > > half-words of eax separately. > > > > So, I came to the conclusion that if x86 remains a problem, there's > > little point supporting it on ARM. > > > > It is possible to access bytes separately, but gcc generally doesn't. > However, whether or not that can be relied upon safely is a tricky question. > > It *is* also worth nothing that the x86 ABI does allow two words to be > returned in registers from a normal C function, simply by returning a > structure. That doesn't solve the problem at hand, though, which is how > to make a type-neutral macro which can handle doublewords... I just tried to compare a couple of options: 1) unsigned long __val_gu; unsigned long long __val_gu8; 2) register typeof(x) __val_gu asm("eax"); I was still using a test app based on my orignal patch which used eax and edx for the value. 3) typeof(x) __val_gu; While options 2 and 3 get rid of the warnings, they unfortunately produce different results as well. I've attached my test app in case you want to see it. One other note is that if I include the memtest() call in the test, option 1 and 2 produce the same results, but w/o the memtest() the results differ. I didn't look into it any further. -- Ville Syrjälä Intel OTC