When gimple_expand_vec_set_expr succeeds, it can remove last
statements of a BB and so gsi_next(gsi->ptr) leads to ICE.

Fixed with the patch.
Ready for master?

Thanks,
Martin

gcc/ChangeLog:

        PR tree-optimization/98066
        * gimple-isel.cc (gimple_expand_vec_exprs): Return when
        gimple_expand_vec_exprs replaces last stmt.
---
 gcc/gimple-isel.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc
index 048b407bd11..d79c212748f 100644
--- a/gcc/gimple-isel.cc
+++ b/gcc/gimple-isel.cc
@@ -273,6 +273,8 @@ gimple_expand_vec_exprs (void)
            }
gimple_expand_vec_set_expr (&gsi);
+         if (gsi_end_p (gsi))
+           break;
        }
     }
--
2.29.2

Reply via email to