aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2015-01-22 01:35:44 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2015-01-22 01:35:44 +0100
commitc8b90a13c729f6fb33a97c4f4cd8116e5ef7fdf1 (patch)
treec47c1b96b38857c0eb607f3b89455c8b7cd40939 /gcc
parenta393438f272e85f4ec2b69dce9e82448312d4bce (diff)
downloadgcc-c8b90a13c729f6fb33a97c4f4cd8116e5ef7fdf1.zip
gcc-c8b90a13c729f6fb33a97c4f4cd8116e5ef7fdf1.tar.gz
gcc-c8b90a13c729f6fb33a97c4f4cd8116e5ef7fdf1.tar.bz2
re PR rtl-optimization/64682 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
PR rtl-optimization/64682 * combine.c (distribute_notes): When moving a death note for a register that is set in the new I2, make sure to put it before that new I2. PR rtl-optimization/64682 * gcc.c-torture/execute/pr64682.c: New file. From-SVN: r219981
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c5
-rw-r--r--gcc/testsuite/ChangeLog5
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 756c37d..c292bfc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-21 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/64682
+ * combine.c (distribute_notes): When moving a death note for
+ a register that is set in the new I2, make sure to put it
+ before that new I2.
+
2015-01-21 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/rs6000.c (rs6000_file_start): Use rs6000_isa_flags
diff --git a/gcc/combine.c b/gcc/combine.c
index 597aa80..5c763b4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -13684,6 +13684,11 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
|| rtx_equal_p (XEXP (note, 0), elim_i0))
break;
tem_insn = i3;
+ /* If the new I2 sets the same register that is marked dead
+ in the note, the note now should not be put on I2, as the
+ note refers to a previous incarnation of the reg. */
+ if (i2 != 0 && reg_set_p (XEXP (note, 0), PATTERN (i2)))
+ tem_insn = i2;
}
if (place == 0)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f093c78..2a54aff 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-21 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/64682
+ * gcc.c-torture/execute/pr64682.c: New file.
+
2015-01-21 Jakub Jelinek <jakub@redhat.com>
PR debug/64511