aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2011-01-26 17:03:47 -0500
committerDJ Delorie <dj@gcc.gnu.org>2011-01-26 17:03:47 -0500
commit5c2917ec9d9fe2e633d09b9401a23b0a9c47a23f (patch)
tree0b4b6309cb2c8c5e4a75beb4bca4b4058e10e2f4
parent81cce6f682ecac63e57d6b12514fd774808bc067 (diff)
downloadgcc-5c2917ec9d9fe2e633d09b9401a23b0a9c47a23f.zip
gcc-5c2917ec9d9fe2e633d09b9401a23b0a9c47a23f.tar.gz
gcc-5c2917ec9d9fe2e633d09b9401a23b0a9c47a23f.tar.bz2
re PR rtl-optimization/46878 (V850 ICE in in maybe_add_or_update_dep_1, at sched-deps.c:854)
PR rtl-optimization/46878 * combine.c (insn_a_feeds_b): Check for the implicit cc0 setter/user dependency as well. * gcc.dg/pr46878-1.c: New test. From-SVN: r169307
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr46878-1.c30
4 files changed, 48 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa574e8..67ce1d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-26 DJ Delorie <dj@redhat.com>
+
+ PR rtl-optimization/46878
+ * combine.c (insn_a_feeds_b): Check for the implicit cc0
+ setter/user dependency as well.
+
2011-01-26 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/44469
diff --git a/gcc/combine.c b/gcc/combine.c
index 3ee53e6..4fe71f3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1032,7 +1032,9 @@ clear_log_links (void)
/* Walk the LOG_LINKS of insn B to see if we find a reference to A. Return
true if we found a LOG_LINK that proves that A feeds B. This only works
if there are no instructions between A and B which could have a link
- depending on A, since in that case we would not record a link for B. */
+ depending on A, since in that case we would not record a link for B.
+ We also check the implicit dependency created by a cc0 setter/user
+ pair. */
static bool
insn_a_feeds_b (rtx a, rtx b)
@@ -1041,6 +1043,10 @@ insn_a_feeds_b (rtx a, rtx b)
for (links = LOG_LINKS (b); links; links = XEXP (links, 1))
if (XEXP (links, 0) == a)
return true;
+#ifdef HAVE_cc0
+ if (sets_cc0_p (a))
+ return true;
+#endif
return false;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 527b3ed..a4ed365 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-26 DJ Delorie <dj@redhat.com>
+
+ PR rtl-optimization/46878
+ * gcc.dg/pr46878-1.c: New test.
+
2011-01-26 Jakub Jelinek <jakub@redhat.com>
PR c++/47476
diff --git a/gcc/testsuite/gcc.dg/pr46878-1.c b/gcc/testsuite/gcc.dg/pr46878-1.c
new file mode 100644
index 0000000..f5b42de
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46878-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/46878 */
+/* Make sure this doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct baz
+{
+ int *newp;
+};
+
+int
+get_ice (int *op, struct baz *ret)
+{
+ int *tmpp;
+ int c;
+ c = (__foo () != 1);
+ if (__bar ())
+ {
+ return (1);
+ }
+ if (c)
+ tmpp = op;
+ if (tmpp)
+ {
+ }
+ else if (c)
+ {
+ ret->newp = tmpp;
+ }
+}