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

--- Comment #9 from Vineet Gupta <vineet.gupta at linux dot dev> ---
The redundant Insn 2660 is reload inserted for Insn 1717

 1717: r1871:DI=frame:DI+r2813:DI
    Inserting insn reload before:
 2660: r2814:DI=0x1000
 2661: r2813:DI=r2814:DI-0x7e8
      REG_EQUAL 0x818


Insn 1717 in turn is reload inserted for Insn 82

   82: r1870:DI=r1871:DI+r222:DI
      REG_DEAD r222:DI
    Inserting insn reload before:
 1717: r1871:DI=frame:DI+0x28
    Inserting insn reload after:
 1716: r223:DI=r1870:DI


Insn 82 comes from 253r.expand

(insn 80 79 81 5 (set (reg:DI 222 [ _282 ])
        (ashift:DI (reg:DI 74 [ g.1_3 ])
            (const_int 7 [0x7]))) "rhs-cred.cc":44:29 -1
     (nil))
(insn 81 80 82 5 (set (reg:DI 884)
        (plus:DI (reg/f:DI 67 virtual-stack-vars)
            (const_int -8 [0xfffffffffffffff8]))) "rhs-cred.cc":44:29 -1
     (nil))
(insn 82 81 83 5 (set (reg/f:DI 223 [ _283 ])
        (plus:DI (reg:DI 884)
            (reg:DI 222 [ _282 ]))) "rhs-cred.cc":44:29 -1
     (nil))


Stepping thru lra-constraints.cc, curr_insn_transform () is called twice for
Insn 1717 and in the 2nd call (lra_constraints_iter == 4), operand is required
to have a reload (goal_alt_win[2]==false) which leads to lra_emit_move () ->
riscv_move_integer ()

Reply via email to