summaryrefslogtreecommitdiff
path: root/gcc/auto-inc-dec.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2010-07-07 15:26:48 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2010-07-07 15:26:48 +0000
commit71df5a7ee7f86ce0954a86e375e523906ea4203a (patch)
tree4a834c6c447e50e8b3be17c7fcfb6b4c48cfa21e /gcc/auto-inc-dec.c
parentf625098e0c1b2cbb0abc21b760b3fd4a1fb3d22b (diff)
downloadgcc-71df5a7ee7f86ce0954a86e375e523906ea4203a.tar.gz
re PR rtl-optimization/44404 (auto-inc-dec generates an invalid assembly instruction)
PR rtl-optimization/44404 * auto-inc-dec.c (find_inc): Avoid calling count_occurrences if possible, use reg_overlap_mentioned_p instead. From-SVN: r161920
Diffstat (limited to 'gcc/auto-inc-dec.c')
-rw-r--r--gcc/auto-inc-dec.c9
1 files changed, 1 insertions, 8 deletions
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");