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

--- Comment #3 from Sinan <sinan.lin at linux dot alibaba.com> ---
Hi Andrew,

Thank you for taking the time to explain the issue. I appreciate it.

I think the issue between init/init2 and init3 might be different. Regarding
init3, any 32-bit backend attempting to split a complex constant will encounter
such a suboptimal case.

I tried with mip in gcc 12, and here are the ouputs for `init` and `init3`

init:
        lui     $2,%hi(Data)
        move    $5,$0
        move    $4,$0
        sw      $5,%lo(Data+4)($2)
        jr      $31
        sw      $4,%lo(Data)($2)

init3:
        lui     $2,%hi(Data)
        li      $5,15                 # 0xf
        li      $4,15                 # 0xf
        sw      $5,%lo(Data+4)($2)
        jr      $31
        sw      $4,%lo(Data)($2)

register $4 or $5 could be eliminated.

Reply via email to