From 131138d51d22ea58e95a8f21e75f67aab7881854 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 5 Jul 2019 17:38:28 +0000 Subject: [PATCH] * tree-ssa-loop-manip.c (create_iv): Add missing guard for gsi_end_p. From-SVN: r273145 --- gcc/ChangeLog | 8 ++++++-- gcc/tree-ssa-loop-manip.c | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53e671410ed..7b1109bf7ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,12 @@ +2019-07-05 Eric Botcazou + + * tree-ssa-loop-manip.c (create_iv): Add missing guard for gsi_end_p. + 2019-07-05 Sam Tebbs PR target/90712 - * aarch64/aarch64.c (aarch64_post_cfi_startproc): Replace thunk check - with a frame laid out check. + * config/aarch64/aarch64.c (aarch64_post_cfi_startproc): Replace thunk + check with a frame laid out check. 2019-07-05 Richard Biener diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index f072418909b..ecbe212369e 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); } -- 2.30.2