https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Author: dmalcolm Date: Tue Nov 13 15:59:57 2018 New Revision: 266079 URL: https://gcc.gnu.org/viewcvs?rev=266079&root=gcc&view=rev Log: Fix ICE with -fopt-info-inline (PR ipa/87955) PR ipa/87955 reports a problem I introduced in r265920, where I converted the guard in report_inline_failed_reason from using: if (dump_file) to using if (dump_enabled_p ()). without updating the calls to cl_target_option_print_diff and cl_optimization_print_diff, which assume that dump_file is non-NULL. The functions are auto-generated. Rather than porting them to the dump API, this patch applies the workaround of adding the missing checks on dump_file before calling them. gcc/ChangeLog: PR ipa/87955 * ipa-inline.c (report_inline_failed_reason): Guard calls to cl_target_option_print_diff and cl_optimization_print_diff with if (dump_file). gcc/testsuite/ChangeLog: PR ipa/87955 * gcc.target/i386/pr87955.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr87955.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-inline.c trunk/gcc/testsuite/ChangeLog