On Mon, Feb 01, 2016 at 08:46:42AM +1030, Alan Modra wrote: > The comment says this test is supposed to prevent "a narrower > operation than requested", but it actually only allows a larger > subreg, not one the same size. Fix that. > > Bootstrapped and regression tested powerpc64-linux. OK for stage1? > > Note that this bug was found when investigating why gcc-6 does not > suffer from pr69548, ie. this bug was masking a powerpc backend bug.
It sounds like you have a testcase, can we see it please? And, just a missed optimisation, not a bug, right? Segher > * combine.c (simplify_set): Correct WORD_REGISTER_OPERATIONS test. > > diff --git a/gcc/combine.c b/gcc/combine.c > index 858552d..9f284a7 100644 > --- a/gcc/combine.c > +++ b/gcc/combine.c > @@ -6736,7 +6736,7 @@ simplify_set (rtx x) > + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) > && (WORD_REGISTER_OPERATIONS > || (GET_MODE_SIZE (GET_MODE (src)) > - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))))) > + <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))))) > #ifdef CANNOT_CHANGE_MODE_CLASS > && ! (REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER > && REG_CANNOT_CHANGE_MODE_P (REGNO (dest),