g++ -fipa-vrp -fipa-pta -fipa-cp -flto ./hi.c INPUT : ./hi.c int main() { } OUTPUT : during IPA pass: cp lto1: internal compiler error: Segmentation fault 0x268adb9 crash_signal ../.././gcc/toplev.c:328 0x5394138 ipcp_store_vr_results ../.././gcc/ipa-cp.c:5673 0x5394138 ipcp_driver ../.././gcc/ipa-cp.c:5752 Version: g++ (GCC) 10.0.0 20191218 (experimental)
Works fine with 6/7/8/9 branches, as it is on the lto1 side, can't unfortunately bisect.
Heh, ipcp_store_vr_results checks for flag_ipa_vrp but not for flag_ipa_cp or optimize, which means that it accesses info which has not been created. I suppose it's best to do what ipcp_store_bits_results does: diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 243b064ee2c..a29e96613a3 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -5661,7 +5661,7 @@ ipcp_store_vr_results (void) ipa_node_params *info = IPA_NODE_REF (node); bool found_useful_result = false; - if (!opt_for_fn (node->decl, flag_ipa_vrp)) + if (!opt_for_fn (node->decl, flag_ipa_vrp) || !info) { if (dump_file) fprintf (dump_file, "Not considering %s for VR discovery "
I proposed a patch on the mailing list: https://gcc.gnu.org/ml/gcc-patches/2019-12/msg01451.html
Author: jamborm Date: Sat Dec 21 11:25:05 2019 New Revision: 279695 URL: https://gcc.gnu.org/viewcvs?rev=279695&root=gcc&view=rev Log: Avoid segfault when doing IPA-VRP but not IPA-CP (PR 93015) 2019-12-21 Martin Jambor <mjambor@suse.cz> PR ipa/93015 * ipa-cp.c (ipcp_store_vr_results): Check that info exists testsuite/ * gcc.dg/lto/pr93015_0.c: New test. Added: trunk/gcc/testsuite/gcc.dg/lto/pr93015_0.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-cp.c trunk/gcc/testsuite/ChangeLog
Should be fixed now.