aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2007-10-15 10:30:13 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2007-10-15 10:30:13 +0000
commit93b4b4cc8401829bd6be58f24ebaee00aecedb10 (patch)
tree10d9583a0f676cb45bcb0f35f9d784484c56e5d7
parent5c7c209b1f094110552c56f556ade12c20e58823 (diff)
downloadgcc-93b4b4cc8401829bd6be58f24ebaee00aecedb10.zip
gcc-93b4b4cc8401829bd6be58f24ebaee00aecedb10.tar.gz
gcc-93b4b4cc8401829bd6be58f24ebaee00aecedb10.tar.bz2
re PR target/33133 (ICE in try_ready, at haifa-sched.c:2958 with -O2/-O3)
PR target/33133 * haifa-sched.c (process_insn_forw_deps_be_in_spec): Check if speculation type of insn can be changed before trying to do that. * gcc.c-torture/compile/pr33133.c: New test. From-SVN: r129315
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/haifa-sched.c13
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr33133.c50
4 files changed, 74 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 41969ad..536ef54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-15 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ PR target/33133
+
+ * haifa-sched.c (process_insn_forw_deps_be_in_spec): Check if
+ speculation type of insn can be changed before trying to do that.
+
2007-10-15 Eric Botcazou <ebotcazou@libertysurf.fr>
* dse.c (struct insn_info): Add 'frame_read' field.
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 9d1f8b0..d366008 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -3292,8 +3292,17 @@ process_insn_forw_deps_be_in_spec (rtx insn, rtx twin, ds_t fs)
due to backend decision. Hence we can't let the
probability of the speculative dep to decrease. */
dep_weak (ds) <= dep_weak (fs))
- /* Transform it to be in speculative. */
- ds = (ds & ~BEGIN_SPEC) | fs;
+ {
+ ds_t new_ds;
+
+ new_ds = (ds & ~BEGIN_SPEC) | fs;
+
+ if (/* consumer can 'be in speculative'. */
+ sched_insn_is_legitimate_for_speculation_p (consumer,
+ new_ds))
+ /* Transform it to be in speculative. */
+ ds = new_ds;
+ }
}
else
/* Mark the dep as 'be in speculative'. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4bfde80..dae94d9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-15 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ PR target/33133
+
+ * gcc.c-torture/compile/pr33133.c: New test.
+
2007-10-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33672
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr33133.c b/gcc/testsuite/gcc.c-torture/compile/pr33133.c
new file mode 100644
index 0000000..d1b0964
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr33133.c
@@ -0,0 +1,50 @@
+static char newshuffle[256 + 16] = {
+ 0x0f, 0x08, 0x05, 0x07, 0x0c, 0x02, 0x0e, 0x09, 0x00, 0x01, 0x06, 0x0d,
+ 0x03, 0x04, 0x0b, 0x0a, 0x02, 0x0c, 0x0e, 0x06, 0x0f, 0x00, 0x01, 0x08,
+ 0x0d, 0x03, 0x0a, 0x04, 0x09, 0x0b, 0x05, 0x07, 0x05, 0x02, 0x09, 0x0f,
+ 0x0c, 0x04, 0x0d, 0x00, 0x0e, 0x0a, 0x06, 0x08, 0x0b, 0x01, 0x03, 0x07,
+ 0x0f, 0x0d, 0x02, 0x06, 0x07, 0x08, 0x05, 0x09, 0x00, 0x04, 0x0c, 0x03,
+ 0x01, 0x0a, 0x0b, 0x0e, 0x05, 0x0e, 0x02, 0x0b, 0x0d, 0x0a, 0x07, 0x00,
+ 0x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, 0x02, 0x03, 0x0e, 0x0f, 0x02, 0x0d, 0x0c, 0x04, 0x05,
+ 0x09, 0x06, 0x00, 0x01, 0x0b, 0x07, 0x0a, 0x08,
+};
+void newpassencrypt (char *, char *, char *);
+void
+newpassencrypt (char *old, char *new, char *out)
+{
+ char *p, *bx;
+ char copy[8];
+ int i, di, ax;
+ char cl, dl, ch;
+ for (i = 0; i < 16; i++)
+ {
+ for (bx = old + 7; bx > old; bx--)
+ {
+ *bx = ((bx[-1] >> 4) & 0x0f) | ((*bx) << 4);
+ }
+ for (di = 0; di < 16; di++)
+ {
+ if (newshuffle[di + 0x100] & 1)
+ ch = ((copy[newshuffle[di + 0x100] / 2] >> 4) & 0x0f);
+ else
+ ch = copy[newshuffle[di + 0x100] / 2] & 0x0f;
+ out[di / 2] |= ((di & 1) ? ch << 4 : ch);
+ }
+ memcpy (copy, out, 8);
+ }
+}