diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-07 13:12:42 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-07 13:12:42 +0000 |
commit | 6a9a9da8822746585d4bb7cea7434cfb40fc4ee1 (patch) | |
tree | e785d101633aa2238c1b438f15db3d87ca4ae178 /gcc/auto-inc-dec.c | |
parent | eb1b7c50a469480d0887989fdf170003c92808a8 (diff) | |
download | gcc-6a9a9da8822746585d4bb7cea7434cfb40fc4ee1.tar.gz |
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
Diffstat (limited to 'gcc/auto-inc-dec.c')
-rw-r--r-- | gcc/auto-inc-dec.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) |