From f2ca11ca979bebcee53d00eb0ac712289d6e3e3e Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 1 Mar 2011 13:18:25 +0000 Subject: [PATCH] re PR tree-optimization/47890 (internal compiler error: in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1186) 2011-03-01 Richard Guenther PR tree-optimization/47890 * tree-vect-loop.c (get_initial_def_for_induction): Set related stmt properly. * gcc.dg/torture/pr47890.c: New testcase. From-SVN: r170593 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr47890.c | 9 +++++++++ gcc/tree-vect-loop.c | 4 ++++ 4 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr47890.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79487c18b0c..c64de9d4f95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-01 Richard Guenther + + PR tree-optimization/47890 + * tree-vect-loop.c (get_initial_def_for_induction): Set + related stmt properly. + 2011-03-01 Richard Guenther PR lto/47924 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d5e79f82f2e..94bbe7ee6ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-01 Richard Guenther + + PR tree-optimization/47890 + * gcc.dg/torture/pr47890.c: New testcase. + 2011-03-01 Richard Guenther PR lto/47924 diff --git a/gcc/testsuite/gcc.dg/torture/pr47890.c b/gcc/testsuite/gcc.dg/torture/pr47890.c new file mode 100644 index 00000000000..83cb5e6d936 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47890.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +void f(char *s) +{ + signed short i; + + for (i = 0; i < 19; i = i + 1) + s[i] = i; +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index d474688ebec..7692eb8bc96 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2886,6 +2886,10 @@ get_initial_def_for_induction (gimple iv_phi) gimple_assign_set_lhs (new_stmt, induc_def); si = gsi_start_bb (bb); gsi_insert_before (&si, new_stmt, GSI_SAME_STMT); + set_vinfo_for_stmt (new_stmt, + new_stmt_vec_info (new_stmt, loop_vinfo, NULL)); + STMT_VINFO_RELATED_STMT (vinfo_for_stmt (new_stmt)) + = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (induction_phi)); } return induc_def; -- 2.30.2