https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111017
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> --- I tried the following - without understanding the code. But I looked at what the failing commit changes (GSI_SAME_STMT instead of GSI_CONTINUE_LINKING for the 'factor' case). The latter is used again (only effect) by passing true to the last argument 'bool after = false' of the newly added function. Currently, no call does pass 'true' thus it seems to be a simple oversight. And indeed the following change fixes the testcase for me: --- a/gcc/omp-expand.cc +++ b/gcc/omp-expand.cc @@ -2565 +2565,2 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi, - build_zero_cst (TREE_TYPE (factor))); + build_zero_cst (TREE_TYPE (factor)), + true);