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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is in code added in r244942:
198204   vmakarov       if (!lra_reg_val_equal_p (conflict_regno, val, offset)
192719   vmakarov           /* If it is multi-register pseudos they should
start on
192719   vmakarov              the same hard register.  */
192719   vmakarov           || hard_regno != reg_renumber[conflict_regno])
244942   vmakarov         {
244942   vmakarov           int conflict_hard_regno =
reg_renumber[conflict_regno];
244942   vmakarov           machine_mode biggest_mode =
lra_reg_info[conflict_regno].biggest_mode;
252014   rsandifo           int biggest_nregs = hard_regno_nregs
(conflict_hard_regno,
252014   rsandifo                                                
biggest_mode);
252014   rsandifo           int nregs_diff
252014   rsandifo             = (biggest_nregs
252014   rsandifo                - hard_regno_nregs (conflict_hard_regno,
252014   rsandifo                                    PSEUDO_REGNO_MODE
(conflict_regno)));
244942   vmakarov           add_to_hard_reg_set (&conflict_set,
244942   vmakarov                                biggest_mode,
244942   vmakarov                                conflict_hard_regno
244942   vmakarov                                - (WORDS_BIG_ENDIAN ?
nregs_diff : 0));
244942   vmakarov         }

hard_regno is 3, conflict_regno 94, reg_renumber[conflict_regno] aka
conflict_hard_regno 0.
biggest_mode is V4SImode, biggest_nregs 2, PSEUDO_REGNO_MODE is SImode and so
nregs_diff is 1.
But, as conflict_hard_regno is 0, this actually means we call
add_to_hard_reg_set with -1U as the last argument.
Vlad, could you please have a look?

Do we allow V4SImode to be allocated on any regnos, or just multiples of the
size?

Should we e.g. in a loop find out for WORDS_BIG_ENDIAN which of the regnos from
MAX (conflict_hard_regno - nregs_diff, 0) to conflict_hard_regno inclusive
first satisfies
targetm.hard_regno_mode_ok (regno, biggest_mode) and use that regno for the
add_to_hard_reg_set
argument?  Or just do there the MAX (conflict_hard_regno - (WORDS_BIG_ENDIAN ?
nregs_diff : 0), 0) ?

Reply via email to