diff mbox series

Add copy_rtx call to RTL loop unroller

Message ID 87377h1rne.fsf@linaro.org
State New
Headers show
Series Add copy_rtx call to RTL loop unroller | expand

Commit Message

Richard Sandiford Sept. 20, 2017, 12:27 p.m. UTC
This is needed if the step is an unshared constant, like many
(const ...)s are.  Without this patch, libgfortran would fail
to build for SVE.

Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linus-gnu.
OK to install?

Richard


2017-09-20  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* loop-unroll.c (split_iv): Call copy_rtx on the step.

Comments

Richard Biener Sept. 20, 2017, 3:02 p.m. UTC | #1
On September 20, 2017 2:27:49 PM GMT+02:00, Richard Sandiford <richard.sandiford@linaro.org> wrote:
>This is needed if the step is an unshared constant, like many
>(const ...)s are.  Without this patch, libgfortran would fail
>to build for SVE.
>
>Tested on aarch64-linux-gnu, x86_64-linux-gnu and
>powerpc64le-linus-gnu.
>OK to install?

OK. 

Richard. 

>Richard
>
>
>2017-09-20  Richard Sandiford  <richard.sandiford@linaro.org>
>	    Alan Hayward  <alan.hayward@arm.com>
>	    David Sherwood  <david.sherwood@arm.com>
>
>gcc/
>	* loop-unroll.c (split_iv): Call copy_rtx on the step.
>
>Index: gcc/loop-unroll.c
>===================================================================
>--- gcc/loop-unroll.c	2017-08-30 12:13:52.715828832 +0100
>+++ gcc/loop-unroll.c	2017-09-20 13:26:14.451718893 +0100
>@@ -1731,7 +1731,8 @@ split_iv (struct iv_to_split *ivts, rtx_
>   else
>     {
>       incr = simplify_gen_binary (MULT, mode,
>-				  ivts->step, gen_int_mode (delta, mode));
>+				  copy_rtx (ivts->step),
>+				  gen_int_mode (delta, mode));
>       expr = simplify_gen_binary (PLUS, GET_MODE (ivts->base_var),
> 				  ivts->base_var, incr);
>     }
diff mbox series

Patch

Index: gcc/loop-unroll.c
===================================================================
--- gcc/loop-unroll.c	2017-08-30 12:13:52.715828832 +0100
+++ gcc/loop-unroll.c	2017-09-20 13:26:14.451718893 +0100
@@ -1731,7 +1731,8 @@  split_iv (struct iv_to_split *ivts, rtx_
   else
     {
       incr = simplify_gen_binary (MULT, mode,
-				  ivts->step, gen_int_mode (delta, mode));
+				  copy_rtx (ivts->step),
+				  gen_int_mode (delta, mode));
       expr = simplify_gen_binary (PLUS, GET_MODE (ivts->base_var),
 				  ivts->base_var, incr);
     }