aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2010-01-15 21:54:01 +0000
committerJing Yu <jingyu@gcc.gnu.org>2010-01-15 21:54:01 +0000
commit4a62494df2d37fc03d1778fd69064dc6cd2dc0b9 (patch)
tree58ebeac6f70fabacbde6abba8c1de445738f945e
parent5a869057b49f37060b718042d5131e4f8d2da802 (diff)
downloadgcc-4a62494df2d37fc03d1778fd69064dc6cd2dc0b9.zip
gcc-4a62494df2d37fc03d1778fd69064dc6cd2dc0b9.tar.gz
gcc-4a62494df2d37fc03d1778fd69064dc6cd2dc0b9.tar.bz2
re PR rtl-optimization/42691 (problematic REG_EQUAL note added to SUBREG)
2010-01-15 Jing Yu <jingyu@google.com> PR rtl-optimization/42691 * combine.c (try_combine): Set changed_i3_dest to 1 when I2 and I3 set a pseudo to a constant and are merged, and adjust comments. 2010-01-15 Jing Yu <jingyu@google.com> PR rtl-optimization/42691 * gcc.c-torture/execute/pr42691.c: New. From-SVN: r155948
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr42691.c41
4 files changed, 58 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 80151a7..f1f6e5c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-15 Jing Yu <jingyu@google.com>
+
+ PR rtl-optimization/42691
+ * combine.c (try_combine): Set changed_i3_dest to 1 when I2 and I3 set
+ a pseudo to a constant and are merged, and adjust comments.
+
2010-01-15 Eric Botcazou <ebotcazou@adacore.com>
* config/i386/sse.md (avx_vperm2f128<mode>3): Fix typo.
diff --git a/gcc/combine.c b/gcc/combine.c
index 5ae557c..e5d4c5a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2663,10 +2663,16 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
i2dest = SET_DEST (temp);
i2dest_killed = dead_or_set_p (i2, i2dest);
+ /* Replace the source in I2 with the new constant and make the
+ resulting insn the new pattern for I3. Then skip to where we
+ validate the pattern. Everything was set up above. */
SUBST (SET_SRC (temp),
immed_double_const (olo, ohi, GET_MODE (SET_DEST (temp))));
newpat = PATTERN (i2);
+
+ /* The dest of I3 has been replaced with the dest of I2. */
+ changed_i3_dest = 1;
goto validate_replacement;
}
}
@@ -3038,8 +3044,6 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
}
}
- /* We come here when we are replacing a destination in I2 with the
- destination of I3. */
validate_replacement:
/* Note which hard regs this insn has as inputs. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 990ea36..89469ad 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-15 Jing Yu <jingyu@google.com>
+
+ PR rtl-optimization/42691
+ * gcc.c-torture/execute/pr42691.c: New.
+
2010-01-15 Richard Guenther <rguenther@suse.de>
PR middle-end/42739
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr42691.c b/gcc/testsuite/gcc.c-torture/execute/pr42691.c
new file mode 100644
index 0000000..7eeee99
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr42691.c
@@ -0,0 +1,41 @@
+extern void abort (void);
+
+union _D_rep
+{
+ unsigned short rep[4];
+ double val;
+};
+
+int add(double* key, double* table)
+{
+ unsigned i = 0;
+ double* deletedEntry = 0;
+ while (1) {
+ double* entry = table + i;
+
+ if (*entry == *key)
+ break;
+
+ union _D_rep _D_inf = {{ 0, 0, 0, 0x7ff0 }};
+ if (*entry != _D_inf.val)
+ abort ();
+
+ union _D_rep _D_inf2 = {{ 0, 0, 0, 0x7ff0 }};
+ if (!_D_inf2.val)
+ deletedEntry = entry;
+
+ i++;
+ }
+ if (deletedEntry)
+ *deletedEntry = 0.0;
+ return 0;
+}
+
+int main ()
+{
+ union _D_rep infinit = {{ 0, 0, 0, 0x7ff0 }};
+ double table[2] = { infinit.val, 23 };
+ double key = 23;
+ int ret = add (&key, table);
+ return ret;
+}