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

Andreas Krebbel <krebbel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #5 from Andreas Krebbel <krebbel at gcc dot gnu.org> ---
I think the problem comes with the hard coded operand indexes in
curr_insn_transform when trying to reuse the existing insn for the secondary
memory load.

  if (use_sec_mem_p)
    {
      rtx new_reg, src, dest, rld;
      machine_mode sec_mode, rld_mode;

      lra_assert (sec_mem_p);
      lra_assert (curr_static_id->operand[0].type == OP_OUT
                  && curr_static_id->operand[1].type == OP_IN);
      dest = *curr_id->operand_loc[0];
      src = *curr_id->operand_loc[1];
...

This does not work for parallels consisting of more than one set. 
(insn 15 14 24 2 (parallel [
            (set (reg:CCZ 33 %cc)
                (compare:CCZ (subreg:SI (reg:SF 69 [ D.1498 ]) 0)
                    (const_int 0 [0])))
            (set (reg:SI 60 [ D.1497 ])
                (subreg:SI (reg:SF 69 [ D.1498 ]) 0))
        ]) t.c:13 839 {*tstsi_extimm}
     (expr_list:REG_DEAD (reg:SF 69 [ D.1498 ])
        (expr_list:REG_UNUSED (reg:CCZ 33 %cc)
            (nil))))

The first set is dead so single_set returns just the second set for
curr_insn_set. Since the operands in the second set are NOT numbered 0 and 1
this code doesn't do the right thing.

Can we just use the "old" code in such a case? So emitting both the spill insns
before and after the original insn instead of trying to reuse the insn? In the
original PR55433 this was supposed to fix an infinite loop in reload. So I'm
not sure if that might bring back that problem then?!

Reply via email to