Commit ad1d9a50 by Uros Bizjak

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
parent 2b210b6f
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> 2012-04-25 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000 (SAVE_INLINE_VRS, REST_INLINE_VRS, * config/rs6000/rs6000 (SAVE_INLINE_VRS, REST_INLINE_VRS,
...@@ -205,8 +210,7 @@ ...@@ -205,8 +210,7 @@
2012-04-24 Jakub Jelinek <jakub@redhat.com> 2012-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/53084 PR middle-end/53084
* varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR * varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR of MEM_REF.
of MEM_REF.
(output_addressed_constants): Likewise. (output_addressed_constants): Likewise.
PR middle-end/52999 PR middle-end/52999
......
...@@ -563,10 +563,26 @@ try_eliminate_compare (struct comparison *cmp) ...@@ -563,10 +563,26 @@ try_eliminate_compare (struct comparison *cmp)
Validate that PREV_CLOBBER itself does in fact refer to IN_A. Do Validate that PREV_CLOBBER itself does in fact refer to IN_A. Do
recall that we've already validated the shape of PREV_CLOBBER. */ recall that we've already validated the shape of PREV_CLOBBER. */
x = XVECEXP (PATTERN (insn), 0, 0); 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; return false;
cmp_src = SET_SRC (x);
/* Determine if we ought to use a different CC_MODE here. */ /* Determine if we ought to use a different CC_MODE here. */
flags = maybe_select_cc_mode (cmp, cmp_src, cmp->in_b); flags = maybe_select_cc_mode (cmp, cmp_src, cmp->in_b);
if (flags == NULL) if (flags == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment