From 5dc9187e08f8c1897692b27f4c8cf9d9556f5fbb Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sat, 11 Feb 2012 09:12:42 +0100 Subject: [PATCH] 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: r184125 --- gcc/ChangeLog | 17 +++++++++++------ gcc/compare-elim.c | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 36afb4283b4b..e98c8c2eb1db 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-02-11 Uros Bizjak + + * compare-elim.c (find_comparisons_in_bb): Eliminate only compares + having the same mode as previous compare. + 2012-02-09 Jack Howarth Backported from mainline @@ -87,7 +92,7 @@ 2012-02-09 Peter Bergner - Backport from mainline + Backport from mainline 2012-02-09 Peter Bergner PR middle-end/52140 @@ -95,7 +100,7 @@ 2012-02-09 Andrey Belevantsev - Backport from mainline + Backport from mainline 2012-01-20 Andrey Belevantsev PR target/51106 @@ -109,11 +114,11 @@ bit position to it (if any). 2012-02-07 Kai Tietz - Dave Korn + Dave Korn - PR target/40068 - * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): - Take care that typinfo gets dllexport-attribute. + PR target/40068 + * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): + Take care that typinfo gets dllexport-attribute. 2012-02-07 Alan Modra diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c index 62abd9c7d68c..41097ff5a21e 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 -- 2.47.2