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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Lewis Hyatt <lhy...@gcc.gnu.org>:

https://gcc.gnu.org/g:83e291014fff0b3ce1baedf59292390726d67335

commit r15-6462-g83e291014fff0b3ce1baedf59292390726d67335
Author: Lewis Hyatt <lhy...@gmail.com>
Date:   Thu Dec 26 10:58:57 2024 -0500

    tree-optimization: Fix ICE in tree-parloops.cc reduction_phi() [PR118205]

    Prior to r15-6001, reduction_phi() could be called with the PHI parameter
    not actually being a gphi*. The search through reduction_list would fail
and
    return NULL. r15-6001 added a requirement that PHI actually be a gphi*, but
    did not add a check for this. The PR shows an example where the check is
    needed; fix by explicitly returning NULL in this case.

    gcc/ChangeLog:

            PR tree-optimization/118205
            * tree-parloops.cc (reduction_phi): Return NULL if PHI parameter is
            not a phi node.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/118205
            * c-c++-common/pr118205.c: New test.

Reply via email to