https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120564
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:b9693dfdefbe07e1412e995b19d5ebc2ae442558 commit r15-10581-gb9693dfdefbe07e1412e995b19d5ebc2ae442558 Author: Jakub Jelinek <[email protected]> Date: Tue Nov 25 10:30:51 2025 +0100 openmp: Fix up OpenMP expansion of collapsed loops [PR120564] Most of gimple_build_cond_empty callers call just build2 to prepare condition which is put into GIMPLE_COND, but this one spot has been using incorrectly fold_build2. Now the arguments of the *build2 were already gimplified, but the folding of some conditions can turn say unsigned_var > INT_MAX into (int) unsigned_var < 0 etc. and thus turn the condition into something invalid in gimple, because we only try to regimplify the operands if they refer to some decl which needs to be regimplified (has DECL_VALUE_EXPR on it). Fixed by also using build2 instead of fold_build2. 2025-11-25 Jakub Jelinek <[email protected]> PR middle-end/120564 * omp-expand.cc (extract_omp_for_update_vars): Use build2 instead of fold_build2 to build argument for gimple_build_cond_empty. * c-c++-common/gomp/pr120564.c: New test. (cherry picked from commit a117fd63e423fb60f5e5f07125a11c7183109bf2)
