From 6a9a9da8822746585d4bb7cea7434cfb40fc4ee1 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 7 Jun 2010 13:12:42 +0000 Subject: gcc/ PR rtl-optimization/44404 * auto-inc-dec.c (find_inc): Use reg_overlap_mentioned_p instead of count_occurrences to see if it's safe to modify mem_insn.insn. gcc/testsuite/ gcc/testsuite/ PR rtl-optimization/44404 * gcc.dg/pr44404.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160372 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/auto-inc-dec.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/auto-inc-dec.c') diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c index 6b5c3adecbf..94dffc95eb2 100644 --- a/gcc/auto-inc-dec.c +++ b/gcc/auto-inc-dec.c @@ -1068,6 +1068,13 @@ 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 (dump_file) -- cgit v1.2.1