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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
The problem is with can_assign_to_reg_without_clobbers_p in gcse.c, where we
have:

  /* If the test insn is valid and doesn't need clobbers, and the target also
     has no objections, we're good.  */
  if (icode >= 0
      && (num_clobbers == 0 || !added_clobbers_hard_reg_p (icode))
      && ! (targetm.cannot_copy_insn_p
            && targetm.cannot_copy_insn_p (test_insn)))
    can_assign = true;

The test instruction is created as:

(insn 26 0 0 (set (reg:SI 152)
        (fix:SI (reg:DF 89))) -1
     (nil))

which is (correctly) recognized as

(define_insn "fix_trunc<mode>_i387_fisttp"
  [(set (match_operand:SWI248x 0 "nonimmediate_operand" "=m")
        (fix:SWI248x (match_operand 1 "register_operand" "f")))
   (clobber (match_scratch:XF 2 "=&f"))]

However, recog also reports that 1 clobber needs to be added. The instruction
is recognized nevertheless due to "|| !added_clobbers_hard_reg_p (icode)"
bypass. The recognized insn doesn't clobber hard reg, but it also needs a
clobber of a scratch reg to be recognized.

Reply via email to