https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96291
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Martin Liska <mar...@gcc.gnu.org>: https://gcc.gnu.org/g:18c81c8a780758ea596c530321ef5e7459b3d16f commit r10-8613-g18c81c8a780758ea596c530321ef5e7459b3d16f 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. (cherry picked from commit cbf10ac51c0b889e930f260a3d1fb601332befdf)