summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-13 23:31:48 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-13 23:31:48 +0000
commit2af89801635506744c58a179cebbd0c1ad2225d2 (patch)
tree15cbb5d3f14d62dfccb279c6d3b924cdce7aeabd
parent6e3803fb5313ee4761000a5bf4492300c723911d (diff)
downloadlinaro-gcc-2af89801635506744c58a179cebbd0c1ad2225d2.tar.gz
linaro-gcc-2af89801635506744c58a179cebbd0c1ad2225d2.tar.bz2
linaro-gcc-2af89801635506744c58a179cebbd0c1ad2225d2.zip
PR bootstrap/52172
* cselib.h (cselib_subst_to_values_from_insn): New prototype. * cselib.c (cselib_subst_to_values_from_insn): New function. * sched-deps.c (add_insn_mem_dependence, sched_analyze_1, sched_analyze_2): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184181 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/cselib.c13
-rw-r--r--gcc/cselib.h3
-rw-r--r--gcc/sched-deps.c11
4 files changed, 31 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b6e194f5d6f..e6dd0ca1372 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2012-02-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/52172
+ * cselib.h (cselib_subst_to_values_from_insn): New prototype.
+ * cselib.c (cselib_subst_to_values_from_insn): New function.
+ * sched-deps.c (add_insn_mem_dependence,
+ sched_analyze_1, sched_analyze_2): Use it.
+
2012-02-13 Jan Hubicka <jh@suse.cz>
PR middle-end/52214
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 7d3e4ca52d8..d7cb355fc33 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1905,6 +1905,19 @@ cselib_subst_to_values (rtx x, enum machine_mode memmode)
return copy;
}
+/* Wrapper for cselib_subst_to_values, that indicates X is in INSN. */
+
+rtx
+cselib_subst_to_values_from_insn (rtx x, enum machine_mode memmode, rtx insn)
+{
+ rtx ret;
+ gcc_assert (!cselib_current_insn);
+ cselib_current_insn = insn;
+ ret = cselib_subst_to_values (x, memmode);
+ cselib_current_insn = NULL;
+ return ret;
+}
+
/* Look up the rtl expression X in our tables and return the value it
has. If CREATE is zero, we return NULL if we don't know the value.
Otherwise, we create a new one if possible, using mode MODE if X
diff --git a/gcc/cselib.h b/gcc/cselib.h
index 6a9d79537bc..5b5fe23ae40 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -1,6 +1,6 @@
/* Common subexpression elimination for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 1998, 1999, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -88,6 +88,7 @@ extern rtx cselib_expand_value_rtx_cb (rtx, bitmap, int,
extern bool cselib_dummy_expand_value_rtx_cb (rtx, bitmap, int,
cselib_expand_callback, void *);
extern rtx cselib_subst_to_values (rtx, enum machine_mode);
+extern rtx cselib_subst_to_values_from_insn (rtx, enum machine_mode, rtx);
extern void cselib_invalidate_rtx (rtx);
extern void cselib_reset_table (unsigned int);
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 095bae8a956..33a6996fe4f 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1728,7 +1728,8 @@ add_insn_mem_dependence (struct deps_desc *deps, bool read_p,
if (sched_deps_info->use_cselib)
{
mem = shallow_copy_rtx (mem);
- XEXP (mem, 0) = cselib_subst_to_values (XEXP (mem, 0), GET_MODE (mem));
+ XEXP (mem, 0) = cselib_subst_to_values_from_insn (XEXP (mem, 0),
+ GET_MODE (mem), insn);
}
link = alloc_EXPR_LIST (VOIDmode, canon_rtx (mem), *mem_list);
*mem_list = link;
@@ -2449,7 +2450,9 @@ sched_analyze_1 (struct deps_desc *deps, rtx x, rtx insn)
t = shallow_copy_rtx (dest);
cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
GET_MODE (t), insn);
- XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0), GET_MODE (t));
+ XEXP (t, 0)
+ = cselib_subst_to_values_from_insn (XEXP (t, 0), GET_MODE (t),
+ insn);
}
t = canon_rtx (t);
@@ -2609,7 +2612,9 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
t = shallow_copy_rtx (t);
cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
GET_MODE (t), insn);
- XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0), GET_MODE (t));
+ XEXP (t, 0)
+ = cselib_subst_to_values_from_insn (XEXP (t, 0), GET_MODE (t),
+ insn);
}
if (!DEBUG_INSN_P (insn))