https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92140

--- Comment #18 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #15)
> Is it possible to lift the limitation from the combine pass, where the
> combine tries to split the insn, but expects exactly two new insn patterns
> to be generated. From the docs:
> 
> --q--
>  When the combiner phase tries to split an insn pattern, it is always
> the case that the pattern is _not_ matched by any 'define_insn'.  The
> combiner pass first tries to split a single 'set' expression and then
> the same 'set' expression inside a 'parallel', but followed by a
> 'clobber' of a pseudo-reg to use as a scratch register.  In these cases,
> the combiner expects exactly two new insn patterns to be generated.  It
> will verify that these patterns match some 'define_insn' definitions, so
> you need not do this test in the 'define_split' (of course, there is no
> point in writing a 'define_split' that will never produce insns that
> match).
> --/q--
> 
> Many define_and_split insns in i386.md that use can_create_pseudo_p have
> this unwanted condition in their insn condition just because of the
> mentioned limitation.

What unwanted condition?  What limitation?

From combine.c:

  /* If we were combining three insns and the result is a simple SET
     with no ASM_OPERANDS that wasn't recognized, try to split it into two
     insns.  There are two ways to do this.  It can be split using a
     machine-specific method (like when you have an addition of a large
     constant) or by combine in the function find_split_point.  */

      /* See if the MD file can split NEWPAT.  If it can't, see if letting it
         use I2DEST as a scratch register will help.  In the latter case,
         convert I2DEST to the mode of the source of NEWPAT if we can.  */

          /* ??? Reusing i2dest without resetting the reg_stat entry for it
             (temporarily, until we are committed to this instruction
             combination) does not work: for example, any call to nonzero_bits
             on the register (from a splitter in the MD file, for example)
             will get the old information, which is invalid.

             Since nowadays we can create registers during combine just fine,
             we should just create a new one here, not reuse i2dest.  */

Exactly two new insns...  Exactly one is also okay.  I'll fix the docs.

Reply via email to