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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-03-12
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, we have:
(insn 14 3 6 2 (set (reg/v:DI 83 [ i ])
        (mem/c:DI (reg/f:SI 16 argp) [1 i+0 S8 A32])) "pr89676.c":4:12 66
{*movdi_internal}
     (expr_list:REG_EQUIV (mem/c:DI (reg/f:SI 16 argp) [1 i+0 S8 A32])
        (nil)))
(insn 6 14 11 2 (parallel [
            (set (reg:DI 84)
                (ashift:DI (reg/v:DI 83 [ i ])
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) "pr89676.c":4:12 509 {*ashldi3_doubleword}
     (expr_list:REG_DEAD (reg/v:DI 83 [ i ])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))
(insn 11 6 12 2 (set (reg/i:DI 0 ax)
        (reg:DI 84)) "pr89676.c":5:1 66 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 84)
        (nil)))
and the important insn has:
(define_insn "*ashl<mode>3_doubleword"
  [(set (match_operand:DWI 0 "register_operand" "=&r")
        (ashift:DWI (match_operand:DWI 1 "reg_or_pm1_operand" "0n")
                    (match_operand:QI 2 "nonmemory_operand" "<S>c")))
   (clobber (reg:CC FLAGS_REG))]
constraints, IRA decides:
Pass 0 for finding pseudo/allocno costs

    a0 (r84,l0) best AD_REGS, allocno AD_REGS
    a1 (r83,l0) best GENERAL_REGS, allocno GENERAL_REGS

  a0(r84,l0) costs: AD_REGS:-1000,-1000 CLOBBERED_REGS:2000,2000
Q_REGS:2000,2000 NON_Q_REGS:2000,2000 TLS_GOTBASE_REGS:2000,2000
GENERAL_REGS:2000
,2000 MEM:24000,24000
  a1(r83,l0) costs: AD_REGS:0,0 CLOBBERED_REGS:0,0 Q_REGS:0,0 NON_Q_REGS:0,0
TLS_GOTBASE_REGS:0,0 GENERAL_REGS:0,0 MEM:0,0


Pass 1 for finding pseudo/allocno costs

    r84: preferred AD_REGS, alternative GENERAL_REGS, allocno GENERAL_REGS
    r83: preferred GENERAL_REGS, alternative NO_REGS, allocno GENERAL_REGS

  a0(r84,l0) costs: AD_REGS:2000,-1000 CLOBBERED_REGS:2000,2000
Q_REGS:2000,2000 NON_Q_REGS:4000,4000 TLS_GOTBASE_REGS:2000,2000
GENERAL_REGS:2000,
2000 MEM:36000,36000
  a1(r83,l0) costs: GENERAL_REGS:0,0 MEM:0,0

Disposition:
    1:r83  l0     0    0:r84  l0     0

which I believe is to put both pseudo 83 and 84 into DImode eax.

LRA dump has:
********** Assignment #1: **********

    Spill r83 after risky transformations
  Reassigning non-reload pseudos
           Assign 2 to r83 (freq=2000)
is that when it decides to put pseudo 83 into DImode %ecx instead?
If yes, what kind of risky transformation was here and why?

Vlad, can you please have a look?  Thanks.

Reply via email to