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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:95c74f354ae3186e84fbada22d2e7f3845dbb659

commit r16-769-g95c74f354ae3186e84fbada22d2e7f3845dbb659
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Tue May 20 13:21:28 2025 -0700

    middle-end: Fix complex lowering of cabs with no LHS [PR120369]

    This was introduced by r15-1797-gd8fe4f05ef448e . I had missed that
    the LHS of the cabs call could be NULL. This seems to only happen at -O0,
    I tried to produce one that happens at -O1 but needed many different
    options to prevent the removal of the call.
    Anyways the fix is just keep around the call if the LHS is null.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR middle-end/120369

    gcc/ChangeLog:

            * tree-complex.cc (gimple_expand_builtin_cabs): Return early
            if the LHS of cabs is null.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr120369-1.c: New test.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Reply via email to