Fix ICE in get_initial_defs_for_reduction (PR 88567)
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 7 Jan 2019 16:00:52 +0000 (16:00 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 7 Jan 2019 16:00:52 +0000 (16:00 +0000)
commit18fd43b95264a7244b50fd34cf983f4d78c208dc
tree172176ce412363181232105e2e60d4016975e8a3
parente002afaa8e01395110c77de18bb7e0fa030ba019
Fix ICE in get_initial_defs_for_reduction (PR 88567)

The use of "j" in:

      init = permute_results[number_of_vectors - j - 1];

was out-of-sync with the new flat loop structure.  Now that all that
reversing is gone, we can just use the result of duplicate_and_interleave
directly.

The other cases shouldn't be affected by postponing the insertion
of ctor_seq, since gimple_build* appends to the seq without clearing
it first (unlike some of the gimplify routines).

The ICE is already covered by gcc.dg/vect/pr63379.c.

2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/88567
* tree-vect-loop.c (get_initial_defs_for_reduction): Pass the
output vector directly to duplicate_and_interleave instead of
going through a temporary.  Postpone insertion of ctor_seq to
the end of the loop.

From-SVN: r267652
gcc/ChangeLog
gcc/tree-vect-loop.c