On 5/31/23 06:15, Manolis Tsamis wrote:
On Thu, May 25, 2023 at 4:38 PM Jeff Law <jeffreya...@gmail.com> wrote:



On 5/25/23 06:35, Manolis Tsamis wrote:
Propagation of the stack pointer in cprop_hardreg is currenty forbidden
in all cases, due to maybe_mode_change returning NULL. Relax this
restriction and allow propagation when no mode change is requested.

gcc/ChangeLog:

          * regcprop.cc (maybe_mode_change): Enable stack pointer propagation.
I can't see how this can be correct given the stack pointer equality
tests elsewhere in the compiler, particularly the various targets.

The problem is if you change the mode then you end up with multiple REG
expressions that reference the stack pointer.

See rev: d1446456c3fcaa7be628726c9de4a877729490ca and the thread around
the change which introduced this code.


Hi Jeff,

Isn't this fine for this case since:

   1) stack_pointer_rtx is used which won't cause issues with pointer
equalities (If I understand correctly).
   2) Propagation is guarded with `if (orig_mode == new_mode)` so only
when there is no mode change.
I must have missed #2 -- is that something that changed since the first iteration for Ventana many months ago?

Anyway, hoping to make meaningful progress on these two patches over the next couple days.

jeff

Reply via email to