aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
-rw-r--r--gcc/tree-ssa-loop-manip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index f072418..ecbe212 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -139,7 +139,8 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
}
else
{
- gimple_set_location (stmt, gimple_location (gsi_stmt (*incr_pos)));
+ if (!gsi_end_p (*incr_pos))
+ gimple_set_location (stmt, gimple_location (gsi_stmt (*incr_pos)));
gsi_insert_before (incr_pos, stmt, GSI_NEW_STMT);
}