aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-07-23 14:08:10 +0200
committerGerald Pfeifer <gerald@gcc.gnu.org>2002-07-23 12:08:10 +0000
commit2b773ee2c1954b982aac0ee71fd6e5ae148e4691 (patch)
tree6ad4354996bd2595d502fa3e71a030e6cfb95ec4 /gcc
parenta0dc500c860478e0917fd98ad618ec65482fe395 (diff)
downloadgcc-2b773ee2c1954b982aac0ee71fd6e5ae148e4691.zip
gcc-2b773ee2c1954b982aac0ee71fd6e5ae148e4691.tar.gz
gcc-2b773ee2c1954b982aac0ee71fd6e5ae148e4691.tar.bz2
gcse.c (try_replace_reg): Use num_changes_pending.
2002-07-23 Jan Hubicka <jh@suse.cz> * gcse.c (try_replace_reg): Use num_changes_pending. * recog.c (num_changes_pending): New function. (validate_replace_src): Use validate_repalce_src_group. (validate_replace_src_group): New. * recog.h (validate_repalce_src_group): New. (num_changes_pending): Likewise. From-SVN: r55677
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/gcse.c7
-rw-r--r--gcc/recog.c23
-rw-r--r--gcc/recog.h2
4 files changed, 33 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3805919..b661633 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-23 Jan Hubicka <jh@suse.cz>
+
+ * gcse.c (try_replace_reg): Use num_changes_pending.
+ * recog.c (num_changes_pending): New function.
+ (validate_replace_src): Use validate_repalce_src_group.
+ (validate_replace_src_group): New.
+ * recog.h (validate_repalce_src_group): New.
+ (num_changes_pending): Likewise.
+
Tue Jul 23 12:16:58 2002 J"orn Rennecke <joern.rennecke@superh.com>
* calls.c (emit_library_call_value_1): If
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 37fa2d6..620b986 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3977,10 +3977,9 @@ try_replace_reg (from, to, insn)
int success = 0;
rtx set = single_set (insn);
- if (reg_mentioned_p (from, PATTERN (insn)))
- {
- success = validate_replace_src (from, to, insn);
- }
+ validate_replace_src_group (from, to, insn);
+ if (num_changes_pending () && apply_change_group ())
+ success = 1;
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
diff --git a/gcc/recog.c b/gcc/recog.c
index 5b5d3dc..3769249 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -308,6 +308,13 @@ insn_invalid_p (insn)
return 0;
}
+/* Return number of changes made and not validated yet. */
+int
+num_changes_pending ()
+{
+ return num_changes;
+}
+
/* Apply a group of changes previously issued with `validate_change'.
Return 1 if all changes are valid, zero otherwise. */
@@ -671,11 +678,10 @@ validate_replace_src_1 (x, data)
}
/* Try replacing every occurrence of FROM in INSN with TO, avoiding
- SET_DESTs. After all changes have been made, validate by seeing if
- INSN is still valid. */
+ SET_DESTs. */
-int
-validate_replace_src (from, to, insn)
+void
+validate_replace_src_group (from, to, insn)
rtx from, to, insn;
{
struct validate_replace_src_data d;
@@ -684,6 +690,15 @@ validate_replace_src (from, to, insn)
d.to = to;
d.insn = insn;
note_uses (&PATTERN (insn), validate_replace_src_1, &d);
+}
+
+/* Same as validate_repalace_src_group, but validate by seeing if
+ INSN is still valid. */
+int
+validate_replace_src (from, to, insn)
+ rtx from, to, insn;
+{
+ validate_replace_src_group (from, to, insn);
return apply_change_group ();
}
diff --git a/gcc/recog.h b/gcc/recog.h
index 4d47440..86af35f 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -89,6 +89,8 @@ extern int validate_replace_rtx_subexp PARAMS ((rtx, rtx, rtx, rtx *));
extern int validate_replace_rtx PARAMS ((rtx, rtx, rtx));
extern void validate_replace_rtx_group PARAMS ((rtx, rtx, rtx));
extern int validate_replace_src PARAMS ((rtx, rtx, rtx));
+extern void validate_replace_src_group PARAMS ((rtx, rtx, rtx));
+extern int num_changes_pending PARAMS ((void));
#ifdef HAVE_cc0
extern int next_insn_tests_no_inequality PARAMS ((rtx));
#endif