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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sergei Trofimovich <sly...@gcc.gnu.org>:

https://gcc.gnu.org/g:cbf10ac51c0b889e930f260a3d1fb601332befdf

commit r11-2391-gcbf10ac51c0b889e930f260a3d1fb601332befdf
Author: Sergei Trofimovich <siarh...@google.com>
Date:   Sat Jul 25 19:26:50 2020 +0100

    ipa/96291: don't crash on unoptimized lto functions

    In PR ipa/96291 the test contained an SCC with one
    unoptimized function. This tricked ipa-cp into NULL dereference.

    has_undead_caller_from_outside_scc_p() did not take into account
    that unoptimized funtions don't have IPA summary analysis. And
    dereferenced NULL pointer causing an ICE.

    gcc/
            PR ipa/96291
            * ipa-cp.c (has_undead_caller_from_outside_scc_p): Consider
            unoptimized callers as undead.

    gcc/testsuite/
            PR ipa/96291
            * gcc.dg/lto/pr96291_0.c: New testcase.
            * gcc.dg/lto/pr96291_1.c: Support file.
            * gcc.dg/lto/pr96291_2.c: Likewise.
            * gcc.dg/lto/pr96291.h: Likewise.

Reply via email to