diff options
author | Manolis Tsamis <manolis.tsamis@vrull.eu> | 2023-05-25 13:44:41 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2023-06-15 22:13:36 +0200 |
commit | 6a2e8dcbbd4bab374b27abea375bf7a921047800 (patch) | |
tree | 024c7a8913db5f45f6206c16e6f32e5924f7ce81 /gcc | |
parent | 91fb8bdb3944b78bca4f739583ff490c83a92fe7 (diff) | |
download | gcc-6a2e8dcbbd4bab374b27abea375bf7a921047800.zip gcc-6a2e8dcbbd4bab374b27abea375bf7a921047800.tar.gz gcc-6a2e8dcbbd4bab374b27abea375bf7a921047800.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/regcprop.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/regcprop.cc b/gcc/regcprop.cc index f426f4f..6cbfadb 100644 --- a/gcc/regcprop.cc +++ b/gcc/regcprop.cc @@ -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. */ 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) return gen_raw_REG (new_mode, regno); |