summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 15:26:48 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 15:26:48 +0000
commit6416852cb041376b066d3d7c196ae7f0c80c4329 (patch)
tree4a834c6c447e50e8b3be17c7fcfb6b4c48cfa21e
parent275327540b92ab5e90b2beeb653097fbf133a32f (diff)
downloadgcc-6416852cb041376b066d3d7c196ae7f0c80c4329.tar.gz
PR rtl-optimization/44404
* auto-inc-dec.c (find_inc): Avoid calling count_occurrences if possible, use reg_overlap_mentioned_p instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161920 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/auto-inc-dec.c9
2 files changed, 7 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3a2fcf485d8..934cacdd755 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-07 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR rtl-optimization/44404
+ * auto-inc-dec.c (find_inc): Avoid calling count_occurrences if
+ possible, use reg_overlap_mentioned_p instead.
+
2010-07-07 Duncan Sands <baldrick@free.fr>
PR middle-end/41355
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 94dffc95eb2..20083ad1f83 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -1068,14 +1068,7 @@ find_inc (bool first_try)
/* For the post_add to work, the result_reg of the inc must not be
used in the mem insn since this will become the new index
register. */
- if (count_occurrences (PATTERN (mem_insn.insn), inc_insn.reg_res, 1) == 0
- && reg_overlap_mentioned_p (inc_insn.reg_res, PATTERN (mem_insn.insn)))
- {
- debug_rtx (mem_insn.insn);
- debug_rtx (inc_insn.reg_res);
- gcc_unreachable ();
- }
- if (count_occurrences (PATTERN (mem_insn.insn), inc_insn.reg_res, 1) != 0)
+ if (reg_overlap_mentioned_p (inc_insn.reg_res, PATTERN (mem_insn.insn)))
{
if (dump_file)
fprintf (dump_file, "base reg replacement failure.\n");