On 3 November 2016 at 17:01, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > I managed to forget to mask the thing inserted. Tested on powerpc64-linux > {-m32,-m64}, and Bin tested on arm. Applying to trunk. > > > Segher > > > 2016-11-03 Segher Boessenkool <seg...@kernel.crashing.org> > > PR rtl-optimization/78186 > * combine.c (change_zero_ext): Mask the RHS of a zero_extract as > well, when converting to IOR. >
Hi, Since this commit I have noticed execution failures on "old" arm targets: gcc.dg/torture/pr48124-4.c -O1 execution test gcc.dg/torture/pr48124-4.c -O2 execution test gcc.dg/torture/pr48124-4.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test gcc.dg/torture/pr48124-4.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test gcc.dg/torture/pr48124-4.c -O3 -g execution test gcc.dg/torture/pr48124-4.c -Os execution test For instance on target arm-none-linux-gnueabi --with-cpu=cortex-a9 --with-mode=arm and running the tests with -march=armv5t or on arm-none-eabi with default mode/cpu and no special runtest flags if that's easier. Christophe > --- > gcc/combine.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gcc/combine.c b/gcc/combine.c > index 7c21fe4..7ed0a62 100644 > --- a/gcc/combine.c > +++ b/gcc/combine.c > @@ -11224,6 +11224,9 @@ change_zero_ext (rtx pat) > rtx x = gen_rtx_AND (mode, reg, immed_wide_int_const (mask, mode)); > rtx y = simplify_gen_binary (ASHIFT, mode, SET_SRC (pat), > GEN_INT (offset)); > + wide_int mask2 = wi::shifted_mask (offset, width, false, reg_width); > + y = simplify_gen_binary (AND, mode, y, > + immed_wide_int_const (mask2, mode)); > rtx z = simplify_gen_binary (IOR, mode, x, y); > SUBST (SET_DEST (pat), reg); > SUBST (SET_SRC (pat), z); > -- > 1.9.3 >