Commit 6b1237e3 by Richard Sandiford Committed by Richard Sandiford

Add copy_rtx call to RTL loop unroller

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.

2017-09-21  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.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r253058
parent 2e89be48
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
Alan Hayward <alan.hayward@arm.com> Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com> David Sherwood <david.sherwood@arm.com>
* loop-unroll.c (split_iv): Call copy_rtx on the step.
2017-09-21 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* tree.c (find_atomic_core_type): Check tree_fits_uhwi_p before * tree.c (find_atomic_core_type): Check tree_fits_uhwi_p before
calling tree_to_uhwi. calling tree_to_uhwi.
...@@ -1731,7 +1731,8 @@ split_iv (struct iv_to_split *ivts, rtx_insn *insn, unsigned delta) ...@@ -1731,7 +1731,8 @@ split_iv (struct iv_to_split *ivts, rtx_insn *insn, unsigned delta)
else else
{ {
incr = simplify_gen_binary (MULT, mode, 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), expr = simplify_gen_binary (PLUS, GET_MODE (ivts->base_var),
ivts->base_var, incr); ivts->base_var, incr);
} }
......
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