From: Richard Sandiford Date: Thu, 21 Sep 2017 11:10:48 +0000 (+0000) Subject: Add copy_rtx call to RTL loop unroller X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b1237e30840dac66ae8d16507581c948c76c52c;p=gcc.git 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 Alan Hayward David Sherwood gcc/ * loop-unroll.c (split_iv): Call copy_rtx on the step. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r253058 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8d78c7ad58..7eec76768dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-09-21 Richard Sandiford + Alan Hayward + David Sherwood + + * loop-unroll.c (split_iv): Call copy_rtx on the step. + 2017-09-21 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 8cf305b24c5..322f151ac5d 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -1731,7 +1731,8 @@ split_iv (struct iv_to_split *ivts, rtx_insn *insn, unsigned delta) 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); }