diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-13 16:39:59 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-13 16:39:59 +0100 |
commit | 9b7716c9a7f94c00737a0c6f0a149dcae3b216b5 (patch) | |
tree | 098fb4ee8260b0959d8a50ccb1df8194800e95a3 /gcc/combine.c | |
parent | 2d3bc14c2e3e55871d8ad4a466b9cc574ce617e9 (diff) | |
download | gcc-9b7716c9a7f94c00737a0c6f0a149dcae3b216b5.zip gcc-9b7716c9a7f94c00737a0c6f0a149dcae3b216b5.tar.gz gcc-9b7716c9a7f94c00737a0c6f0a149dcae3b216b5.tar.bz2 |
re PR rtl-optimization/79388 (wrong code with -O -fno-tree-coalesce-vars)
PR rtl-optimization/79388
PR rtl-optimization/79450
* combine.c (distribute_notes): When removing TEM_INSN for which
corresponding dest has last value recorded, invalidate that last
value.
* gcc.c-torture/execute/pr79388.c: New test.
* gcc.c-torture/execute/pr79450.c: New test.
From-SVN: r245390
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 727299b..b5c0c18 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -14288,6 +14288,11 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2, NULL_RTX, NULL_RTX, NULL_RTX); distribute_links (LOG_LINKS (tem_insn)); + unsigned int regno = REGNO (XEXP (note, 0)); + reg_stat_type *rsp = ®_stat[regno]; + if (rsp->last_set == tem_insn) + record_value_for_reg (XEXP (note, 0), NULL, NULL_RTX); + SET_INSN_DELETED (tem_insn); if (tem_insn == i2) i2 = NULL; |