https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122188

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:579de8f5295b05573d05f6e4102f1428f35c9f17

commit r16-4331-g579de8f5295b05573d05f6e4102f1428f35c9f17
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.

Reply via email to