diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2012-02-11 09:11:34 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2012-02-11 09:11:34 +0100 |
commit | 28f7ff45ec593f6a2f5f76e16f32c682564794e4 (patch) | |
tree | a79a77ff63e91824a64db15c69f6b933d0f1d178 /gcc/compare-elim.c | |
parent | 83a5c149a6a19a98d0e5e46d43927549f210a14e (diff) | |
download | gcc-28f7ff45ec593f6a2f5f76e16f32c682564794e4.zip gcc-28f7ff45ec593f6a2f5f76e16f32c682564794e4.tar.gz gcc-28f7ff45ec593f6a2f5f76e16f32c682564794e4.tar.bz2 |
compare-elim.c (find_comparisons_in_bb): Eliminate only compares having the same mode as previous compare.
* compare-elim.c (find_comparisons_in_bb): Eliminate only compares
having the same mode as previous compare.
From-SVN: r184124
Diffstat (limited to 'gcc/compare-elim.c')
-rw-r--r-- | gcc/compare-elim.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c index 8d7fd01..15d8d62 100644 --- a/gcc/compare-elim.c +++ b/gcc/compare-elim.c @@ -297,8 +297,11 @@ find_comparisons_in_bb (struct dom_walk_data *data ATTRIBUTE_UNUSED, src = conforming_compare (insn); if (src) { + enum machine_mode src_mode = GET_MODE (src); + /* Eliminate a compare that's redundant with the previous. */ if (last_cmp_valid + && src_mode == last_cmp->orig_mode && rtx_equal_p (last_cmp->in_a, XEXP (src, 0)) && rtx_equal_p (last_cmp->in_b, XEXP (src, 1))) { @@ -311,7 +314,7 @@ find_comparisons_in_bb (struct dom_walk_data *data ATTRIBUTE_UNUSED, last_cmp->prev_clobber = last_clobber; last_cmp->in_a = XEXP (src, 0); last_cmp->in_b = XEXP (src, 1); - last_cmp->orig_mode = GET_MODE (SET_DEST (single_set (insn))); + last_cmp->orig_mode = src_mode; VEC_safe_push (comparison_struct_p, heap, all_compares, last_cmp); /* It's unusual, but be prepared for comparison patterns that |