aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2001-08-08 10:38:57 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2001-08-08 10:38:57 +0000
commit917004442036172e64e70b1d0a4a7392069af9cd (patch)
tree7400c2594762a88011f7c77c8ed35b1d7229f9df
parent4b6c5340748f9914998e4beafe3832acfe5d8aae (diff)
downloadgcc-917004442036172e64e70b1d0a4a7392069af9cd.zip
gcc-917004442036172e64e70b1d0a4a7392069af9cd.tar.gz
gcc-917004442036172e64e70b1d0a4a7392069af9cd.tar.bz2
Make cselib_subst_to_values global.
From-SVN: r44717
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cselib.c18
-rw-r--r--gcc/cselib.h1
3 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b5de19..aa78d55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -15,6 +15,11 @@
* sched-rgn.c (rgn_sched_info): Likewise.
* Makefile.in (sched-deps.o): Update dependencies.
+ * cselib.h (cselib_subst_to_values): Declare.
+ * cselib.c (cselib_subst_to_values): No longer static. Allow MEMs
+ that have no value and autoincs to be handled by generating a new
+ dummy value.
+
2001-08-08 Graham Stott <grahams@redhat.com>
* final.c (shorten_branches): Update the INSN_ADDRESSES of insns
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 1311766..89a274f 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -60,7 +60,6 @@ static cselib_val *new_cselib_val PARAMS ((unsigned int,
static void add_mem_for_addr PARAMS ((cselib_val *, cselib_val *,
rtx));
static cselib_val *cselib_lookup_mem PARAMS ((rtx, int));
-static rtx cselib_subst_to_values PARAMS ((rtx));
static void cselib_invalidate_regno PARAMS ((unsigned int,
enum machine_mode));
static int cselib_mem_conflict_p PARAMS ((rtx, rtx));
@@ -765,7 +764,7 @@ cselib_lookup_mem (x, create)
X isn't actually modified; if modifications are needed, new rtl is
allocated. However, the return value can share rtl with X. */
-static rtx
+rtx
cselib_subst_to_values (x)
rtx x;
{
@@ -788,7 +787,11 @@ cselib_subst_to_values (x)
case MEM:
e = cselib_lookup_mem (x, 0);
if (! e)
- abort ();
+ {
+ /* This happens for autoincrements. Assign a value that doesn't
+ match any other. */
+ e = new_cselib_val (++next_unknown_value, GET_MODE (x));
+ }
return e->u.val_rtx;
/* CONST_DOUBLEs must be special-cased here so that we won't try to
@@ -797,6 +800,15 @@ cselib_subst_to_values (x)
case CONST_INT:
return x;
+ case POST_INC:
+ case PRE_INC:
+ case POST_DEC:
+ case PRE_DEC:
+ case POST_MODIFY:
+ case PRE_MODIFY:
+ e = new_cselib_val (++next_unknown_value, GET_MODE (x));
+ return e->u.val_rtx;
+
default:
break;
}
diff --git a/gcc/cselib.h b/gcc/cselib.h
index 59f811a..a3f7ee9 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -65,3 +65,4 @@ extern void cselib_finish PARAMS ((void));
extern void cselib_process_insn PARAMS ((rtx));
extern int rtx_equal_for_cselib_p PARAMS ((rtx, rtx));
extern int references_value_p PARAMS ((rtx, int));
+extern rtx cselib_subst_to_values PARAMS ((rtx));