aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-09-26 12:45:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-09-26 12:45:19 +0000
commit46e950dbb155a0bc0abb279920d3fd3914032bde (patch)
tree268ca12fe8554623fafe7680262025d39f07f6e6 /gcc/tree-vect-loop.c
parent40ada30a792dd7e6518118b83cacc03ff03ffc69 (diff)
downloadgcc-46e950dbb155a0bc0abb279920d3fd3914032bde.zip
gcc-46e950dbb155a0bc0abb279920d3fd3914032bde.tar.gz
gcc-46e950dbb155a0bc0abb279920d3fd3914032bde.tar.bz2
re PR tree-optimization/58539 (ICE with segfault at -O3 with -g enabled on x86_64-linux-gnu)
2013-09-26 Richard Biener <rguenther@suse.de> PR tree-optimization/58539 * tree-vect-loop.c (vect_create_epilog_for_reduction): Honor the fact that debug statements are not taking part in loop-closed SSA construction. * gcc.dg/torture/pr58539.c: New testcase. From-SVN: r202942
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 2871ba1..072d44e 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4411,7 +4411,8 @@ vect_finalize_reduction:
result. (The reduction result is expected to have two immediate uses -
one at the latch block, and one at the loop exit). */
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
- if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p)))
+ && !is_gimple_debug (USE_STMT (use_p)))
phis.safe_push (USE_STMT (use_p));
/* While we expect to have found an exit_phi because of loop-closed-ssa
@@ -4541,7 +4542,10 @@ vect_finalize_reduction:
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
{
if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
- phis.safe_push (USE_STMT (use_p));
+ {
+ if (!is_gimple_debug (USE_STMT (use_p)))
+ phis.safe_push (USE_STMT (use_p));
+ }
else
{
if (double_reduc && gimple_code (USE_STMT (use_p)) == GIMPLE_PHI)
@@ -4551,7 +4555,8 @@ vect_finalize_reduction:
FOR_EACH_IMM_USE_FAST (phi_use_p, phi_imm_iter, phi_res)
{
if (!flow_bb_inside_loop_p (loop,
- gimple_bb (USE_STMT (phi_use_p))))
+ gimple_bb (USE_STMT (phi_use_p)))
+ && !is_gimple_debug (USE_STMT (phi_use_p)))
phis.safe_push (USE_STMT (phi_use_p));
}
}