aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2019-07-05 17:38:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-07-05 17:38:28 +0000
commit131138d51d22ea58e95a8f21e75f67aab7881854 (patch)
treecf17220dae6b192f29f43225defdde37625e76f2 /gcc/tree-ssa-loop-manip.c
parent0dc7adb03718396db1397be1ba1cb3482af957f7 (diff)
downloadgcc-131138d51d22ea58e95a8f21e75f67aab7881854.zip
gcc-131138d51d22ea58e95a8f21e75f67aab7881854.tar.gz
gcc-131138d51d22ea58e95a8f21e75f67aab7881854.tar.bz2
* tree-ssa-loop-manip.c (create_iv): Add missing guard for gsi_end_p.
From-SVN: r273145
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);
}