Hi, On Fri, Nov 24, 2017 at 10:38:13PM +0100, Jakub Jelinek wrote: > The following testcase ICEs in wide-int*, but the reason is a mode mismatch > (we build a SImode MULT with one QImode argument and one VOIDmode argument, > then it is folded into SImode NEG with QImode argument, ...). > The bug is in assuming that the mode of c1 must be m, that is usually the > case, but shifts are special, the second argument can have a different mode. > > The following patch makes sure we perform the computation of the new shift > count in the right mode.
Okay, thanks! Is this better than bailing out though, do you have an example? Segher > 2017-11-24 Jakub Jelinek <ja...@redhat.com> > > PR rtl-optimization/81553 > * combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z) > to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP > is a shift where C1 has different mode than the whole shift, use C1's > mode for MULT rather than the shift's mode. > > * gcc.c-torture/compile/pr81553.c: New test.