On 11/16/18 1:49 AM, Jakub Jelinek wrote: > Hi! > > On Wed, Nov 14, 2018 at 09:35:30AM -0700, Jeff Law wrote: >> + * optabs.c (expand_binop): Pass INT_MODE to operand_subword_force >> + iff the operand is a constant. > > This broke gcc.target/i386/pr80173.c testcase. The problem is > that while operand_subword handles VOIDmode last argument just fine > by using GET_MODE (op), so it is only important to use non-VOIDmode if > op has VOIDmode. But, operand_subword_force actually has a different > behavior, if mode is VOIDmode (or BLKmode), it acts just as operand_subword > followed by assertion that it succeeded, rather than by trying to deal with > failed operand_subword by forcing it into a pseudo. > > In the testcase, op is a hard register, on which operand_subword fails, but > if it is forced into pseudo, it succeeds. > > The following patch arranges it by never passing VOIDmode to > operand_subword_force, pass int_mode as previously if opN has VOIDmode, but > instead of passing VOIDmode otherwise pass the actual mode of the opN > operand. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2018-11-16 Jakub Jelinek <ja...@redhat.com> > > PR middle-end/88032 > * optabs.c (expand_binop): For op0_mode use GET_MODE (op0), unless it > is VOIDmode, in which case use int_mode. Similarly for op1_mode. Yea, that's fine too -- I had this variant in my tree until the last cycle of testing where I changed it to VOIDmode :-) Sorry for the breakage.
jeff