From 5bb6669db3da9da5e13a6af66a2f656e654ca7ea Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 1 Jan 2013 00:50:00 +0100 Subject: [PATCH] re PR tree-optimization/55831 (ICE: verify_flow_info failed) PR tree-optimization/55831 * tree-vect-loop.c (get_initial_def_for_induction): Use gsi_after_labels instead of gsi_start_bb. * gcc.dg/pr55831.c: New test. From-SVN: r194764 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr55831.c | 39 +++++++++++++++++++++++++++++++++++++++ gcc/tree-vect-loop.c | 6 +++--- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr55831.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae21e02..6e565b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-01 Jakub Jelinek + + PR tree-optimization/55831 + * tree-vect-loop.c (get_initial_def_for_induction): Use + gsi_after_labels instead of gsi_start_bb. + 2012-12-27 David Edelsohn * config/rs6000/rs6000.c (rs6000_deligitimze_address): Do not diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6687189..a7b7840 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-01 Jakub Jelinek + + PR tree-optimization/55831 + * gcc.dg/pr55831.c: New test. + 2012-12-31 Uros Bizjak * g++.dg/ipa/devirt-9.C: Cleanup inline ipa dump. diff --git a/gcc/testsuite/gcc.dg/pr55831.c b/gcc/testsuite/gcc.dg/pr55831.c new file mode 100644 index 0000000..ce7be63 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr55831.c @@ -0,0 +1,39 @@ +/* PR tree-optimization/55831 */ +/* { dg-do compile } */ +/* { dg-options "-O -fstrict-overflow -ftree-vectorize -Wno-unused-label" } */ + +int g; +short p, q; + +void +foo (void) +{ + short a = p, b = q, i; + + if (a) + { + label: + for (i = 0; i < 8; i++) + b ^= a++; + + if (!b) + g = 0; + } +} + +void +bar (void) +{ + short a = p, b = q, i; + + if (a) + { + label: + for (i = 0; i < 8; i++) + b ^= (a = a + 1); + + if (!b) + g = 0; + } +} + diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 633d3d1..f091604 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1,6 +1,6 @@ /* Loop Vectorization - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 - Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, + 2013 Free Software Foundation, Inc. Contributed by Dorit Naishlos and Ira Rosen @@ -3406,7 +3406,7 @@ get_initial_def_for_induction (gimple iv_phi) build1 (VIEW_CONVERT_EXPR, resvectype, induc_def), NULL_TREE); induc_def = make_ssa_name (gimple_assign_lhs (new_stmt), new_stmt); gimple_assign_set_lhs (new_stmt, induc_def); - si = gsi_start_bb (bb); + si = gsi_after_labels (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)); -- 2.7.4