compare-elim.c (try_eliminate_compare): Also handle operands with implicit extensions.

* compare-elim.c (try_eliminate_compare): Also handle operands with
	implicit extensions.

From-SVN: r186805
This commit is contained in:
Uros Bizjak 2012-04-25 08:05:26 +02:00
parent 2b210b6f0b
commit ad1d9a5079
2 changed files with 25 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2012-04-25 Uros Bizjak <ubizjak@gmail.com>
* compare-elim.c (try_eliminate_compare): Also handle operands with
implicit extensions.
2012-04-25 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000 (SAVE_INLINE_VRS, REST_INLINE_VRS,
@ -205,8 +210,7 @@
2012-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/53084
* varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR
of MEM_REF.
* varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR of MEM_REF.
(output_addressed_constants): Likewise.
PR middle-end/52999

View File

@ -563,10 +563,26 @@ try_eliminate_compare (struct comparison *cmp)
Validate that PREV_CLOBBER itself does in fact refer to IN_A. Do
recall that we've already validated the shape of PREV_CLOBBER. */
x = XVECEXP (PATTERN (insn), 0, 0);
if (!rtx_equal_p (SET_DEST (x), in_a))
if (rtx_equal_p (SET_DEST (x), in_a))
cmp_src = SET_SRC (x);
/* Also check operations with implicit extensions, e.g.:
[(set (reg:DI)
(zero_extend:DI (plus:SI (reg:SI)(reg:SI))))
(set (reg:CCZ flags)
(compare:CCZ
(plus:SI (reg:SI)(reg:SI))
(const_int 0)))] */
else if (REG_P (SET_DEST (x))
&& REG_P (in_a)
&& REGNO (SET_DEST (x)) == REGNO (in_a)
&& (GET_CODE (SET_SRC (x)) == ZERO_EXTEND
|| GET_CODE (SET_SRC (x)) == SIGN_EXTEND)
&& GET_MODE (XEXP (SET_SRC (x), 0)) == GET_MODE (in_a))
cmp_src = XEXP (SET_SRC (x), 0);
else
return false;
cmp_src = SET_SRC (x);
/* Determine if we ought to use a different CC_MODE here. */
flags = maybe_select_cc_mode (cmp, cmp_src, cmp->in_b);
if (flags == NULL)