diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2009-11-18 06:02:58 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2009-11-18 06:02:58 +0000 |
commit | a83452e99b8a902287eaf065f98bf40c76771502 (patch) | |
tree | a6b88362e8d78afe576037d96a3eb40ad1eca386 /gcc | |
parent | 462b701b20f1d303c27bff97e9ab7ac5729959ca (diff) | |
download | gcc-a83452e99b8a902287eaf065f98bf40c76771502.zip gcc-a83452e99b8a902287eaf065f98bf40c76771502.tar.gz gcc-a83452e99b8a902287eaf065f98bf40c76771502.tar.bz2 |
re PR debug/41926 ([VTA] internal compiler error: verify_ssa failed)
gcc/ChangeLog:
PR debug/41926
* tree-vect-loop.c (vect_loop_kill_debug_uses): New.
(vect_transform_loop): Call it.
gcc/testsuite/ChangeLog:
PR debug/41926
* gcc.dg/vect/vect-debug-pr41926.c: New.
From-SVN: r154281
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c | 20 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 46 |
4 files changed, 76 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0545a5c..256721f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2009-11-18 Alexandre Oliva <aoliva@redhat.com> + PR debug/41926 + * tree-vect-loop.c (vect_loop_kill_debug_uses): New. + (vect_transform_loop): Call it. + +2009-11-18 Alexandre Oliva <aoliva@redhat.com> + * tree-ssa.c (insert_debug_temp_for_var_def): Fix handling of released SSA names. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0cbfda2..3ebf59b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-11-18 Alexandre Oliva <aoliva@redhat.com> + + PR debug/41926 + * gcc.dg/vect/vect-debug-pr41926.c: New. + 2009-11-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/42058 diff --git a/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c b/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c new file mode 100644 index 0000000..6eea84a --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c @@ -0,0 +1,20 @@ +/* PR debug/41926 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -ffast-math -funroll-loops -ftree-vectorize -msse2" { target { i?86-*-* x86_64-*-* } } } */ + +void +foo (double (*__restrict p)[4], double (*__restrict q)[4], + double *__restrict prim, double scale, double pp, double pq) +{ + int md, mc, mb, ma, p_index = 0; + + for (md = 0; md < 1; md++) + for (mc = 0; mc < 1; mc++) + for (mb = 0; mb < 1; mb++) + for (ma = 0; ma < 4; ma++) + { + double tmp = scale * prim[p_index++]; + p[md][ma] = p[md][ma] - tmp * pp; + q[mc][ma] = q[mc][ma] - tmp * pq; + } +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index c235770..55b9fb2 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4112,6 +4112,44 @@ vectorizable_live_operation (gimple stmt, return true; } +/* Kill any debug uses outside LOOP of SSA names defined in STMT. */ + +static void +vect_loop_kill_debug_uses (struct loop *loop, gimple stmt) +{ + ssa_op_iter op_iter; + imm_use_iterator imm_iter; + def_operand_p def_p; + gimple ustmt; + + FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF) + { + FOR_EACH_IMM_USE_STMT (ustmt, imm_iter, DEF_FROM_PTR (def_p)) + { + basic_block bb; + + if (!is_gimple_debug (ustmt)) + continue; + + bb = gimple_bb (ustmt); + + if (!flow_bb_inside_loop_p (loop, bb)) + { + if (gimple_debug_bind_p (ustmt)) + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "killing debug use"); + + gimple_debug_bind_reset_value (ustmt); + update_stmt (ustmt); + } + else + gcc_unreachable (); + } + } + } +} + /* Function vect_transform_loop. The analysis phase has determined that the loop is vectorizable. @@ -4202,7 +4240,11 @@ vect_transform_loop (loop_vec_info loop_vinfo) if (!STMT_VINFO_RELEVANT_P (stmt_info) && !STMT_VINFO_LIVE_P (stmt_info)) - continue; + { + if (MAY_HAVE_DEBUG_STMTS) + vect_loop_kill_debug_uses (loop, phi); + continue; + } if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)) != (unsigned HOST_WIDE_INT) vectorization_factor) @@ -4242,6 +4284,8 @@ vect_transform_loop (loop_vec_info loop_vinfo) if (!STMT_VINFO_RELEVANT_P (stmt_info) && !STMT_VINFO_LIVE_P (stmt_info)) { + if (MAY_HAVE_DEBUG_STMTS) + vect_loop_kill_debug_uses (loop, stmt); gsi_next (&si); continue; } |