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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sayle at gcc dot gnu.org
           Keywords|                            |needs-bisection
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2025-06-08
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly the TImode argpassing changes.  It's interesting that using 'long' for
'i' generates good code.

On GIMPLE we fail to eliminate the extra copy:

struct X f (struct X x)
{
  struct X D.2964;

;;   basic block 2, loop depth 0
;;    pred:       ENTRY
  D.2964 = x;
  return D.2964;
;;    succ:       EXIT

}

and we require RTL to "fixup" this copy, but we're likely confused about
how we build 'x':

(insn 2 8 3 2 (set (reg:SI 103 [ x ])
        (reg:SI 5 di [ x ])) "t.c":6:25 100 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 5 di [ x ])
        (nil)))
(insn 3 2 4 2 (set (reg:DI 104 [ x+8 ])
        (reg:DI 4 si [ x+8 ])) "t.c":6:25 99 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 4 si [ x+8 ])
        (nil)))
(insn 4 3 5 2 (set (reg:TI 102 [ x ])
        (subreg:TI (reg:SI 103 [ x ]) 0)) "t.c":6:25 98 {*movti_internal}
     (expr_list:REG_DEAD (reg:SI 103 [ x ])
        (nil)))
(insn 5 4 7 2 (set (reg:TI 102 [ x ])
        (ior:TI (and:TI (reg:TI 102 [ x ])
                (const_wide_int 0x0ffffffffffffffff))
            (ashift:TI (zero_extend:TI (reg:DI 104 [ x+8 ]))
                (const_int 64 [0x40])))) "t.c":6:25 148 {*insvti_highpart_1}
     (expr_list:REG_DEAD (reg:DI 104 [ x+8 ])
        (nil)))

and then extract its components for the return:

(insn 21 7 22 2 (set (reg:DI 106 [ D.2964 ])
        (subreg:DI (reg:TI 102 [ x ]) 0)) "t.c":7:12 99 {*movdi_internal}
     (nil))
(insn 22 21 11 2 (set (reg:DI 107 [ D.2964+8 ])
        (subreg:DI (reg:TI 102 [ x ]) 8)) "t.c":7:12 99 {*movdi_internal}
     (expr_list:REG_DEAD (reg:TI 102 [ x ])
        (nil)))
(insn 11 22 16 2 (set (reg:SI 99 [ <retval> ])
        (subreg:SI (reg:DI 106 [ D.2964 ]) 0)) "t.c":7:12 discrim 1 100
{*movsi_internal}
     (expr_list:REG_DEAD (reg:DI 106 [ D.2964 ])
        (nil)))
(insn 16 11 17 2 (set (reg:SI 0 ax)
        (reg:SI 99 [ <retval> ])) "t.c":8:1 100 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 99 [ <retval> ])
        (nil)))
(insn 17 16 18 2 (set (reg:DI 1 dx)
        (reg:DI 107 [ D.2964+8 ])) "t.c":8:1 99 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 107 [ D.2964+8 ])
        (nil)))

Reply via email to