diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2018-05-09 14:12:33 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2018-05-09 14:12:33 +0200 |
commit | c35533d7e97fda61c50be8b8260157956cf388e2 (patch) | |
tree | 0c11705fcc36e0cb2df00a4a043399348993b03c /gcc | |
parent | 3ba4ff4130903a3ded931d715a2204bd8834fe60 (diff) | |
download | gcc-c35533d7e97fda61c50be8b8260157956cf388e2.zip gcc-c35533d7e97fda61c50be8b8260157956cf388e2.tar.gz gcc-c35533d7e97fda61c50be8b8260157956cf388e2.tar.bz2 |
regcprop: Avoid REG_CFA_REGISTER notes (PR85645)
Changing a SET that has a REG_CFA_REGISTER note is wrong if we are
changing the SET_DEST, or if the REG_CFA_REGISTER has nil as its
argument, and maybe some other cases. It's never really useful to
propagate into such an instruction, so let's just bail whenever we
see such a note.
PR rtl-optimization/85645
* regcprop.c (copyprop_hardreg_forward_1): Don't propagate into an
insn that has a REG_CFA_REGISTER note.
From-SVN: r260074
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/regcprop.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 83d01ed..580f41b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-09 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/85645 + * regcprop.c (copyprop_hardreg_forward_1): Don't propagate into an + insn that has a REG_CFA_REGISTER note. + 2018-05-09 Richard Sandiford <richard.sandiford@linaro.org> * cfgexpand.c (expand_clobber): New function. diff --git a/gcc/regcprop.c b/gcc/regcprop.c index a664f76..1813242 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -848,6 +848,12 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) && reg_overlap_mentioned_p (XEXP (link, 0), SET_SRC (set))) set = NULL; } + + /* We need to keep CFI info correct, and the same on all paths, + so we cannot normally replace the registers REG_CFA_REGISTER + refers to. Bail. */ + if (REG_NOTE_KIND (link) == REG_CFA_REGISTER) + goto did_replacement; } /* Special-case plain move instructions, since we may well |