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

--- Comment #20 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
The problem is ira-costs.c.  One pseudo gets equal costs for memory and all
classes.  Therefore when non-mmx hard regs are not enough, a mmx is used.

After initialization of costs of reg classes for the pseudo, the costs are
never updated as all alternatives of insns where the pseudo occurs are
rejected.

The insn and the code in ira-costs.c in consideration are

(insn 26 25 27 4 (set (reg:SF 147 [ D.2423 ])
        (float:SF (reg/v:SI 155 [ z ]))) 203 {*floatsisf2_i387}
     (expr_list:REG_DEAD (reg/v:SI 155 [ z ])
        (nil)))

(define_insn "*float<SWI48x:mode><MODEF:mode>2_i387"
  [(set (match_operand:MODEF 0 "register_operand" "=f")
        (float:MODEF (match_operand:SWI48x 1 "nonimmediate_operand" "m")))]


              if (classes[i] == NO_REGS)
                {
                  /* We must always fail if the operand is a REG, but           
                     we did not find a suitable class.                          

                     Otherwise we may perform an uninitialized read             
                     from this_op_costs after the `continue' statement          
                     below.  */
                  alt_fail = 1;

The code is originated from the old RA which is originated from reload in own
turn.  The reload was not enable to deal with only 'm' alternative (when LRA
works well with only 'm').

I am working on the patch and I hope to commit it today into the branch and
trunk.

Reply via email to