diff options
author | Manolis Tsamis <manolis.tsamis@vrull.eu> | 2023-06-20 16:23:52 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2023-06-28 16:05:55 +0200 |
commit | 893883f2f8f56984209c6ed210ee992ff71a14b0 (patch) | |
tree | e4c504113b65507c687b33c6c6ddaf8bc7250db9 /gcc/expr.cc | |
parent | 4bf76b5b6db8e68755788ec91012c5a686440720 (diff) | |
download | gcc-893883f2f8f56984209c6ed210ee992ff71a14b0.zip gcc-893883f2f8f56984209c6ed210ee992ff71a14b0.tar.gz gcc-893883f2f8f56984209c6ed210ee992ff71a14b0.tar.bz2 |
cprop_hardreg: fix ORIGINAL_REGNO/REG_ATTRS/REG_POINTER handling
Fixes: 6a2e8dcbbd4bab3
Propagation for the stack pointer in regcprop was enabled in
6a2e8dcbbd4bab3, but set ORIGINAL_REGNO/REG_ATTRS/REG_POINTER for
stack_pointer_rtx which caused regression (e.g., PR 110313, PR 110308).
This fix adds special handling for stack_pointer_rtx in the places
where maybe_mode_change is called. This also adds an check in
maybe_mode_change to return the stack pointer only when the requested
mode matches the mode of stack_pointer_rtx.
PR debug/110308
gcc/ChangeLog:
* regcprop.cc (maybe_mode_change): Check stack_pointer_rtx mode.
(maybe_copy_reg_attrs): New function.
(find_oldest_value_reg): Use maybe_copy_reg_attrs.
(copyprop_hardreg_forward_1): Ditto.
gcc/testsuite/ChangeLog:
* g++.dg/torture/pr110308.C: New test.
Signed-off-by: Manolis Tsamis <manolis.tsamis@vrull.eu>
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions