cprop_hardreg: Enable propagation of the stack pointer if possible
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.
This commit is contained in:
parent
91fb8bdb39
commit
6a2e8dcbbd
1 changed files with 6 additions and 1 deletions
|
@ -422,7 +422,12 @@ maybe_mode_change (machine_mode orig_mode, machine_mode copy_mode,
|
||||||
|
|
||||||
It's unclear if we need to do the same for other special registers. */
|
It's unclear if we need to do the same for other special registers. */
|
||||||
if (regno == STACK_POINTER_REGNUM)
|
if (regno == STACK_POINTER_REGNUM)
|
||||||
return NULL_RTX;
|
{
|
||||||
|
if (orig_mode == new_mode)
|
||||||
|
return stack_pointer_rtx;
|
||||||
|
else
|
||||||
|
return NULL_RTX;
|
||||||
|
}
|
||||||
|
|
||||||
if (orig_mode == new_mode)
|
if (orig_mode == new_mode)
|
||||||
return gen_raw_REG (new_mode, regno);
|
return gen_raw_REG (new_mode, regno);
|
||||||
|
|
Loading…
Add table
Reference in a new issue