Il 21/04/2013 14:23, Borislav Petkov ha scritto: > On Sun, Apr 21, 2013 at 01:46:50PM +0200, Borislav Petkov wrote: >> We probably need something with copying values to a temp variable or so. > > Basically something like that: > > case 2: > /* > * From MOVBE definition: "...When the operand size is 16 bits, > * the upper word of the destination register remains unchanged > * ..." > * > * Both casting ->valptr and ->val to u16 breaks strict aliasing > * rules so we have to do the operation almost per hand. > */ > tmp = (u16)ctxt->src.val; > ctxt->dst.val &= ~0xffffUL; > ctxt->dst.val |= (unsigned long)swab16(tmp); > break; > > This passes all gcc checks, even the stricter ones when building with W=3. I thought the valptr one was ok. I find this one more readable, too. How does the generated code look like? Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html