]> gcc.gnu.org Git - gcc.git/commit
ipa/96291: don't crash on unoptimized lto functions
authorSergei Trofimovich <siarheit@google.com>
Sat, 25 Jul 2020 18:26:50 +0000 (19:26 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 12 Aug 2020 17:40:01 +0000 (19:40 +0200)
commit18c81c8a780758ea596c530321ef5e7459b3d16f
tree88ee09e83eb1dfb44b0ca14648d0ee94c0ef7383
parentd8f4f1903eac5853b51e56b8e80743bc66adbb3d
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)
gcc/ipa-cp.c
gcc/testsuite/gcc.dg/lto/pr96291.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr96291_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr96291_1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr96291_2.c [new file with mode: 0644]
This page took 0.060489 seconds and 6 git commands to generate.