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

--- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, the reason why the values aren't being marked as sp based is given in
PR54796 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54796#c2
In these functions, there is no fp_setter insn, so
hard_frame_pointer_adjustment is -1, all we have there is
(insn/f:TI 2695 2874 2696 2 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4
A8])
        (reg:SI 6 bp)) "../../gcc/diagnostic-show-locus.c":3861:1 43 {*pushsi2}
     (expr_list:REG_DEAD (reg:SI 6 bp)
        (nil)))
some pushes to preserve call saved regs
(insn/f:TI 2699 2698 2700 2 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -508 [0xfffffffffffffe04])))
            (clobber (reg:CC 17 flags))
            (clobber (mem:BLK (scratch) [0  A8]))
        ]) "../../gcc/diagnostic-show-locus.c":3861:1 1058
{pro_epilogue_adjust_stack_add_si}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -508 [0xfffffffffffffe04])))
            (nil))))
(note 2700 2699 17 2 NOTE_INSN_PROLOGUE_END)

Now, the reason we don't mark preserved values sp based unconditionally if they
are sp based is the fear about the prologue and pre-prologue spots, as we need
to disambiguate between sp based and hfp based VALUEs and they normally start
the same as sp based.

Not sure what we can do, perhaps also remember if we've seen in the prologue
some important hfp related instruction, at that point somehow force using
different VALUEs for hfp vs. sp based accesses (dunno if by cselib invalidation
of hfp or of sp) and from that point on mark the clearly sp based VALUEs as
sp_based.

Reply via email to