On Wed, Jun 4, 2014 at 1:15 PM, Thomas Preud'homme <thomas.preudho...@arm.com> wrote: >> From: Richard Biener [mailto:richard.guent...@gmail.com] >> >> Err, but if you zero-extend directly to the target type you have the >> correct result, too. > > Yep but in some case we need sign extend (32 bit bitwise OR stored > into 64 bit result).
But you'd convert the 32bit bitwise OR to the original type anyway (no extension, but sign-change). The extension to the stored type happens with the original IL. > As I said, the logic could be simplified by sign > extending if load_size == bitwise expression size and zero extending > if not true. I'll rework the patch in this direction. > >> >> But nothing for the testsuite? The testcase you add fails foul of >> sign-extending the loads. > > Ack, I'll add a test for zero extension and one for sign extension. Thanks. Richard. > Cheers, > > Thomas > > >