Commit 3f36bac2 by Adam Nemet

combine.c (make_extraction): Check TRULY_NOOP_TRUNCATION before creating LHS paradoxical subregs.

	* combine.c (make_extraction): Check TRULY_NOOP_TRUNCATION before
	creating LHS paradoxical subregs.  Fix surrounding returns to
	use NULL_RTX rather than 0.

From-SVN: r149401
parent ae30c1fa
2009-07-08 Adam Nemet <anemet@caviumnetworks.com>
* combine.c (make_extraction): Check TRULY_NOOP_TRUNCATION before
creating LHS paradoxical subregs. Fix surrounding returns to
use NULL_RTX rather than 0.
2009-07-08 DJ Delorie <dj@redhat.com> 2009-07-08 DJ Delorie <dj@redhat.com>
* config/mep/mep.c: (mep_option_can_inline_p): New. * config/mep/mep.c: (mep_option_can_inline_p): New.
......
...@@ -6692,18 +6692,25 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, ...@@ -6692,18 +6692,25 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
inner = adjust_address_nv (inner, wanted_inner_mode, offset); inner = adjust_address_nv (inner, wanted_inner_mode, offset);
} }
/* If INNER is not memory, we can always get it into the proper mode. If we /* If INNER is not memory, get it into the proper mode. If we are changing
are changing its mode, POS must be a constant and smaller than the size its mode, POS must be a constant and smaller than the size of the new
of the new mode. */ mode. */
else if (!MEM_P (inner)) else if (!MEM_P (inner))
{ {
/* On the LHS, don't create paradoxical subregs implicitely truncating
the register unless TRULY_NOOP_TRUNCATION. */
if (in_dest
&& !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (inner)),
GET_MODE_BITSIZE (wanted_inner_mode)))
return NULL_RTX;
if (GET_MODE (inner) != wanted_inner_mode if (GET_MODE (inner) != wanted_inner_mode
&& (pos_rtx != 0 && (pos_rtx != 0
|| orig_pos + len > GET_MODE_BITSIZE (wanted_inner_mode))) || orig_pos + len > GET_MODE_BITSIZE (wanted_inner_mode)))
return 0; return NULL_RTX;
if (orig_pos < 0) if (orig_pos < 0)
return 0; return NULL_RTX;
inner = force_to_mode (inner, wanted_inner_mode, inner = force_to_mode (inner, wanted_inner_mode,
pos_rtx pos_rtx
......
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