From: Jakub Jelinek Date: Mon, 22 Aug 2011 15:01:42 +0000 (+0200) Subject: re PR tree-optimization/50133 (ICE: SIGSEGV in vect_finish_stmt_generation (gimple... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad885386508bd87fbc5713470fb0268d5e82b668;p=gcc.git re PR tree-optimization/50133 (ICE: SIGSEGV in vect_finish_stmt_generation (gimple.h:4821) with -ftree-vectorize -fno-tree-loop-im) PR tree-optimization/50133 * tree-vect-stmts.c (vect_finish_stmt_generation): Copy location from stmt instead of some statement around gsi. * gcc.dg/pr50133.c: New test. From-SVN: r177958 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14ab8591350..b0aaf468f54 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2011-08-22 Jakub Jelinek + PR tree-optimization/50133 + * tree-vect-stmts.c (vect_finish_stmt_generation): Copy location + from stmt instead of some statement around gsi. + PR middle-end/50141 * expr.c (get_bit_range): Only use DECL_THREAD_LOCAL_P if innerdecl is a VAR_DECL. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72feb20c493..67a5e89e1ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2011-08-22 Jakub Jelinek + PR tree-optimization/50133 + * gcc.dg/pr50133.c: New test. + PR middle-end/50141 * c-c++-common/cxxbitfields-6.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr50133.c b/gcc/testsuite/gcc.dg/pr50133.c new file mode 100644 index 00000000000..2c0f490cfbe --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr50133.c @@ -0,0 +1,18 @@ +/* PR tree-optimization/50133 */ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vectorize -fno-tree-loop-im" } */ + +extern int A[], B[]; + +void +foo (int z) +{ + int j, i; + for (j = 0; j < 32; j++) + { + int a = A[0]; + for (i = 0; i < 16; i++) + a = A[i] ? a : z; + B[j] = a; + } +} diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index c0ca2af8e80..bab19b8845b 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1419,7 +1419,6 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_stmt, stmt_vec_info stmt_info = vinfo_for_stmt (stmt); loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); - gimple_stmt_iterator si; gcc_assert (gimple_code (stmt) != GIMPLE_LABEL); @@ -1434,13 +1433,7 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_stmt, print_gimple_stmt (vect_dump, vec_stmt, 0, TDF_SLIM); } - si = *gsi; - if (is_gimple_debug (gsi_stmt (si))) - { - gsi_next_nondebug (&si); - gcc_assert (!gsi_end_p (si)); - } - gimple_set_location (vec_stmt, gimple_location (gsi_stmt (si))); + gimple_set_location (vec_stmt, gimple_location (stmt)); } /* Checks if CALL can be vectorized in type VECTYPE. Returns