[Committed] Fix truncate of a memory for vector mode

Message ID CA+=Sn1mFzu+S713E13FfD1jbzJ4hPQ5D_R_eXvzb9nP307PSpQ@mail.gmail.com
State New
Headers show

Commit Message

Andrew Pinski Oct. 2, 2012, 9:03 p.m.
  When I implemented the simplification of a truncate of a memory, I
did not think about the case where we would have a truncate of a
vector mode.  This fixes this case.
Committed as obvious after a bootstrap and test on x86_64-linux-gnu
and also a build and test for arm-linux-gnueabi.

Andrew Pinski
2012-10-02  Andrew Pinski  <apinski@cavium.com>

	* simplify-rtx.c (simplify_unary_operation_1 <case TRUNCATE>):
	Don't optimize a truncate of a mem if it is a vector mode.


Index: simplify-rtx.c
--- simplify-rtx.c	(revision 192004)
+++ simplify-rtx.c	(working copy)
@@ -873,6 +873,7 @@  simplify_unary_operation_1 (enum rtx_cod
       /* A truncate of a memory is just loading the low part of the memory
 	 if we are not changing the meaning of the address. */
       if (GET_CODE (op) == MEM
+	  && !VECTOR_MODE_P (mode)
 	  && !MEM_VOLATILE_P (op)
 	  && !mode_dependent_address_p (XEXP (op, 0), MEM_ADDR_SPACE (op)))
 	return rtl_hooks.gen_lowpart_no_emit (mode, op);