https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80233
--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> --- Author: segher Date: Wed Mar 29 20:53:59 2017 New Revision: 246575 URL: https://gcc.gnu.org/viewcvs?rev=246575&root=gcc&view=rev Log: combine: Fix PR80233 If combine has added an unconditional trap there will be a new basic block as well. It will then end up considering the NOTE_INSN_BASIC_BLOCK as the last_combined_insn, but then it tries to take the DF_INSN_LUID of that and that dereferences a NULL pointer (since such a note is not an INSN_P). This fixes it by not taking non-insns as last_combined_insn. PR rtl-optimization/80233 * combine.c (combine_instructions): Only take NONDEBUG_INSN_P insns as last_combined_insn. Do not test for BARRIER_P separately. gcc/testsuite/ PR rtl-optimization/80233 * gcc.c-torture/compile/pr80233.c: New testcase. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr80233.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/testsuite/ChangeLog