https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122188
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:fbbce665b36da1b204d962c26b8645746fa35430 commit r14-12094-gfbbce665b36da1b204d962c26b8645746fa35430 Author: Jakub Jelinek <[email protected]> Date: Thu Oct 9 18:06:39 2025 +0200 gimplify: Fix up side-effect handling in 2nd __builtin_c[lt]zg argument [PR122188] The patch from yesterday made me think about side-effects in the second argument of __builtin_c[lt]zg. When we change __builtin_c[lt]zg (x, y) when y is not INTEGER_CST into x ? __builtin_c[lt]zg (x) : y with evaluating x only once, we omit the side-effects in y unless x is not 0. That looks undesirable, we should evaluate side-effects in y unconditionally. 2025-10-09 Jakub Jelinek <[email protected]> PR c/122188 * c-gimplify.cc (c_gimplify_expr): Also gimplify the second operand before the COND_EXPR and use in COND_EXPR result of gimplification. * gcc.dg/torture/pr122188.c: New test. (cherry picked from commit 579de8f5295b05573d05f6e4102f1428f35c9f17)
