aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2008-09-18 05:24:57 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2008-09-18 05:24:57 +0000
commit078a70a15ed75e2e9ed4c4d09450b2522e82e6ae (patch)
tree388b3c690b3ecfc5059bdde479615be0a23582dd
parent38c4df0b852230edc05c20b000bec61819735ecf (diff)
downloadgcc-078a70a15ed75e2e9ed4c4d09450b2522e82e6ae.zip
gcc-078a70a15ed75e2e9ed4c4d09450b2522e82e6ae.tar.gz
gcc-078a70a15ed75e2e9ed4c4d09450b2522e82e6ae.tar.bz2
haifa-sched.c (dep_cost_1): Recognize the producer even if the consumer is an asm.
* haifa-sched.c (dep_cost_1): Recognize the producer even if the consumer is an asm. Add comment why this is important. (choose_ready): Add comment to the "INSN_CODE (insn) >= 0 || recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around it. From-SVN: r140444
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/haifa-sched.c16
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81cddbc..6c2e2b3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-17 Adam Nemet <anemet@caviumnetworks.com>
+
+ * haifa-sched.c (dep_cost_1): Recognize the producer even if the
+ consumer is an asm. Add comment why this is important.
+ (choose_ready): Add comment to the "INSN_CODE (insn) >= 0 ||
+ recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around
+ it.
+
2008-09-17 Joseph Myers <joseph@codesourcery.com>
* expr.c (emit_group_store): Do not shift before moving via a
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index ba60437..46640c4 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -646,10 +646,12 @@ insn_cost (rtx insn)
/* Compute cost of dependence LINK.
This is the number of cycles between instruction issue and
- instruction results. */
+ instruction results.
+ ??? We also use this function to call recog_memoized on all insns. */
int
dep_cost_1 (dep_t link, dw_t dw)
{
+ rtx insn = DEP_PRO (link);
rtx used = DEP_CON (link);
int cost;
@@ -657,10 +659,12 @@ dep_cost_1 (dep_t link, dw_t dw)
This allows the computation of a function's result and parameter
values to overlap the return and call. */
if (recog_memoized (used) < 0)
- cost = 0;
+ {
+ cost = 0;
+ recog_memoized (insn);
+ }
else
{
- rtx insn = DEP_PRO (link);
enum reg_note dep_type = DEP_TYPE (link);
cost = insn_cost (insn);
@@ -2312,8 +2316,14 @@ choose_ready (struct ready_list *ready, rtx *insn_ptr)
{
insn = ready_element (ready, i);
+#ifdef ENABLE_CHECKING
+ /* If this insn is recognizable we should have already
+ recognized it earlier.
+ ??? Not very clear where this is supposed to be done.
+ See dep_cost_1. */
gcc_assert (INSN_CODE (insn) >= 0
|| recog_memoized (insn) < 0);
+#endif
ready_try [i]
= (/* INSN_CODE check can be omitted here as it is also done later