Andrew Pinski <[email protected]> writes:
> The problem here is that adjust_address returns the same rtl as we
> already have a BLKmode; mips_block_move_straight pass a BLKmode MEM to
> mips_expand_ext_as_unaligned_load.
> The following patch fixes the problem by copying the MEM after calling
> adjust_address. This does increase garbage slightly but not enough to
> take a notice. I could only get this to expose after improving
> mips_block_move_straight but it could show up in otherwise. The
> testcase where it showed has already been committed as
> testsuite/gcc.c-torture/compile/20120524-1.c .
>
> OK? Bootstrapped and tested on mips64-linux-gnu with no regressions.
>
> ChangeLog:
> * config/mips/mips.c (mips_get_unaligned_mem): Copy *op after calling
> adjust_address.
>
> Index: config/mips/mips.c
> ===================================================================
> --- config/mips/mips.c (revision 189542)
> +++ config/mips/mips.c (working copy)
> @@ -7220,6 +7220,8 @@ mips_get_unaligned_mem (rtx *op, HOST_WI
> /* Adjust *OP to refer to the whole field. This also has the effect
> of legitimizing *OP's address for BLKmode, possibly simplifying it. */
> *op = adjust_address (*op, BLKmode, 0);
> + /* Copy the RTX as adjust_address might return the original rtl. */
> + *op = copy_rtx (*op);
Sorry to be so picky, but I'd prefer:
/* Create a copy of *OP that refers to the whole field. This also has
the effect of legitimizing *OP's address for BLKmode, possibly
simplifying it. */
*op = copy_rtx (adjust_address (*op, BLKmode, 0));
OK with that change, thanks.
Richard