]> git.ipfire.org Git - thirdparty/gcc.git/commit
cprop_hardreg: Allow propagation of stack pointer in more cases.
authorManolis Tsamis <manolis.tsamis@vrull.eu>
Mon, 7 Aug 2023 10:10:16 +0000 (12:10 +0200)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Mon, 7 Aug 2023 17:31:12 +0000 (19:31 +0200)
commitadfc236c6294d339d30222178160fdea55ab2e87
tree5aa4d5f9d048513570a90d5385317e824fefb85d
parentf9d93f8cc2453e816f3dc327d84c6468397d13db
cprop_hardreg: Allow propagation of stack pointer in more cases.

The stack pointer propagation fix 736f8fd3 turned out to be more
restrictive than needed by rejecting propagation of the stack pointer
when REG_POINTER didn't match.

This commit removes this check:
  When the stack pointer is propagated it is fine for this to result in
  REG_POINTER becoming true from false, which is what the original code
  checked.

This simplification makes the previously introduced function
maybe_copy_reg_attrs obsolete and the logic can be inlined at the call
sites, as it was before 736f8fd3.

gcc/ChangeLog:

* regcprop.cc (maybe_copy_reg_attrs): Remove unnecessary function.
(find_oldest_value_reg): Inline stack_pointer_rtx check.
(copyprop_hardreg_forward_1): Inline stack_pointer_rtx check.
gcc/regcprop.cc